mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-29 19:14:44 +01:00
Fix changing post layout not working in HistoryActivity.
This commit is contained in:
parent
a8d8e08323
commit
55af125dfe
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user