From 36c7893c29fe7bd5a0ae625dd0c1d57fdc894894 Mon Sep 17 00:00:00 2001 From: Reza Amuzadeh Date: Thu, 15 Nov 2018 12:24:32 +0330 Subject: [PATCH] update code - change GONE state --- library/build.gradle | 4 ++-- .../vasl/recyclerlibrary/MyCustomView.java | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 8d6df54..c82adf0 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 16 targetSdkVersion 28 - versionCode 5 - versionName "1.0.5" + versionCode 6 + versionName "1.0.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/library/src/main/java/com/vasl/recyclerlibrary/MyCustomView.java b/library/src/main/java/com/vasl/recyclerlibrary/MyCustomView.java index b7ba704..0ac97f5 100644 --- a/library/src/main/java/com/vasl/recyclerlibrary/MyCustomView.java +++ b/library/src/main/java/com/vasl/recyclerlibrary/MyCustomView.java @@ -129,7 +129,7 @@ private void showLoading() { } private void hideLoading() { - loadingHolder.setVisibility(GONE); + loadingHolder.setVisibility(INVISIBLE); } private void showEmptyView() { @@ -137,7 +137,7 @@ private void showEmptyView() { } private void hideEmptyView() { - emptyHolder.setVisibility(GONE); + emptyHolder.setVisibility(INVISIBLE); } private void showRecyclerView() { @@ -145,7 +145,7 @@ private void showRecyclerView() { } private void hideRecyclerView() { - recyclerView.setVisibility(GONE); + recyclerView.setVisibility(INVISIBLE); } private void showSwipe() { @@ -161,7 +161,7 @@ private void showError() { } private void hideError() { - errorHolder.setVisibility(GONE); + errorHolder.setVisibility(INVISIBLE); } public void setStatus(ListStatuse status) { @@ -173,6 +173,8 @@ public void setStatus(ListStatuse status) { hideSwipe(); hideError(); + invalidate(); // for redraw + showLoading(); break; case SUCCESS: @@ -182,6 +184,8 @@ public void setStatus(ListStatuse status) { hideSwipe(); hideError(); + invalidate(); // for redraw + showRecyclerView(); break; case FAILURE: @@ -191,6 +195,8 @@ public void setStatus(ListStatuse status) { hideSwipe(); hideError(); + invalidate(); // for redraw + showError(); break; case EMPTY: @@ -200,6 +206,8 @@ public void setStatus(ListStatuse status) { hideSwipe(); hideError(); + invalidate(); // for redraw + showEmptyView(); break; case UNDEFINE: @@ -209,6 +217,8 @@ public void setStatus(ListStatuse status) { hideSwipe(); hideError(); + invalidate(); // for redraw + showError(); break; default: @@ -218,11 +228,12 @@ public void setStatus(ListStatuse status) { hideSwipe(); hideError(); + invalidate(); // for redraw + showError(); break; } - invalidate(); } public void setStatus(ListStatuse status, @Nullable String title) {