Disable ViewPager2's swiping if swipe between posts is disabled.

This commit is contained in:
Alex Ning
2021-05-31 00:00:34 +08:00
parent 0f33ef627e
commit c4276736ae
2 changed files with 8 additions and 6 deletions

View File

@@ -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) {