From 31d02b3e1217179956d0304964d92f7da4d902a1 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Tue, 11 Aug 2020 20:44:51 +0900 Subject: [PATCH] Make Appbar in profile view scrollable --- .../java/awais/instagrabber/MainHelper.java | 24 +++++++++---------- .../main/res/layout/layout_profile_view.xml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/MainHelper.java b/app/src/main/java/awais/instagrabber/MainHelper.java index 23fb0fe3..ab82ba7d 100755 --- a/app/src/main/java/awais/instagrabber/MainHelper.java +++ b/app/src/main/java/awais/instagrabber/MainHelper.java @@ -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) { diff --git a/app/src/main/res/layout/layout_profile_view.xml b/app/src/main/res/layout/layout_profile_view.xml index 86194199..9312eb2e 100644 --- a/app/src/main/res/layout/layout_profile_view.xml +++ b/app/src/main/res/layout/layout_profile_view.xml @@ -16,7 +16,7 @@ + app:layout_scrollFlags="scroll|enterAlways">