1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-07 23:47:30 +00:00

Make Appbar in profile view scrollable

This commit is contained in:
Ammar Githam 2020-08-11 20:44:51 +09:00
parent c1b113e275
commit 31d02b3e12
2 changed files with 13 additions and 13 deletions

View File

@ -412,18 +412,18 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
// main.mainBinding.profileView.profileInfo.setBackgroundColor(color);
// if (!isBottomToolbar) main.mainBinding.toolbar.toolbar.setBackgroundColor(color);
main.mainBinding.profileView.appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
private int height;
@Override
public void onOffsetChanged(final AppBarLayout appBarLayout, final int verticalOffset) {
if (height == 0) {
height = main.mainBinding.profileView.profileInfo.getHeight();
collapsingToolbar.setMinimumHeight(height);
}
main.mainBinding.profileView.profileInfo.setTranslationY(-Math.min(0, verticalOffset));
}
});
// main.mainBinding.profileView.appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
// private int height;
//
// @Override
// public void onOffsetChanged(final AppBarLayout appBarLayout, final int verticalOffset) {
// if (height == 0) {
// height = main.mainBinding.profileView.profileInfo.getHeight();
// collapsingToolbar.setMinimumHeight(height);
// }
// main.mainBinding.profileView.profileInfo.setTranslationY(-Math.min(0, verticalOffset));
// }
// });
main.setSupportActionBar(main.mainBinding.toolbar.toolbar);
if (isBottomToolbar) {

View File

@ -16,7 +16,7 @@
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="noScroll">
app:layout_scrollFlags="scroll|enterAlways">
<RelativeLayout
android:id="@+id/infoContainer"