Fix useless refresh on welcome home screen (#7268)

If the user hasn't subscribed to any podcasts a welcome segment is
shown on the homescreen. However, the scrollview with a refresh below
was still there which was not only useless but could trigger an refresh
at the wrong position and also tint the app bar.
This commit is contained in:
flofriday 2024-06-30 11:18:44 +02:00 committed by GitHub
parent 52117f35ac
commit e51b0a3695
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -184,6 +184,10 @@ public class HomeFragment extends Fragment implements Toolbar.OnMenuItemClickLis
.subscribe(numEpisodes -> { .subscribe(numEpisodes -> {
viewBinding.welcomeContainer.setVisibility(numEpisodes == 0 ? View.VISIBLE : View.GONE); viewBinding.welcomeContainer.setVisibility(numEpisodes == 0 ? View.VISIBLE : View.GONE);
viewBinding.homeContainer.setVisibility(numEpisodes == 0 ? View.GONE : View.VISIBLE); viewBinding.homeContainer.setVisibility(numEpisodes == 0 ? View.GONE : View.VISIBLE);
viewBinding.swipeRefresh.setVisibility(numEpisodes == 0 ? View.GONE : View.VISIBLE);
if (numEpisodes == 0) {
viewBinding.homeScrollView.setScrollY(0);
}
}, error -> Log.e(TAG, Log.getStackTraceString(error))); }, error -> Log.e(TAG, Log.getStackTraceString(error)));
} }