From 70709596872612306dc9f32e20135182c087b7b2 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sat, 20 Feb 2021 21:44:50 +0800 Subject: New option: Click to show media in gallery layout. --- .../adapters/PostRecyclerViewAdapter.java | 59 ++++++++++++++++++++-- .../utils/SharedPreferencesUtils.java | 1 + 2 files changed, 56 insertions(+), 4 deletions(-) (limited to 'app/src/main/java/ml/docilealligator') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 6ea507df..b1e0bea1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -95,7 +95,6 @@ import ml.docilealligator.infinityforreddit.events.PostUpdateEventToDetailActivi import ml.docilealligator.infinityforreddit.fragments.PostFragment; import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.post.PostDataSource; -import ml.docilealligator.infinityforreddit.user.UserDao; import ml.docilealligator.infinityforreddit.utils.APIUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.Utils; @@ -133,6 +132,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter { + itemView.performClick(); + }); } void markPostRead(Post post, boolean changePostItemColor) { 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 26c64308..d19f905d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -161,6 +161,7 @@ public class SharedPreferencesUtils { public static final String SUBREDDIT_DEFAULT_SORT_TIME = "subreddit_default_sort_time"; public static final String USER_DEFAULT_SORT_TYPE = "user_default_sort_type"; public static final String USER_DEFAULT_SORT_TIME = "user_default_sort_time"; + public static final String CLICK_TO_SHOW_MEDIA_IN_GALLERY_LAYOUT = "click_to_show_media_in_gallery_layout"; public static final String MAIN_PAGE_TABS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.main_page_tabs"; public static final String MAIN_PAGE_TAB_COUNT = "_main_page_tab_count"; -- cgit v1.2.3