diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-05-30 16:00:34 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-05-30 16:00:34 +0000 |
commit | c4276736aeb8c26c2bd146a88591c350f7263e62 (patch) | |
tree | c42f5425f5ded1d8bfdc026194e16dfc6df77a5b | |
parent | 0f33ef627e0fe18023b6cb5efcccc7f06c2ec423 (diff) | |
download | infinity-for-reddit-c4276736aeb8c26c2bd146a88591c350f7263e62.tar infinity-for-reddit-c4276736aeb8c26c2bd146a88591c350f7263e62.tar.gz infinity-for-reddit-c4276736aeb8c26c2bd146a88591c350f7263e62.tar.bz2 infinity-for-reddit-c4276736aeb8c26c2bd146a88591c350f7263e62.tar.lz infinity-for-reddit-c4276736aeb8c26c2bd146a88591c350f7263e62.tar.xz infinity-for-reddit-c4276736aeb8c26c2bd146a88591c350f7263e62.tar.zst infinity-for-reddit-c4276736aeb8c26c2bd146a88591c350f7263e62.zip |
Disable ViewPager2's swiping if swipe between posts is disabled.
-rw-r--r-- | app/build.gradle | 7 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/app/build.gradle b/app/build.gradle index 7bbdf8e8..a87c72f6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -167,16 +167,15 @@ dependencies { // RecyclerView fast scrolling implementation 'me.zhanghai.android.fastscroll:library:1.1.5' - // Crash screen - implementation 'com.melegy.redscreenofdeath:red-screen-of-death:0.1.2' - implementation 'net.lingala.zip4j:zip4j:2.7.0' implementation 'org.apache.commons:commons-io:1.3.2' implementation "androidx.startup:startup-runtime:1.0.0" implementation 'com.github.FunkyMuse:Crashy:1.1.0' - implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" + //implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" + + implementation 'androidx.palette:palette:1.0.0' /**** Builds and flavors ****/ 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) { |