From bc10a9fcf5aaa342aed7f6edaa55159028691198 Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Thu, 23 Mar 2023 16:03:15 +0100 Subject: [PATCH] fix(home-double-tab): scroll up for new posts Fixes an issue, where tapping the home tab would cycle instead of showing new posts --- .../org/joinmastodon/android/fragments/HomeTabFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java index 8eccd2c25..368488a98 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java @@ -1,6 +1,7 @@ package org.joinmastodon.android.fragments; import static org.joinmastodon.android.GlobalUserPreferences.reduceMotion; +import static org.joinmastodon.android.GlobalUserPreferences.showNewPostsButton; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -477,7 +478,8 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab @Override public void scrollToTop(){ - if (((ScrollableToTop) fragments[pager.getCurrentItem()]).isScrolledToTop() && !GlobalUserPreferences.disableDoubleTapToSwipe) { + if (((ScrollableToTop) fragments[pager.getCurrentItem()]).isScrolledToTop() && + !GlobalUserPreferences.disableDoubleTapToSwipe && !newPostsBtnShown) { int nextPage = (pager.getCurrentItem() + 1) % count; navigateTo(nextPage); return;