From 2ebc797a3b1c903105b00775b74e67b8e7c785a4 Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Sat, 11 Jun 2022 20:21:17 +0800 Subject: Fix post layout not saved for anonymous multireddits. --- .../ml/docilealligator/infinityforreddit/fragments/PostFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java index de518519..1d717a3e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java @@ -787,7 +787,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { sortType = new SortType(SortType.Type.valueOf(sort)); } - postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout); + postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_MULTI_REDDIT_POST_BASE + multiRedditPath, defaultPostLayout); mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale, @@ -1573,6 +1573,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { if (!temporary) { switch (postType) { case PostPagingSource.TYPE_FRONT_PAGE: + case PostPagingSource.TYPE_ANONYMOUS_FRONT_PAGE: mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, postLayout).apply(); break; case PostPagingSource.TYPE_SUBREDDIT: @@ -1585,6 +1586,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_SEARCH_POST, postLayout).apply(); break; case PostPagingSource.TYPE_MULTI_REDDIT: + case PostPagingSource.TYPE_ANONYMOUS_MULTIREDDIT: mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_MULTI_REDDIT_POST_BASE + multiRedditPath, postLayout).apply(); break; } -- cgit v1.2.3