diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-02-17 15:15:38 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-02-17 15:15:38 +0000 |
commit | 719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33 (patch) | |
tree | 7b9b8b94a2df26365425abcfa8f4687a81e6dabc | |
parent | 52d6691ae7ea7d9d5a19bede87b913f33e0645a3 (diff) | |
download | infinity-for-reddit-719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33.tar infinity-for-reddit-719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33.tar.gz infinity-for-reddit-719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33.tar.bz2 infinity-for-reddit-719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33.tar.lz infinity-for-reddit-719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33.tar.xz infinity-for-reddit-719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33.tar.zst infinity-for-reddit-719a5a3a8e3f3ee4eca4f33f8e709f8eaf65ad33.zip |
Add Gallery Layout to default post layout option.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java | 26 | ||||
-rw-r--r-- | app/src/main/res/values/arrays.xml | 2 |
2 files changed, 13 insertions, 15 deletions
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 4cbd3254..6ea507df 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -1730,6 +1730,14 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView void delayTransition(); } + private void openViewPostDetailActivity(Post post, int position) { + Intent intent = new Intent(mActivity, ViewPostDetailActivity.class); + intent.putExtra(ViewPostDetailActivity.EXTRA_POST_DATA, post); + intent.putExtra(ViewPostDetailActivity.EXTRA_POST_LIST_POSITION, position); + intent.putExtra(ViewPostDetailActivity.EXTRA_POST_FRAGMENT_ID, mFragment.getPostFragmentId()); + mActivity.startActivity(intent); + } + public class PostBaseViewHolder extends RecyclerView.ViewHolder { MaterialCardView cardView; AspectRatioGifImageView iconGifImageView; @@ -1864,11 +1872,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView markPostRead(post, true); canStartActivity = false; - Intent intent = new Intent(mActivity, ViewPostDetailActivity.class); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_DATA, post); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_LIST_POSITION, getBindingAdapterPosition()); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_FRAGMENT_ID, mFragment.getPostFragmentId()); - mActivity.startActivity(intent); + openViewPostDetailActivity(post, getBindingAdapterPosition()); } } }); @@ -2881,11 +2885,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView markPostRead(post, true); canStartActivity = false; - Intent intent = new Intent(mActivity, ViewPostDetailActivity.class); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_DATA, post); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_LIST_POSITION, getBindingAdapterPosition()); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_FRAGMENT_ID, mFragment.getPostFragmentId()); - mActivity.startActivity(intent); + openViewPostDetailActivity(post, getBindingAdapterPosition()); } }); @@ -3476,11 +3476,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView markPostRead(post, true); canStartActivity = false; - Intent intent = new Intent(mActivity, ViewPostDetailActivity.class); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_DATA, post); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_LIST_POSITION, getBindingAdapterPosition()); - intent.putExtra(ViewPostDetailActivity.EXTRA_POST_FRAGMENT_ID, mFragment.getPostFragmentId()); - mActivity.startActivity(intent); + openViewPostDetailActivity(post, getBindingAdapterPosition()); } } }); diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 7bcabff4..1c210973 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -44,11 +44,13 @@ <string-array name="settings_default_post_layout"> <item>Card Layout</item> <item>Compact Layout</item> + <item>Gallery Layout</item> </string-array> <string-array name="settings_default_post_layout_values"> <item>0</item> <item>1</item> + <item>2</item> </string-array> <string-array name="settings_video_autoplay"> |