pull/5/head v2.0.2
fengyuecanzhu 4 years ago
parent 0f5f1bba46
commit c5e78ed129
  1. 2
      .idea/misc.xml
  2. 9
      app/src/main/assets/updatelog.fy
  3. 10
      app/src/main/java/xyz/fycz/myreader/entity/ReadStyle.java
  4. 8
      app/src/main/java/xyz/fycz/myreader/entity/Setting.java
  5. 3
      app/src/main/java/xyz/fycz/myreader/model/SearchEngine.java
  6. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/MainActivity.java
  7. 55
      app/src/main/java/xyz/fycz/myreader/ui/activity/MoreSettingActivity.java
  8. 3
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  9. 28
      app/src/main/java/xyz/fycz/myreader/ui/fragment/MineFragment.java
  10. 23
      app/src/main/java/xyz/fycz/myreader/ui/fragment/WebDavFragment.java
  11. 6
      app/src/main/java/xyz/fycz/myreader/widget/page/PageLoader.java
  12. 25
      app/src/main/res/layout/activity_more_setting.xml
  13. 1
      app/src/main/res/values/strings.xml
  14. 4
      app/version_code.properties

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

@ -1,7 +1,14 @@
2021.05.29
风月读书v2.0.2
更新内容:
1、阅读设置新增适配英文排版开关(默认关闭)
2、修复书籍未加入书架时阅读界面无法换源的bug
3、优化恢复
2021.05.17
风月读书v2.0.1
更新内容:
1、修复第三方书源阅读界面换源后无法加载目录的bug
1、修复第三方书源阅读界面换源后无法加载目录的bug(如果还是无法加载建议到书籍详情页或直接搜索后换源)
2、优化阅读界面换源
2021.05.16

@ -72,6 +72,8 @@ public class ReadStyle implements Serializable {
private int blueFilterPercent;//蓝光过滤比率
private boolean enType;//英文排版
@Override
public Object clone() {
try {
@ -315,4 +317,12 @@ public class ReadStyle implements Serializable {
public void setBlueFilterPercent(int blueFilterPercent) {
this.blueFilterPercent = blueFilterPercent;
}
public boolean isEnType() {
return enType;
}
public void setEnType(boolean enType) {
this.enType = enType;
}
}

@ -180,6 +180,7 @@ public class Setting implements Serializable {
readStyle.setBgPath("");
readStyle.setBlueFilterPercent(30);
readStyle.setProtectEye(false);
readStyle.setEnType(false);
readStyle.setComposition(1);
readStyles.add(readStyle);
@ -708,4 +709,11 @@ public class Setting implements Serializable {
public void setLightNovelParagraph(boolean lightNovelParagraph) {
this.lightNovelParagraph = lightNovelParagraph;
}
public boolean isEnType() {
return getCurReadStyle().isEnType();
}
public void setEnType(boolean enType) {
getCurReadStyle().setEnType(enType);
}
}

@ -21,6 +21,7 @@ import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.webapi.BookApi;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;
import xyz.fycz.myreader.webapi.crawler.source.ThirdCrawler;
import java.util.ArrayList;
import java.util.List;
@ -267,7 +268,7 @@ public class SearchEngine {
public Observable<ConMVMap<SearchBookBean, Book>> getBookInfo(ConMVMap<SearchBookBean, Book> bookMap, ReadCrawler rc) {
return Observable.create(emitter -> {
if (isRead && rc instanceof BookInfoCrawler) {
if (isRead && rc instanceof ThirdCrawler) {
List<Book> books = bookMap.values();
for (Book book : books) {
BookApi.getBookInfo(book, (BookInfoCrawler) rc).subscribe();

@ -46,6 +46,7 @@ import xyz.fycz.myreader.ui.fragment.MineFragment;
import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper;
import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.AdUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt;
import static androidx.fragment.app.FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT;
@ -220,6 +221,7 @@ public class MainActivity extends BaseActivity {
ToastUtils.showError(e.getLocalizedMessage());
e.printStackTrace();
}
AdUtils.adRecord("Usage", "usTimes");
}
private void reLoadFragment() {

@ -67,6 +67,7 @@ public class MoreSettingActivity extends BaseActivity {
private boolean alwaysNext;
private boolean noMenuTitle;
private boolean readAloudVolumeTurnPage;
private boolean enType;
private ArrayList<Book> mBooks;
int booksCount;
@ -110,6 +111,7 @@ public class MoreSettingActivity extends BaseActivity {
isLongPress = mSetting.isCanSelectText();
noMenuTitle = mSetting.isNoMenuChTitle();
readAloudVolumeTurnPage = mSetting.isReadAloudVolumeTurnPage();
enType = mSetting.isEnType();
threadNum = SharedPreUtils.getInstance().getInt(getString(R.string.threadNum), 8);
isWebDav = getIntent().getBooleanExtra(APPCONST.WEB_DAV, false);
}
@ -193,6 +195,7 @@ public class MoreSettingActivity extends BaseActivity {
binding.scShowStatus.setChecked(isShowStatusBar);
binding.scLongPress.setChecked(isLongPress);
binding.scNoMenuTitle.setChecked(noMenuTitle);
binding.scAdaptEnType.setChecked(enType);
binding.scReadAloudVolumeTurnPage.setChecked(readAloudVolumeTurnPage);
}
@ -215,11 +218,7 @@ public class MoreSettingActivity extends BaseActivity {
binding.rlVolume.setOnClickListener(
(v) -> {
if (isVolumeTurnPage) {
isVolumeTurnPage = false;
} else {
isVolumeTurnPage = true;
}
isVolumeTurnPage = !isVolumeTurnPage;
binding.scVolume.setChecked(isVolumeTurnPage);
mSetting.setVolumeTurnPage(isVolumeTurnPage);
SysManager.saveSetting(mSetting);
@ -227,11 +226,7 @@ public class MoreSettingActivity extends BaseActivity {
);
binding.rlAlwaysNext.setOnClickListener(
(v) -> {
if (alwaysNext) {
alwaysNext = false;
} else {
alwaysNext = true;
}
alwaysNext = !alwaysNext;
binding.scAlwaysNext.setChecked(alwaysNext);
mSetting.setAlwaysNext(alwaysNext);
SysManager.saveSetting(mSetting);
@ -240,11 +235,7 @@ public class MoreSettingActivity extends BaseActivity {
binding.rlShowStatus.setOnClickListener(
(v) -> {
needRefresh = true;
if (isShowStatusBar) {
isShowStatusBar = false;
} else {
isShowStatusBar = true;
}
isShowStatusBar = !isShowStatusBar;
binding.scShowStatus.setChecked(isShowStatusBar);
mSetting.setShowStatusBar(isShowStatusBar);
SysManager.saveSetting(mSetting);
@ -253,11 +244,7 @@ public class MoreSettingActivity extends BaseActivity {
binding.rlLongPress.setOnClickListener(
(v) -> {
needRefresh = false;
if (isLongPress) {
isLongPress = false;
} else {
isLongPress = true;
}
isLongPress = !isLongPress;
binding.scLongPress.setChecked(isLongPress);
mSetting.setCanSelectText(isLongPress);
SysManager.saveSetting(mSetting);
@ -266,11 +253,7 @@ public class MoreSettingActivity extends BaseActivity {
binding.rlContentReplace.setOnClickListener(v -> startActivity(new Intent(this, ReplaceRuleActivity.class)));
binding.rlReadAloudVolumeTurnPage.setOnClickListener(
(v) -> {
if (readAloudVolumeTurnPage) {
readAloudVolumeTurnPage = false;
} else {
readAloudVolumeTurnPage = true;
}
readAloudVolumeTurnPage = !readAloudVolumeTurnPage;
binding.scReadAloudVolumeTurnPage.setChecked(readAloudVolumeTurnPage);
mSetting.setReadAloudVolumeTurnPage(readAloudVolumeTurnPage);
SysManager.saveSetting(mSetting);
@ -279,17 +262,23 @@ public class MoreSettingActivity extends BaseActivity {
binding.rlNoMenuTitle.setOnClickListener(
(v) -> {
upMenu = true;
if (noMenuTitle) {
noMenuTitle = false;
} else {
noMenuTitle = true;
}
noMenuTitle = !noMenuTitle;
binding.scNoMenuTitle.setChecked(noMenuTitle);
mSetting.setNoMenuChTitle(noMenuTitle);
SysManager.saveSetting(mSetting);
}
);
binding.rlAdaptEnType.setOnClickListener(
(v) -> {
needRefresh = true;
enType = !enType;
binding.scAdaptEnType.setChecked(enType);
mSetting.setEnType(enType);
SysManager.saveSetting(mSetting);
}
);
binding.llBookSort.setOnClickListener(v -> {
MyAlertDialog.build(this)
.setTitle(getString(R.string.book_sort))
@ -320,11 +309,7 @@ public class MoreSettingActivity extends BaseActivity {
binding.rlAutoRefresh.setOnClickListener(
(v) -> {
if (autoRefresh) {
autoRefresh = false;
} else {
autoRefresh = true;
}
autoRefresh = !autoRefresh;
binding.scAutoRefresh.setChecked(autoRefresh);
mSetting.setRefreshWhenStart(autoRefresh);
SysManager.saveSetting(mSetting);

@ -493,7 +493,8 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
if (!isCollected) {
intent.putExtra("isCollected", false);
}
finish();
//finish();
exit();
startActivity(intent);
});

@ -14,6 +14,8 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import org.jetbrains.annotations.NotNull;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -42,6 +44,7 @@ import xyz.fycz.myreader.ui.activity.AdSettingActivity;
import xyz.fycz.myreader.ui.activity.BookSourceActivity;
import xyz.fycz.myreader.ui.activity.DonateActivity;
import xyz.fycz.myreader.ui.activity.FeedbackActivity;
import xyz.fycz.myreader.ui.activity.MainActivity;
import xyz.fycz.myreader.ui.activity.MoreSettingActivity;
import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
@ -167,7 +170,22 @@ public class MineFragment extends BaseFragment {
.subscribe(new MySingleObserver<ArrayList<String>>() {
@Override
public void onSuccess(ArrayList<String> strings) {
if (!WebDavHelp.INSTANCE.showRestoreDialog(getContext(), strings, BackupRestoreUi.INSTANCE)) {
if (!WebDavHelp.INSTANCE.showRestoreDialog(getContext(), strings, new Restore.CallBack() {
@Override
public void restoreSuccess() {
SysManager.regetmSetting();
ToastUtils.showSuccess("成功将书架从网络同步至本地!");
if (getActivity() != null) {
getActivity().finish();
}
startActivity(new Intent(getContext(), MainActivity.class));
}
@Override
public void restoreError(@NotNull String msg) {
ToastUtils.showError(msg);
}
})) {
ToastUtils.showWarring("WebDav服务端没有备份或WebDav配置错误");
}
}
@ -353,6 +371,10 @@ public class MineFragment extends BaseFragment {
// "恢复成功!\n注意:本功能属于实验功能,书架恢复后,书籍初次加载时可能加载失败,返回重新加载即可!");
SysManager.regetmSetting();
ToastUtils.showSuccess("书架恢复成功!");
if (getActivity() != null) {
getActivity().finish();
}
startActivity(new Intent(getContext(), MainActivity.class));
}
@Override
@ -441,6 +463,10 @@ public class MineFragment extends BaseFragment {
// "恢复成功!\n注意:本功能属于实验功能,书架恢复后,书籍初次加载时可能加载失败,返回重新加载即可!");、
SysManager.regetmSetting();
ToastUtils.showSuccess("成功将书架从网络同步至本地!");
if (getActivity() != null) {
getActivity().finish();
}
startActivity(new Intent(getContext(), MainActivity.class));
} else {
DialogCreator.createTipDialog(getContext(), "未找到同步文件,同步失败!");
}

@ -1,5 +1,6 @@
package xyz.fycz.myreader.ui.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.view.LayoutInflater;
@ -7,6 +8,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.NumberPicker;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import io.reactivex.Single;
@ -14,12 +17,15 @@ import io.reactivex.SingleOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.SysManager;
import xyz.fycz.myreader.base.BaseFragment;
import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.FragmentWebdavSettingBinding;
import xyz.fycz.myreader.model.storage.BackupRestoreUi;
import xyz.fycz.myreader.model.storage.Restore;
import xyz.fycz.myreader.model.storage.WebDavHelp;
import xyz.fycz.myreader.ui.activity.MainActivity;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper;
@ -113,7 +119,22 @@ public class WebDavFragment extends BaseFragment {
.subscribe(new MySingleObserver<ArrayList<String>>() {
@Override
public void onSuccess(ArrayList<String> strings) {
if (!WebDavHelp.INSTANCE.showRestoreDialog(getContext(), strings, BackupRestoreUi.INSTANCE)) {
if (!WebDavHelp.INSTANCE.showRestoreDialog(getContext(), strings, new Restore.CallBack() {
@Override
public void restoreSuccess() {
SysManager.regetmSetting();
ToastUtils.showSuccess("成功将书架从网络同步至本地!");
if (getActivity() != null) {
getActivity().finish();
}
startActivity(new Intent(getContext(), MainActivity.class));
}
@Override
public void restoreError(@NotNull String msg) {
ToastUtils.showError(msg);
}
})) {
ToastUtils.showWarring("WebDav服务端没有备份或WebDav配置错误");
}
}

@ -1673,7 +1673,11 @@ public abstract class PageLoader {
}
// 重置段落
if (!showTitle) {
paragraph = StringUtils.trim(paragraph.replace("\t", ""));
if (mSettingManager.isEnType()) {
paragraph = StringUtils.trim(paragraph.replace("\t", ""));
} else {
paragraph = paragraph.replaceAll("\\s", "");
}
// 如果只有换行符,那么就不执行
if (paragraph.equals("")) continue;
paragraph = indent + paragraph + "\n";

@ -270,7 +270,32 @@
android:clickable="false"
android:longClickable="false" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_adapt_en_type"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/selector_common_bg"
android:gravity="center"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/adapt_en_type"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/sc_adapt_en_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:clickable="false"
android:longClickable="false" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="25dp"

@ -488,6 +488,7 @@
<string name="check_host_cookie">正在打开首页,成功自动返回主界面</string>
<string name="clear_cookie">清除Cookie</string>
<string name="book_source">编辑书源</string>
<string name="adapt_en_type">适配英文排版</string>
<string-array name="reset_screen_time">

@ -1,2 +1,2 @@
#Mon May 17 11:39:21 CST 2021
VERSION_CODE=200
#Sat May 29 12:39:33 CST 2021
VERSION_CODE=202

Loading…
Cancel
Save