Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
NoEndToLF committed Dec 18, 2017
1 parent 8a8d777 commit ee9c5e7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Step 1. Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency

dependencies {
compile 'com.github.NoEndToLF:Gif-Load-ReTry-Refresh:1.0.8'
compile 'com.github.NoEndToLF:Gif-Load-ReTry-Refresh:1.0.9'
}
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.wxystatic.gifloadretry","split":"","minSdkVersion":"15"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.wxystatic.gifloadretryrefresh","split":"","minSdkVersion":"16"}}]
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,29 @@ public void onSubscribe(Disposable d) {

@Override
public void onNext(Integer value) {
Toast.makeText(activity, "加载成功", Toast.LENGTH_SHORT).show();
if (!activity.isFinishing()){
Toast.makeText(activity, "加载成功", Toast.LENGTH_SHORT).show();
tvName.setText(getResources().getString(R.string.large_text));
LoadReTryRefreshManager.getInstance().onLoadSuccess(TestFailedFragment.this, new ShowRefreshViewListener() {
@Override
public void colseRefreshView() {
refreshLayout.setRefreshing(false);
}
});
}
}

@Override
public void onError(Throwable e) {
Toast.makeText(activity, "加载失败", Toast.LENGTH_SHORT).show();
if (!activity.isFinishing()){
Toast.makeText(activity, "加载失败", Toast.LENGTH_SHORT).show();
LoadReTryRefreshManager.getInstance().onLoadFailed(TestFailedFragment.this, e.getMessage(), new ShowRefreshViewListener() {
@Override
public void colseRefreshView() {
refreshLayout.setRefreshing(false);
}
});
}
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions loadretrylibrary/src/main/res/layout/loadretry_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:visibility="invisible"
android:textSize="14sp"
android:textSize="14.5sp"
android:id="@+id/loadretry_tv_error"
android:layout_marginTop="13dp"
android:layout_marginLeft="10dp"
Expand All @@ -36,9 +36,9 @@
android:gravity="center"
app:corner_radius="5dp"
android:visibility="invisible"
android:textSize="14sp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:textSize="14.5sp"
android:paddingLeft="18dp"
android:paddingRight="18dp"
android:paddingBottom="6dp"
android:paddingTop="5dp"
android:maxLines="1"
Expand Down

0 comments on commit ee9c5e7

Please sign in to comment.