Initial commit
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
package com.chad.library.adapter.base.loadmore;
|
||||
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class LoadMoreView {
|
||||
public static final int STATUS_DEFAULT = 1;
|
||||
public static final int STATUS_END = 4;
|
||||
public static final int STATUS_FAIL = 3;
|
||||
public static final int STATUS_LOADING = 2;
|
||||
private int mLoadMoreStatus = 1;
|
||||
private boolean mLoadMoreEndGone = false;
|
||||
|
||||
private void visibleLoadEnd(BaseViewHolder baseViewHolder, boolean z) {
|
||||
int loadEndViewId = getLoadEndViewId();
|
||||
if (loadEndViewId != 0) {
|
||||
baseViewHolder.setGone(loadEndViewId, z);
|
||||
}
|
||||
}
|
||||
|
||||
private void visibleLoadFail(BaseViewHolder baseViewHolder, boolean z) {
|
||||
baseViewHolder.setGone(getLoadFailViewId(), z);
|
||||
}
|
||||
|
||||
private void visibleLoading(BaseViewHolder baseViewHolder, boolean z) {
|
||||
baseViewHolder.setGone(getLoadingViewId(), z);
|
||||
}
|
||||
|
||||
public void convert(BaseViewHolder baseViewHolder) {
|
||||
int i = this.mLoadMoreStatus;
|
||||
if (i == 1) {
|
||||
visibleLoading(baseViewHolder, false);
|
||||
visibleLoadFail(baseViewHolder, false);
|
||||
visibleLoadEnd(baseViewHolder, false);
|
||||
return;
|
||||
}
|
||||
if (i == 2) {
|
||||
visibleLoading(baseViewHolder, true);
|
||||
visibleLoadFail(baseViewHolder, false);
|
||||
visibleLoadEnd(baseViewHolder, false);
|
||||
} else if (i == 3) {
|
||||
visibleLoading(baseViewHolder, false);
|
||||
visibleLoadFail(baseViewHolder, true);
|
||||
visibleLoadEnd(baseViewHolder, false);
|
||||
} else {
|
||||
if (i != 4) {
|
||||
return;
|
||||
}
|
||||
visibleLoading(baseViewHolder, false);
|
||||
visibleLoadFail(baseViewHolder, false);
|
||||
visibleLoadEnd(baseViewHolder, true);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract int getLayoutId();
|
||||
|
||||
protected abstract int getLoadEndViewId();
|
||||
|
||||
protected abstract int getLoadFailViewId();
|
||||
|
||||
public int getLoadMoreStatus() {
|
||||
return this.mLoadMoreStatus;
|
||||
}
|
||||
|
||||
protected abstract int getLoadingViewId();
|
||||
|
||||
@Deprecated
|
||||
public boolean isLoadEndGone() {
|
||||
return this.mLoadMoreEndGone;
|
||||
}
|
||||
|
||||
public final boolean isLoadEndMoreGone() {
|
||||
if (getLoadEndViewId() == 0) {
|
||||
return true;
|
||||
}
|
||||
return this.mLoadMoreEndGone;
|
||||
}
|
||||
|
||||
public final void setLoadMoreEndGone(boolean z) {
|
||||
this.mLoadMoreEndGone = z;
|
||||
}
|
||||
|
||||
public void setLoadMoreStatus(int i) {
|
||||
this.mLoadMoreStatus = i;
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.chad.library.adapter.base.loadmore;
|
||||
|
||||
import com.chad.library.R$id;
|
||||
import com.chad.library.R$layout;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class SimpleLoadMoreView extends LoadMoreView {
|
||||
@Override // com.chad.library.adapter.base.loadmore.LoadMoreView
|
||||
public int getLayoutId() {
|
||||
return R$layout.brvah_quick_view_load_more;
|
||||
}
|
||||
|
||||
@Override // com.chad.library.adapter.base.loadmore.LoadMoreView
|
||||
protected int getLoadEndViewId() {
|
||||
return R$id.load_more_load_end_view;
|
||||
}
|
||||
|
||||
@Override // com.chad.library.adapter.base.loadmore.LoadMoreView
|
||||
protected int getLoadFailViewId() {
|
||||
return R$id.load_more_load_fail_view;
|
||||
}
|
||||
|
||||
@Override // com.chad.library.adapter.base.loadmore.LoadMoreView
|
||||
protected int getLoadingViewId() {
|
||||
return R$id.load_more_loading_view;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user