diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2022-11-05 13:52:14 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2022-11-05 13:52:14 +0000 |
commit | 0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a (patch) | |
tree | 691c9f83e830da6e46aa376b173db7643d6a7ae2 /app/src/main/java/ml | |
parent | cf3595f22dd35e0bd15d1344c11408f73f64c144 (diff) | |
download | infinity-for-reddit-0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a.tar infinity-for-reddit-0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a.tar.gz infinity-for-reddit-0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a.tar.bz2 infinity-for-reddit-0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a.tar.lz infinity-for-reddit-0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a.tar.xz infinity-for-reddit-0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a.tar.zst infinity-for-reddit-0ae9b74729b0ee072bb92dbcfbe3391edabe1c5a.zip |
Minor changes to loading more posts.
Diffstat (limited to 'app/src/main/java/ml')
2 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java index 034d1e26..78eef4e4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java @@ -373,7 +373,7 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { @Override public void onPageSelected(int position) { - if (posts != null && position > posts.size() - 2) { + if (posts != null && position > posts.size() - 5) { fetchMorePosts(); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MorePostsInfoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MorePostsInfoFragment.java index 430be57d..c5ec1266 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MorePostsInfoFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/MorePostsInfoFragment.java @@ -50,14 +50,20 @@ public class MorePostsInfoFragment extends Fragment { public void setStatus(@LoadingMorePostsStatus int status) { this.status = status; switch (status) { + case LoadingMorePostsStatus.NOT_LOADING: + binding.progressBarViewMorePostsInfoFragment.setVisibility(View.GONE); + break; case LoadingMorePostsStatus.LOADING: binding.infoTextViewMorePostsInfoFragment.setText(R.string.loading); + binding.progressBarViewMorePostsInfoFragment.setVisibility(View.VISIBLE); break; case LoadingMorePostsStatus.FAILED: binding.infoTextViewMorePostsInfoFragment.setText(R.string.load_more_posts_failed); + binding.progressBarViewMorePostsInfoFragment.setVisibility(View.GONE); break; case LoadingMorePostsStatus.NO_MORE_POSTS: binding.infoTextViewMorePostsInfoFragment.setText(R.string.no_more_posts); + binding.progressBarViewMorePostsInfoFragment.setVisibility(View.GONE); } } |