ToolBar削除

This commit is contained in:
ろむねこ 2024-01-22 11:02:08 +09:00
parent e1129bc009
commit fafb996453
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -95,32 +95,6 @@ public class HomeTopFragment extends Fragment {
listItemAdapter.notifyItemRangeInserted(0, listItems.size());
});
});
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("Lacerta");
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
}
}
});
}
}