fix(home-double-tab): scroll up for new posts

Fixes an issue, where tapping the home tab would cycle instead of showing new posts
This commit is contained in:
FineFindus 2023-03-23 16:03:15 +01:00
parent b6d969bc7b
commit bc10a9fcf5
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package org.joinmastodon.android.fragments; package org.joinmastodon.android.fragments;
import static org.joinmastodon.android.GlobalUserPreferences.reduceMotion; import static org.joinmastodon.android.GlobalUserPreferences.reduceMotion;
import static org.joinmastodon.android.GlobalUserPreferences.showNewPostsButton;
import android.animation.Animator; import android.animation.Animator;
import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorListenerAdapter;
@ -477,7 +478,8 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
@Override @Override
public void scrollToTop(){ 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; int nextPage = (pager.getCurrentItem() + 1) % count;
navigateTo(nextPage); navigateTo(nextPage);
return; return;