aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java8
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java12
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java2
3 files changed, 9 insertions, 13 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java
index f674d09d..8b3f70a8 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java
@@ -191,12 +191,8 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
isThingSelectionMode = getIntent().getBooleanExtra(EXTRA_THING_SELECTION_MODE, false);
thingSelectionType = getIntent().getIntExtra(EXTRA_THING_SELECTION_TYPE, EXTRA_THING_SELECTION_TYPE_ALL);
- if (isThingSelectionMode) {
- switch (thingSelectionType) {
- case EXTRA_THING_SELECTION_TYPE_SUBREDDIT:
- getSupportActionBar().setTitle(R.string.subreddit_selection_activity_label);
- break;
- }
+ if (isThingSelectionMode && thingSelectionType == EXTRA_THING_SELECTION_TYPE_SUBREDDIT) {
+ getSupportActionBar().setTitle(R.string.subreddit_selection_activity_label);
}
if (isThingSelectionMode && thingSelectionType != EXTRA_THING_SELECTION_TYPE_ALL) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java
index 316dc871..e95a99ea 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MultiRedditListingFragment.java
@@ -146,8 +146,8 @@ public class MultiRedditListingFragment extends Fragment implements FragmentComm
new MultiRedditViewModel.Factory(mRedditDataRoomDatabase, mActivity.accountName))
.get(MultiRedditViewModel.class);
- mMultiRedditViewModel.getAllMultiReddits().observe(getViewLifecycleOwner(), subscribedUserData -> {
- if (subscribedUserData == null || subscribedUserData.size() == 0) {
+ mMultiRedditViewModel.getAllMultiReddits().observe(getViewLifecycleOwner(), multiReddits -> {
+ if (multiReddits == null || multiReddits.size() == 0) {
binding.recyclerViewMultiRedditListingFragment.setVisibility(View.GONE);
binding.fetchMultiRedditListingInfoLinearLayoutMultiRedditListingFragment.setVisibility(View.VISIBLE);
mGlide.load(R.drawable.error_image).into(binding.fetchMultiRedditListingInfoImageViewMultiRedditListingFragment);
@@ -156,16 +156,16 @@ public class MultiRedditListingFragment extends Fragment implements FragmentComm
binding.recyclerViewMultiRedditListingFragment.setVisibility(View.VISIBLE);
mGlide.clear(binding.fetchMultiRedditListingInfoImageViewMultiRedditListingFragment);
}
- adapter.setMultiReddits(subscribedUserData);
+ adapter.setMultiReddits(multiReddits);
});
- mMultiRedditViewModel.getAllFavoriteMultiReddits().observe(getViewLifecycleOwner(), favoriteSubscribedUserData -> {
- if (favoriteSubscribedUserData != null && favoriteSubscribedUserData.size() > 0) {
+ mMultiRedditViewModel.getAllFavoriteMultiReddits().observe(getViewLifecycleOwner(), favoriteMultiReddits -> {
+ if (favoriteMultiReddits != null && favoriteMultiReddits.size() > 0) {
binding.fetchMultiRedditListingInfoLinearLayoutMultiRedditListingFragment.setVisibility(View.GONE);
binding.recyclerViewMultiRedditListingFragment.setVisibility(View.VISIBLE);
mGlide.clear(binding.fetchMultiRedditListingInfoImageViewMultiRedditListingFragment);
}
- adapter.setFavoriteMultiReddits(favoriteSubscribedUserData);
+ adapter.setFavoriteMultiReddits(favoriteMultiReddits);
});
return binding.getRoot();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java
index 72038fba..1611dd99 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/PostPagingSource.java
@@ -118,7 +118,7 @@ public class PostPagingSource extends ListenableFuturePagingSource<String, Post>
this.sharedPreferences = sharedPreferences;
this.postFeedScrolledPositionSharedPreferences = postFeedScrolledPositionSharedPreferences;
if (path.endsWith("/")) {
- multiRedditPath = path.substring(0, multiRedditPath.length() - 1);
+ multiRedditPath = path.substring(0, path.length() - 1);
} else {
multiRedditPath = path;
}