aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-09-02 14:45:10 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-09-02 14:45:10 +0000
commit0107bba62ac3dfdd71301f7511e896ccda58bebb (patch)
tree6402a048d60bf45b1bbe503a8895f831667dee4e /app/src/main/java/ml
parent56d82d133f7d9ecbe98c543d18a2a071ffe27c3e (diff)
downloadinfinity-for-reddit-0107bba62ac3dfdd71301f7511e896ccda58bebb.tar
infinity-for-reddit-0107bba62ac3dfdd71301f7511e896ccda58bebb.tar.gz
infinity-for-reddit-0107bba62ac3dfdd71301f7511e896ccda58bebb.tar.bz2
infinity-for-reddit-0107bba62ac3dfdd71301f7511e896ccda58bebb.tar.lz
infinity-for-reddit-0107bba62ac3dfdd71301f7511e896ccda58bebb.tar.xz
infinity-for-reddit-0107bba62ac3dfdd71301f7511e896ccda58bebb.tar.zst
infinity-for-reddit-0107bba62ac3dfdd71301f7511e896ccda58bebb.zip
Fix showing wrong post feed in the second tab in MainActivity.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
index 55522aa9..a9b9393d 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
@@ -1616,10 +1616,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
int postType = mMainActivityTabsSharedPreferences.getInt((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_1_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME);
String name = mMainActivityTabsSharedPreferences.getString((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_1_NAME, "");
return generatePostFragment(postType, name);
- } else if (position == 1) {
- int postType = mMainActivityTabsSharedPreferences.getInt((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_2_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_POPULAR);
- String name = mMainActivityTabsSharedPreferences.getString((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_2_NAME, "");
- return generatePostFragment(postType, name);
} else {
if (showFavoriteMultiReddits) {
if (position >= tabCount && position - tabCount < favoriteMultiReddits.size()) {
@@ -1656,8 +1652,16 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
return generatePostFragment(postType, name);
}
}
- int postType = mMainActivityTabsSharedPreferences.getInt((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_3_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL);
- String name = mMainActivityTabsSharedPreferences.getString((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_3_NAME, "");
+
+ int postType;
+ String name;
+ if (position == 1) {
+ postType = mMainActivityTabsSharedPreferences.getInt((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_2_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_POPULAR);
+ name = mMainActivityTabsSharedPreferences.getString((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_2_NAME, "");
+ } else {
+ postType = mMainActivityTabsSharedPreferences.getInt((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_3_POST_TYPE, SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_ALL);
+ name = mMainActivityTabsSharedPreferences.getString((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_3_NAME, "");
+ }
return generatePostFragment(postType, name);
}
}