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