mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
ToolBar削除
This commit is contained in:
parent
50dfb9be8b
commit
ad3a600e8c
|
@ -94,31 +94,5 @@ public class LibraryTopFragment extends Fragment {
|
||||||
listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1);
|
listItemAdapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size() - 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
CollapsingToolbarLayout collapsingToolbarLayout = view.findViewById(R.id.collapsing_toolbar);
|
|
||||||
Toolbar toolbar = view.findViewById(R.id.toolbar);
|
|
||||||
|
|
||||||
// Set the Toolbar
|
|
||||||
((AppCompatActivity)getActivity()).setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
// Set the title of the CollapsingToolbarLayout
|
|
||||||
collapsingToolbarLayout.setTitle("Library");
|
|
||||||
|
|
||||||
AppBarLayout appBarLayout = view.findViewById(R.id.app_bar_layout);
|
|
||||||
appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
|
|
||||||
@Override
|
|
||||||
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
|
|
||||||
if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) {
|
|
||||||
// Collapsed
|
|
||||||
getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getActivity(), one.nem.lacerta.shared.ui.R.color.colorSecondaryContainer));
|
|
||||||
} else if (verticalOffset == 0) {
|
|
||||||
// Expanded
|
|
||||||
getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getActivity(), one.nem.lacerta.shared.ui.R.color.colorSurface));
|
|
||||||
} else {
|
|
||||||
// Somewhere in between
|
|
||||||
// Here you can add a color transition if you want
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user