diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-12-17 14:49:39 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-12-17 14:49:39 +0000 |
commit | ee02d63345e479b2726185b1168015740b9a5a5a (patch) | |
tree | dc5bbd4cd0dfb4f672d2528df8ac72aa3a25632c /app | |
parent | 0d56a8120699812f385798918322a235ef70dbf8 (diff) | |
download | infinity-for-reddit-ee02d63345e479b2726185b1168015740b9a5a5a.tar infinity-for-reddit-ee02d63345e479b2726185b1168015740b9a5a5a.tar.gz infinity-for-reddit-ee02d63345e479b2726185b1168015740b9a5a5a.tar.bz2 infinity-for-reddit-ee02d63345e479b2726185b1168015740b9a5a5a.tar.lz infinity-for-reddit-ee02d63345e479b2726185b1168015740b9a5a5a.tar.xz infinity-for-reddit-ee02d63345e479b2726185b1168015740b9a5a5a.tar.zst infinity-for-reddit-ee02d63345e479b2726185b1168015740b9a5a5a.zip |
Fixed FilteredThingActivity for multireddits.
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java index b2c59ca9..901d5d69 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/FilteredThingActivity.java @@ -233,6 +233,21 @@ public class FilteredThingActivity extends BaseActivity implements SortTypeSelec subredditSortTypeBottomSheetFragment.setArguments(bottomSheetBundle); } break; + case PostDataSource.TYPE_MULTI_REDDIT: + String multiRedditName; + if (name.endsWith("/")) { + multiRedditName = name.substring(0, name.length() - 1); + multiRedditName = multiRedditName.substring(multiRedditName.lastIndexOf("/") + 1); + } else { + multiRedditName = name.substring(name.lastIndexOf("/") + 1); + } + getSupportActionBar().setTitle(multiRedditName); + + subredditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment(); + Bundle bottomSheetBundle = new Bundle(); + bottomSheetBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true); + subredditSortTypeBottomSheetFragment.setArguments(bottomSheetBundle); + break; case PostDataSource.TYPE_USER: String usernamePrefixed = "u/" + name; getSupportActionBar().setTitle(usernamePrefixed); @@ -273,7 +288,7 @@ public class FilteredThingActivity extends BaseActivity implements SortTypeSelec if (postType == PostDataSource.TYPE_USER) { bundle.putString(PostFragment.EXTRA_USER_NAME, name); bundle.putString(PostFragment.EXTRA_USER_WHERE, userWhere); - } else if (postType == PostDataSource.TYPE_SUBREDDIT) { + } else if (postType == PostDataSource.TYPE_SUBREDDIT || postType == PostDataSource.TYPE_MULTI_REDDIT) { bundle.putString(PostFragment.EXTRA_NAME, name); } else if (postType == PostDataSource.TYPE_SEARCH) { bundle.putString(PostFragment.EXTRA_NAME, name); |