From e7e8d13d9e808165eaf54b361993430993c50969 Mon Sep 17 00:00:00 2001 From: sk Date: Sat, 22 Apr 2023 22:33:20 +0200 Subject: [PATCH] fix auto hide fab in profile fragment --- .../android/fragments/ProfileFragment.java | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 1a684af23..ed4adfd6b 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -110,7 +110,7 @@ import me.grishka.appkit.utils.CubicBezierInterpolator; import me.grishka.appkit.utils.V; import me.grishka.appkit.views.UsableRecyclerView; -public class ProfileFragment extends LoaderFragment implements OnBackPressedListener, ScrollableToTop{ +public class ProfileFragment extends LoaderFragment implements OnBackPressedListener, ScrollableToTop, HasFab{ private static final int AVATAR_RESULT=722; private static final int COVER_RESULT=343; @@ -150,7 +150,6 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList private WindowInsets childInsets; private PhotoViewer currentPhotoViewer; private boolean editModeLoading; - protected int scrollDiff = 0; private static final int MAX_FIELDS=4; @@ -789,35 +788,6 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList if(currentPhotoViewer!=null){ currentPhotoViewer.offsetView(0, oldScrollY-scrollY); } - - if (GlobalUserPreferences.autoHideFab) { - int dy = scrollY - oldScrollY; - if (dy > 0 && fab.getVisibility() == View.VISIBLE) { - TranslateAnimation animate = new TranslateAnimation( - 0, - 0, - 0, - fab.getHeight() * 2); - animate.setDuration(300); - fab.startAnimation(animate); - fab.setVisibility(View.INVISIBLE); - scrollDiff = 0; - } else if (dy < 0 && fab.getVisibility() != View.VISIBLE) { - if (v.getScrollY() == 0 || scrollDiff > 400) { - fab.setVisibility(View.VISIBLE); - TranslateAnimation animate = new TranslateAnimation( - 0, - 0, - fab.getHeight() * 2, - 0); - animate.setDuration(300); - fab.startAnimation(animate); - scrollDiff = 0; - } else { - scrollDiff += Math.abs(dy); - } - } - } } private Fragment getFragmentForPage(int page){