Skip to content

Commit

Permalink
xxxx
Browse files Browse the repository at this point in the history
  • Loading branch information
hss01248 committed Mar 2, 2021
1 parent e37e9fd commit b0daa1d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
Expand Down
4 changes: 4 additions & 0 deletions pagestate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
public interface IViewState {

void showLoading();
default void showLoading(int progress){
showLoading();
}
void showError(CharSequence msg);
void showContent();
void showEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public void showLoading() {
mLoadingAndRetryLayout.showLoading();
}

@Override
public void showLoading(int progress) {
mLoadingAndRetryLayout.showLoading();
}

@Override
public void showError(CharSequence msg) {
mLoadingAndRetryLayout.showError(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private void initView(Context context, AttributeSet attrs, int defStyleAttr) {
}
//xml里的布局是在这个layout初始化完成后才加入的
manager = new PageStateManager(context);

}

@Override
Expand Down Expand Up @@ -89,6 +88,22 @@ public void run() {
}
}

TextView tvLoading;
@Override
public void showLoading(int progress) {
if (isMainThread()) {
showView(mLoadingView, STATUS_LOADING);

} else {
post(new Runnable() {
@Override
public void run() {
showView(mLoadingView,STATUS_LOADING);
}
});
}
}

/**
* 会找到第一个textview,设置text. 如果msg为空,则不设置
*
Expand Down

0 comments on commit b0daa1d

Please sign in to comment.