diff --git a/README.md b/README.md index 15a73fc..fca6b17 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 风月读书,一款开源、无广告的小说阅读软件。 -成品下载(v1.7.9):[https://fycz.lanzous.com/icrU3kkqrud](https://fycz.lanzous.com/icrU3kkqrud) +成品下载(v1.7.9):[https://fycz.lanzous.com/iu2FYkkvjyj](https://fycz.lanzous.com/iu2FYkkvjyj) #### 一、关于书源 diff --git a/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/ReplaceRuleHolder.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/ReplaceRuleHolder.java index 53759b6..1d58a50 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/ReplaceRuleHolder.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/ReplaceRuleHolder.java @@ -31,6 +31,7 @@ import xyz.fycz.myreader.model.ReplaceRuleManager; import xyz.fycz.myreader.ui.adapter.ReplaceRuleAdapter; import xyz.fycz.myreader.ui.dialog.ReplaceDialog; import xyz.fycz.myreader.util.ShareUtils; +import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.utils.GsonExtensionsKt; @@ -127,11 +128,19 @@ public class ReplaceRuleHolder extends ViewHolderImpl { private void banOrUse(ReplaceRuleBean data){ if (data.getEnable()) { tvRuleSummary.setTextColor(getContext().getResources().getColor(R.color.textPrimary)); - tvRuleSummary.setText(String.format("%s->%s", data.getRegex(), data.getReplacement())); + if (StringHelper.isEmpty(data.getReplaceSummary())) { + tvRuleSummary.setText(String.format("%s->%s", data.getRegex(), data.getReplacement())); + }else { + tvRuleSummary.setText(data.getReplaceSummary()); + } btBan.setText(getContext().getString(R.string.ban)); } else { tvRuleSummary.setTextColor(getContext().getResources().getColor(R.color.textSecondary)); - tvRuleSummary.setText(String.format("(禁用中)%s->%s", data.getRegex(), data.getReplacement())); + if (StringHelper.isEmpty(data.getReplaceSummary())) { + tvRuleSummary.setText(String.format("(禁用中)%s->%s", data.getRegex(), data.getReplacement())); + }else { + tvRuleSummary.setText(String.format("(禁用中)%s", data.getReplaceSummary())); + } btBan.setText(R.string.enable_use); } } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/dialog/ReplaceDialog.java b/app/src/main/java/xyz/fycz/myreader/ui/dialog/ReplaceDialog.java index bb2937b..492d4f4 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/dialog/ReplaceDialog.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/dialog/ReplaceDialog.java @@ -28,6 +28,7 @@ import xyz.fycz.myreader.greendao.entity.ReplaceRuleBean; import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.model.ReplaceRuleManager; import xyz.fycz.myreader.util.SharedPreUtils; +import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; @@ -88,6 +89,10 @@ public class ReplaceDialog extends DialogFragment { btSelectBook.setOnClickListener(v1 -> selectBook()); tvConfirm.setOnClickListener(v1 -> { + if (StringHelper.isEmpty(etRuleOld.getText().toString())) { + ToastUtils.showWarring("替换规则不能为空"); + return; + } replaceRule.setReplaceSummary(etRuleDesc.getText().toString()); replaceRule.setRegex(etRuleOld.getText().toString()); replaceRule.setIsRegex(cbUseRegex.isChecked()); diff --git a/app/version_code.properties b/app/version_code.properties index 7d82364..0f5a96f 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Tue Jan 19 16:58:48 CST 2021 +#Tue Jan 19 18:24:22 CST 2021 VERSION_CODE=179