diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2022-07-19 02:30:59 +0000 |
---|---|---|
committer | Docile-Alligator <chineseperson5@gmail.com> | 2022-07-19 02:30:59 +0000 |
commit | 55af125dfeb6a187dcd114164bd8690114eb5c84 (patch) | |
tree | d8b117f783065ac5e03146916c4724fca1b370c9 | |
parent | a8d8e08323444c309ae08718c83620009f5d0d7c (diff) | |
download | infinity-for-reddit-55af125dfeb6a187dcd114164bd8690114eb5c84.tar infinity-for-reddit-55af125dfeb6a187dcd114164bd8690114eb5c84.tar.gz infinity-for-reddit-55af125dfeb6a187dcd114164bd8690114eb5c84.tar.bz2 infinity-for-reddit-55af125dfeb6a187dcd114164bd8690114eb5c84.tar.lz infinity-for-reddit-55af125dfeb6a187dcd114164bd8690114eb5c84.tar.xz infinity-for-reddit-55af125dfeb6a187dcd114164bd8690114eb5c84.tar.zst infinity-for-reddit-55af125dfeb6a187dcd114164bd8690114eb5c84.zip |
Fix changing post layout not working in HistoryActivity.
Diffstat (limited to '')
3 files changed, 6 insertions, 6 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/HistoryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/HistoryActivity.java index 19a0849b..020d0396 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/HistoryActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/HistoryActivity.java @@ -242,7 +242,7 @@ public class HistoryActivity extends BaseActivity implements ActivityToolbarInte @Override public void postLayoutSelected(int postLayout) { if (sectionsPagerAdapter != null) { - mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.POST_LAYOUT_USER_POST_BASE + mAccountName, postLayout).apply(); + mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.HISTORY_POST_LAYOUT_READ_POST, postLayout).apply(); sectionsPagerAdapter.changePostLayout(postLayout); } } @@ -311,8 +311,8 @@ public class HistoryActivity extends BaseActivity implements ActivityToolbarInte public void changePostLayout(int postLayout) { Fragment fragment = getCurrentFragment(); - if (fragment instanceof PostFragment) { - ((PostFragment) fragment).changePostLayout(postLayout); + if (fragment instanceof HistoryPostFragment) { + ((HistoryPostFragment) fragment).changePostLayout(postLayout); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java index 89b2531c..e7114c59 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java @@ -336,7 +336,7 @@ public class HistoryPostFragment extends Fragment implements FragmentCommunicato Locale locale = getResources().getConfiguration().locale; if (historyType == HISTORY_TYPE_READ_POSTS) { - postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.HISTORY_POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout); + postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.HISTORY_POST_LAYOUT_READ_POST, defaultPostLayout); mAdapter = new HistoryPostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, mRedgifsRetrofit, mStreamableRetrofit, mCustomThemeWrapper, locale, @@ -813,7 +813,7 @@ public class HistoryPostFragment extends Fragment implements FragmentCommunicato if (!temporary) { switch (postType) { case HistoryPostPagingSource.TYPE_READ_POSTS: - mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.HISTORY_POST_LAYOUT_FRONT_PAGE_POST, postLayout).apply(); + mPostLayoutSharedPreferences.edit().putInt(SharedPreferencesUtils.HISTORY_POST_LAYOUT_READ_POST, postLayout).apply(); } } 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 cadb24cd..3b431a42 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -68,7 +68,7 @@ public class SharedPreferencesUtils { public static final String POST_LAYOUT_MULTI_REDDIT_POST_BASE = "post_layout_multi_reddit_post_"; public static final String POST_LAYOUT_USER_POST_BASE = "post_layout_user_post_"; public static final String POST_LAYOUT_SEARCH_POST = "post_layout_search_post"; - public static final String HISTORY_POST_LAYOUT_FRONT_PAGE_POST = "history_post_layout_read_post"; + public static final String HISTORY_POST_LAYOUT_READ_POST = "history_post_layout_read_post"; public static final int POST_LAYOUT_CARD = 0; public static final int POST_LAYOUT_COMPACT = 1; public static final int POST_LAYOUT_GALLERY = 2; |