修复bug、优化体验

pull/5/head
fengyuecanzhu 4 years ago
parent 6d770fa296
commit 103469ea19
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 18
      app/release/output-metadata.json
  3. 9
      app/src/main/assets/updatelog.fy
  4. 3
      app/src/main/java/xyz/fycz/myreader/application/App.java
  5. 38
      app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java
  6. 1
      app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
  7. 1
      app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java
  8. 16
      app/src/main/res/layout/activity_ad_setting.xml
  9. 36
      app/src/main/res/layout/activity_splash.xml
  10. 1
      app/src/main/res/values/strings.xml
  11. 4
      app/version_code.properties

@ -1,18 +0,0 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "xyz.fycz.myreader",
"variantName": "processReleaseResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 194,
"versionName": "1.9.4",
"outputFile": "风月读书v1.9.4.apk"
}
]
}

@ -1,3 +1,12 @@
2021.05.09
风月读书v1.9.5
更新内容:
1、优化开屏广告体验
2、开屏右下角无广告新增跳过按钮,防止点击跳过时误触广告,广告加载时间过久也可直接跳过
3、修复概率性启动闪退bug
4、修复书源:九桃小说
5、新增备用更新通道
2021.04.25
风月读书v1.9.4
更新内容:

@ -310,12 +310,15 @@ public class App extends Application {
String html = OkHttpUtils.getHtml(url);
Document doc = Jsoup.parse(html);
String content = doc.getElementsByClass("ql-editor").text();
if (StringHelper.isEmpty(content)) {
content = OkHttpUtils.getUpdateInfo();
if (StringHelper.isEmpty(content)) {
if (isManualCheck || NetworkUtils.isNetWorkAvailable()) {
ToastUtils.showError("检查更新失败!");
}
return;
}
}
String[] contents = content.split(";");
int newestVersion = 0;
String updateContent = "";

@ -59,11 +59,12 @@ public class SplashActivity extends BaseActivity {
private int adTimes;
private PermissionsChecker mPermissionsChecker;
private Thread myThread = new Thread() {//创建子线程
//创建子线程
private Thread start = new Thread() {
@Override
public void run() {
try {
sleep(WAIT_INTERVAL);//使程序休眠
Thread.sleep(WAIT_INTERVAL);//使程序休眠
Intent it = new Intent(SplashActivity.this, MainActivity.class);//启动MainActivity
it.putExtra("startFromSplash", true);
startActivity(it);
@ -77,21 +78,20 @@ public class SplashActivity extends BaseActivity {
private Thread countTime = new Thread() {
@Override
public void run() {
for (int i = 0; i < 8; i++) {
for (int i = 0; i < 5; i++) {
int time = 5 - i;
App.runOnUiThread(() -> binding.tvSkip.setText(getString(R.string.skip_ad, time)));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
if (!App.isDestroy(SplashActivity.this)){
WAIT_INTERVAL = 0;
startNormal();
}
}
};
@Override
protected void bindView() {
binding = ActivitySplashBinding.inflate(getLayoutInflater());
@ -138,6 +138,14 @@ public class SplashActivity extends BaseActivity {
}
}
@Override
protected void initClick() {
binding.tvSkip.setOnClickListener(v -> {
WAIT_INTERVAL = 0;
startNormal();
});
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
@ -184,18 +192,26 @@ public class SplashActivity extends BaseActivity {
}
private void startNormal() {
if (!App.isDestroy(this)) {
if (BookGroupService.getInstance().curGroupIsPrivate()) {
App.runOnUiThread(() -> {
MyAlertDialog.showPrivateVerifyDia(SplashActivity.this, needGoTo -> {
myThread.start();
if (!start.isAlive()) {
start.start();
}
}, () -> {
SharedPreUtils.getInstance().putString(SplashActivity.this.getString(R.string.curBookGroupId), "");
SharedPreUtils.getInstance().putString(SplashActivity.this.getString(R.string.curBookGroupName), "");
myThread.start();
if (!start.isAlive()) {
start.start();
}
});
});
} else {
myThread.start();
if (!start.isAlive()) {
start.start();
}
}
}
}
@ -222,7 +238,6 @@ public class SplashActivity extends BaseActivity {
@Override
public void error(String msg) {
WAIT_INTERVAL = 1500;
if (!App.isDestroy(SplashActivity.this))
startNormal();
Log.e(TAG, msg);
//ToastUtils.showError(msg);
@ -232,15 +247,14 @@ public class SplashActivity extends BaseActivity {
@Override
public void finishCountdown() {
Log.d(TAG, "倒计时结束或用户主动点击跳过按钮");
WAIT_INTERVAL = 0;
AdUtils.adRecord("splash", "adFinishCount");
if (!App.isDestroy(SplashActivity.this))
startNormal();
}
});
} catch (Exception e) {
e.printStackTrace();
WAIT_INTERVAL = 1500;
if (!App.isDestroy(SplashActivity.this))
startNormal();
}
}

@ -153,6 +153,7 @@ public class MyAlertDialog {
onCancel.cancel();
}
});
if (!App.isDestroy(activity))
fd.show(activity.getSupportFragmentManager(), "fingerprint");
} else {
showPrivatePwdInputDia(activity, onVerify, onCancel);

@ -2,6 +2,7 @@ package xyz.fycz.myreader.util.utils;
import android.util.Log;
import com.weaction.ddsdk.base.DdSdkHelper;
import org.json.JSONArray;

@ -129,6 +129,22 @@
android:clickable="false"
android:longClickable="false" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:text="@string/book_detail_ad"
android:textColor="@color/textPrimary" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout

@ -1,49 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_splash"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:visibility="gone"
app:srcCompat="@drawable/start" />
<LinearLayout
android:id="@+id/ll_ad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="8">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:srcCompat="@mipmap/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:layout_marginStart="5dp"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@color/textPrimary"
android:textSize="@dimen/text_medium_size"
android:text="@string/app_name"/>
android:textSize="@dimen/text_medium_size" />
</LinearLayout>
<TextView
android:id="@+id/tv_skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="15dp"
android:background="@drawable/setting_btn_bg"
android:gravity="center"
android:paddingVertical="5dp"
android:paddingHorizontal="8dp"
android:text="跳过"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
</RelativeLayout>
</LinearLayout>

@ -477,6 +477,7 @@
<string name="book_name">书名</string>
<string name="select_local_pic">选择本地图片</string>
<string name="menu_edit">编辑书籍</string>
<string name="skip_ad">跳过 | %ds</string>
<string-array name="reset_screen_time">
<item>跟随系统</item>

@ -1,2 +1,2 @@
#Mon May 03 14:54:05 CST 2021
VERSION_CODE=194
#Sun May 09 12:34:16 CST 2021
VERSION_CODE=195

Loading…
Cancel
Save