From 012ba88f14bdabe4e37713cd581fdaf95bc6cab0 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 7 Sep 2016 03:12:16 +0200 Subject: [PATCH 1/3] Expose stillLoading in order to change its state from outside. --- .../main/java/miguelbcr/ok_adapters/recycler_view/Pager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java index 97c57ef..97595bc 100644 --- a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java +++ b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java @@ -78,6 +78,10 @@ private void showItems(Call call, final boolean reset) { }); } + public void setStillLoading(boolean stillLoading) { + this.stillLoading = stillLoading; + } + private void nextPage(T item) { if (allLoaded) { adapter.removeMoreListener(); From d9e6cc93e24f1a751e9d85df886ef90212227d7e Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 7 Sep 2016 03:22:06 +0200 Subject: [PATCH 2/3] Expose stillLoading from Adapter in order to change its state from outside. --- .../ok_adapters/recycler_view/OkRecyclerViewAdapter.java | 4 ++++ .../main/java/miguelbcr/ok_adapters/recycler_view/Pager.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java index efe9473..00b4415 100644 --- a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java +++ b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java @@ -137,6 +137,10 @@ public void resetPager(Pager.Call call) { if (pager != null) pager.reset(call); } + void setStillLoadingPager(boolean stillLoading) { + this.pager.setStillLoading(stillLoading); + } + public interface LastItemListener { void lastItemReached(); } diff --git a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java index 97595bc..34b1e79 100644 --- a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java +++ b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/Pager.java @@ -78,7 +78,7 @@ private void showItems(Call call, final boolean reset) { }); } - public void setStillLoading(boolean stillLoading) { + void setStillLoading(boolean stillLoading) { this.stillLoading = stillLoading; } From 70c4f38fc8452698eeb4550221dc41b7b4a2835f Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 7 Sep 2016 03:26:18 +0200 Subject: [PATCH 3/3] Change visibility modifier to public still loading pager --- .../ok_adapters/recycler_view/OkRecyclerViewAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java index 00b4415..1db5280 100644 --- a/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java +++ b/ok_adapters/src/main/java/miguelbcr/ok_adapters/recycler_view/OkRecyclerViewAdapter.java @@ -137,7 +137,7 @@ public void resetPager(Pager.Call call) { if (pager != null) pager.reset(call); } - void setStillLoadingPager(boolean stillLoading) { + public void setStillLoadingPager(boolean stillLoading) { this.pager.setStillLoading(stillLoading); }