pull/5/head
fengyuecanzhu 4 years ago
parent e5a5f104d9
commit f06a47797e
  1. 56
      app/src/androidTest/java/xyz/fycz/myreader/ExampleInstrumentedTest.java
  2. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  3. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java
  4. 14
      app/src/main/java/xyz/fycz/myreader/webapi/CommonApi.java
  5. 1
      app/src/main/res/layout/activity_splash.xml

File diff suppressed because one or more lines are too long

@ -414,7 +414,7 @@ public class BookDetailedActivity extends BaseActivity {
@Override
public void onError(Throwable e) {
ToastUtils.showError("书籍详情加载失败!");
e.printStackTrace();
if (App.isDebug()) e.printStackTrace();
}
});
@ -475,6 +475,8 @@ public class BookDetailedActivity extends BaseActivity {
@Override
public void onError(Throwable e) {
binding.pbLoading.setVisibility(View.GONE);
ToastUtils.showError("最新章节加载失败!");
if (App.isDebug()) e.printStackTrace();
}
});

@ -78,6 +78,7 @@ public class SplashActivity extends BaseActivity {
private Thread countTime = new Thread() {
@Override
public void run() {
App.runOnUiThread(() -> binding.tvSkip.setVisibility(View.VISIBLE));
for (int i = 0; i < 5; i++) {
int time = 5 - i;
App.runOnUiThread(() -> binding.tvSkip.setText(getString(R.string.skip_ad, time)));
@ -158,6 +159,9 @@ public class SplashActivity extends BaseActivity {
if (adTimes >= 0 && todayAdCount >= adTimes) {
startNoAd();
} else {
App.getHandler().postDelayed(() -> {
binding.tvSkip.setVisibility(View.VISIBLE);
}, 3000);
AdUtils.checkHasAd()
.subscribe(new MySingleObserver<Boolean>() {
@Override

@ -48,12 +48,7 @@ public class CommonApi {
url = NetworkUtils.getAbsoluteURL(rc.getNameSpace(), url);
String finalUrl = url;
return Observable.create(emitter -> {
try {
emitter.onNext(rc.getContentFormHtml(OkHttpUtils.getHtml(finalUrl, charset)));
} catch (Exception e) {
e.printStackTrace();
emitter.onError(e);
}
emitter.onNext(rc.getContentFormHtml(OkHttpUtils.getHtml(finalUrl, charset)));
emitter.onComplete();
});
}
@ -131,12 +126,7 @@ public class CommonApi {
url = NetworkUtils.getAbsoluteURL(bic.getNameSpace(), url);
String finalUrl = url;
return Observable.create(emitter -> {
try {
emitter.onNext(bic.getBookInfo(OkHttpUtils.getHtml(finalUrl, bic.getCharset()), book));
} catch (Exception e) {
e.printStackTrace();
emitter.onError(e);
}
emitter.onNext(bic.getBookInfo(OkHttpUtils.getHtml(finalUrl, bic.getCharset()), book));
emitter.onComplete();
});
}

@ -63,6 +63,7 @@
android:paddingVertical="5dp"
android:paddingHorizontal="8dp"
android:text="跳过"
android:visibility="gone"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />

Loading…
Cancel
Save