Skip to content

Commit

Permalink
Find Location: Fix for missing loading spinner (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Jun 27, 2022
1 parent 3c87f1f commit faf0e0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions assets/changelog-alpha.txt
@@ -1,5 +1,6 @@
/Alpha 317 (2022-06-27)
Ability to hide subreddit header (thanks to Cameron Merkel)
Find Location: Fix for missing loading spinner

/Alpha 316 (2022-06-27)
Renamed "Find Subreddit" to "Find Location"
Expand Down
Expand Up @@ -157,11 +157,6 @@ private void updateList() {

Log.i(TAG, "Updating list");

if(!mLoadingItem.isHidden()) {
mLoadingItem.setHidden(true);
mRecyclerViewAdapter.updateHiddenStatus();
}

if(mSubscriptionsErrorItem.get().isPresent()) {

mRecyclerViewAdapter.removeAllFromGroup(GROUP_SUBREDDITS);
Expand Down Expand Up @@ -190,6 +185,9 @@ private void updateList() {
requestSubscriptions();
}

mLoadingItem.setHidden(false);
mRecyclerViewAdapter.updateHiddenStatus();

} else {

final HashSet<String> shownSubreddits = new HashSet<>(256);
Expand Down Expand Up @@ -249,13 +247,20 @@ private void updateList() {
mSubredditItemCache.get(subreddit));
}
}

mLoadingItem.setHidden(false);
mRecyclerViewAdapter.updateHiddenStatus();

} else if(!currentQuery.trim().isEmpty()) {

if(mQueryErrorItem.get().isPresent()) {
mRecyclerViewAdapter.appendToGroup(
GROUP_SUBREDDITS,
mQueryErrorItem.get().get());

mLoadingItem.setHidden(true);
mRecyclerViewAdapter.updateHiddenStatus();

} else {
mLoadingItem.setHidden(false);
mRecyclerViewAdapter.updateHiddenStatus();
Expand All @@ -264,9 +269,6 @@ private void updateList() {

mRecyclerViewAdapter.notifyDataSetChanged();
mSubredditItemCache.nextGeneration();

mLoadingItem.setHidden(true);
mRecyclerViewAdapter.updateHiddenStatus();
}
}

Expand Down Expand Up @@ -333,7 +335,6 @@ public boolean isHidden() {

final RedditAccount user
= RedditAccountManager.getInstance(this).getDefaultAccount();

final RedditSubredditSubscriptionManager subscriptionManager
= RedditSubredditSubscriptionManager.getSingleton(this, user);

Expand Down

0 comments on commit faf0e0f

Please sign in to comment.