aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java11
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java1
2 files changed, 7 insertions, 5 deletions
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 9cd7c229..078d782f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java
@@ -30,6 +30,7 @@ import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.livefront.bridge.Bridge;
+import com.r0adkll.slidr.Slidr;
import com.r0adkll.slidr.model.SlidrInterface;
import org.greenrobot.eventbus.EventBus;
@@ -127,10 +128,6 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele
applyCustomTheme();
- /*if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_RIGHT_TO_GO_BACK, true)) {
- mSlidrInterface = Slidr.attach(this);
- }*/
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Window window = getWindow();
@@ -157,8 +154,12 @@ 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);
+ }
postFragmentId = getIntent().getLongExtra(EXTRA_POST_FRAGMENT_ID, -1);
- if (posts == null && postFragmentId > 0) {
+ if (swipeBetweenPosts && posts == null && postFragmentId > 0) {
EventBus.getDefault().post(new NeedForPostListFromPostFragmentEvent(postFragmentId));
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
index 6d219e31..335256cd 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
@@ -173,6 +173,7 @@ public class SharedPreferencesUtils {
public static final String RESTORE_SETTINGS = "restore_settings";
public static final String SHOW_SUICIDE_PREVENTION_ACTIVITY = "show_suicide_prevention_activity";
public static final String LOVE_ANIMATION = "love_animation";
+ public static final String SWIPE_BETWEEN_POSTS = "swipe_between_posts";
public static final String DEFAULT_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit_preferences";
public static final String MAIN_PAGE_TABS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.main_page_tabs";