aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-08-02 07:26:14 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-08-02 07:26:14 +0000
commit305ae1c13cafa495bfa6695f973557761abd6d61 (patch)
tree863dbb0a6e77cbf374449721c75c23466c269b11 /app/src/main/java/ml
parenta3b4c54ec2255cea03e930201cda9a0a37ef5c08 (diff)
downloadinfinity-for-reddit-305ae1c13cafa495bfa6695f973557761abd6d61.tar
infinity-for-reddit-305ae1c13cafa495bfa6695f973557761abd6d61.tar.gz
infinity-for-reddit-305ae1c13cafa495bfa6695f973557761abd6d61.tar.bz2
infinity-for-reddit-305ae1c13cafa495bfa6695f973557761abd6d61.tar.lz
infinity-for-reddit-305ae1c13cafa495bfa6695f973557761abd6d61.tar.xz
infinity-for-reddit-305ae1c13cafa495bfa6695f973557761abd6d61.tar.zst
infinity-for-reddit-305ae1c13cafa495bfa6695f973557761abd6d61.zip
New options: separate post and comments in post details page.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java8
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java2
2 files changed, 10 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
index 42c688f4..1a97ab9f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
@@ -265,6 +265,14 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
if (getResources().getBoolean(R.bool.isTablet) || getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
mCommentsRecyclerView = rootView.findViewById(R.id.comments_recycler_view_view_post_detail_fragment);
}
+ if (!((mPostDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.SEPARATE_POST_AND_COMMENTS_IN_LANDSCAPE_MODE, true)
+ && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
+ || (mPostDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.SEPARATE_POST_AND_COMMENTS_IN_PORTRAIT_MODE, false)))) {
+ if (mCommentsRecyclerView != null) {
+ mCommentsRecyclerView.setVisibility(View.GONE);
+ mCommentsRecyclerView = null;
+ }
+ }
if (activity != null && activity.isImmersiveInterface()) {
mRecyclerView.setPadding(0, 0, 0, activity.getNavBarHeight() + mRecyclerView.getPaddingBottom());
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 c1fe0797..69b5917b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
@@ -320,6 +320,8 @@ public class SharedPreferencesUtils {
public static final String HIDE_SUBSCRIBED_SUBREDDITS_SECTIONS = "hide_subscribed_subreddits_sections";
public static final String POST_DETAILS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.post_details";
+ public static final String SEPARATE_POST_AND_COMMENTS_IN_PORTRAIT_MODE = "separate_post_and_comments_in_portrait_mode";
+ public static final String SEPARATE_POST_AND_COMMENTS_IN_LANDSCAPE_MODE = "separate_post_and_comments_in_landscape_mode";
//Legacy Settings
public static final String MAIN_PAGE_TAB_1_TITLE_LEGACY = "main_page_tab_1_title";