From c4276736aeb8c26c2bd146a88591c350f7263e62 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 31 May 2021 00:00:34 +0800 Subject: Disable ViewPager2's swiping if swipe between posts is disabled. --- .../infinityforreddit/activities/ViewPostDetailActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index cd4e7fdb..80dc5788 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -165,8 +165,11 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele } boolean swipeBetweenPosts = mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_BETWEEN_POSTS, false); - if (!swipeBetweenPosts && mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) { - mSlidrInterface = Slidr.attach(this); + if (!swipeBetweenPosts) { + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) { + mSlidrInterface = Slidr.attach(this); + } + viewPager2.setUserInputEnabled(false); } postFragmentId = getIntent().getLongExtra(EXTRA_POST_FRAGMENT_ID, -1); if (swipeBetweenPosts && posts == null && postFragmentId > 0) { -- cgit v1.2.3