mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
fixed "use boolean to show reload instead of int"
fixed initial state tests were good
This commit is contained in:
parent
5a6ff97fbc
commit
99bec15d03
@ -37,7 +37,7 @@ public class StateLayout extends NestedScrollView {
|
||||
|
||||
@State int layoutState = HIDDEN;
|
||||
@State String emptyTextValue;
|
||||
@State int adapterSize;
|
||||
@State boolean showReload = true;
|
||||
|
||||
@OnClick(R.id.reload) void onReload() {
|
||||
if (onReloadListener != null && !progressBar.isShown()) {
|
||||
@ -81,9 +81,13 @@ public class StateLayout extends NestedScrollView {
|
||||
}
|
||||
|
||||
public void showReload(int adapterCount) {
|
||||
this.adapterSize = adapterCount;
|
||||
showReload = adapterCount == 0;
|
||||
showReload();
|
||||
}
|
||||
|
||||
protected void showReload() {
|
||||
hideProgress();
|
||||
if (adapterCount == 0) {
|
||||
if (showReload) {
|
||||
layoutState = SHOW_RELOAD_STATE;
|
||||
reload.setVisibility(VISIBLE);
|
||||
emptyText.setVisibility(VISIBLE);
|
||||
@ -157,7 +161,7 @@ public class StateLayout extends NestedScrollView {
|
||||
hideReload();
|
||||
break;
|
||||
case SHOW_RELOAD_STATE:
|
||||
showReload(adapterSize);
|
||||
showReload();
|
||||
break;
|
||||
case HIDDEN:
|
||||
setVisibility(GONE);
|
||||
@ -167,9 +171,8 @@ public class StateLayout extends NestedScrollView {
|
||||
break;
|
||||
case SHOWN:
|
||||
setVisibility(VISIBLE);
|
||||
showReload(adapterSize);
|
||||
showReload();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user