From 95a9215ec8159c01bada1d07bb7b647372016b80 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 12 Nov 2020 12:07:35 +0800 Subject: Disable swipe action when there are more than 1 column in PostFragment. --- .../ml/docilealligator/infinityforreddit/Fragment/PostFragment.java | 2 +- app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/swipe_action_preferences.xml | 5 +++++ app/src/main/res/xml/theme_preferences.xml | 5 ++--- 4 files changed, 9 insertions(+), 4 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java index c0b00a18..482ebb21 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/PostFragment.java @@ -785,7 +785,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } }); - if (mSharedPreferences.getBoolean(SharedPreferencesUtils.ENABLE_SWIPE_ACTION, false)) { + if (nColumns == 1 && mSharedPreferences.getBoolean(SharedPreferencesUtils.ENABLE_SWIPE_ACTION, false)) { touchHelper.attachToRecyclerView(mPostRecyclerView); } mPostRecyclerView.setAdapter(mAdapter); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 02dfa6f9..ecc9b8a5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -506,6 +506,7 @@ Disable Image Preview in Data Saving Mode Swipe Left Swipe Right + Not applicable to post feed with more than 1 column. Cannot get the link diff --git a/app/src/main/res/xml/swipe_action_preferences.xml b/app/src/main/res/xml/swipe_action_preferences.xml index c15330b6..efdbed67 100644 --- a/app/src/main/res/xml/swipe_action_preferences.xml +++ b/app/src/main/res/xml/swipe_action_preferences.xml @@ -1,6 +1,11 @@ + + - + -- cgit v1.2.3