From c2a0788a8e4d07dee2a78cd67a3c8613a18a09cb Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Tue, 19 Jan 2021 18:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=95=BF=E6=8C=89=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E3=80=81=E5=86=85=E5=AE=B9=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- app/src/main/assets/updatelog.fy | 3 +++ .../java/xyz/fycz/myreader/ui/activity/RuleActivity.java | 8 +++++--- .../xyz/fycz/myreader/ui/adapter/ReplaceRuleAdapter.java | 6 +++--- .../myreader/ui/adapter/holder/ReplaceRuleHolder.java | 2 +- app/version_code.properties | 4 ++-- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fca6b17..cb35a38 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 风月读书,一款开源、无广告的小说阅读软件。 -成品下载(v1.7.9):[https://fycz.lanzous.com/iu2FYkkvjyj](https://fycz.lanzous.com/iu2FYkkvjyj) +成品下载(v1.8.0):[https://fycz.lanzous.com/i4pMekkx9zc](https://fycz.lanzous.com/i4pMekkx9zc) #### 一、关于书源 diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index 1966ae5..a9c2233 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,4 +1,7 @@ 2021.01.19 +风月读书v1.8.0 +1、修复内容替换规则部分无法删除的bug + 风月读书v1.7.9 1、新增阅读长按选择文字 2、新增选择文字悬浮菜单(拷贝、替换、发声、搜索、分享) diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/RuleActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/RuleActivity.java index e080b14..da1bebc 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/RuleActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/RuleActivity.java @@ -96,10 +96,12 @@ public class RuleActivity extends BaseActivity { } protected void initRuleList() { - mAdapter = new ReplaceRuleAdapter(this, (which, data) -> { - mReplaceRules.remove(data); + mAdapter = new ReplaceRuleAdapter(this, which -> { + mReplaceRules.remove(which); + mAdapter.removeItem(which); mAdapter.notifyItemRemoved(which); - mAdapter.removeItem2(data); + if(which != mReplaceRules.size()) + mAdapter.notifyItemRangeChanged(which, mReplaceRules.size() - which); setUpBarTitle(); }); rvRuleList.setLayoutManager(new LinearLayoutManager(this)); diff --git a/app/src/main/java/xyz/fycz/myreader/ui/adapter/ReplaceRuleAdapter.java b/app/src/main/java/xyz/fycz/myreader/ui/adapter/ReplaceRuleAdapter.java index 6527f85..186d9a2 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/adapter/ReplaceRuleAdapter.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/ReplaceRuleAdapter.java @@ -27,11 +27,11 @@ public class ReplaceRuleAdapter extends BaseListAdapter { return new ReplaceRuleHolder(activity, onDeleteListener); } - public void removeItem2(ReplaceRuleBean ruleBean){ - mList.remove(ruleBean); + public void removeItem(int pos){ + mList.remove(pos); } public interface OnDeleteListener{ - void success(int which, ReplaceRuleBean ruleBean); + void success(int which); } } 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 1d58a50..d87acc8 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 @@ -112,7 +112,7 @@ public class ReplaceRuleHolder extends ViewHolderImpl { .subscribe(new MyObserver() { @Override public void onNext(Boolean aBoolean) { - onDeleteListener.success(pos, data); + onDeleteListener.success(pos); refreshUI(); } diff --git a/app/version_code.properties b/app/version_code.properties index 0f5a96f..18be550 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Tue Jan 19 18:24:22 CST 2021 -VERSION_CODE=179 +#Tue Jan 19 18:54:31 CST 2021 +VERSION_CODE=180