新增长按选择、内容替换

pull/5/head
fengyuecanzhu 4 years ago
parent b1aa2566d7
commit c2a0788a8e
  1. 2
      README.md
  2. 3
      app/src/main/assets/updatelog.fy
  3. 8
      app/src/main/java/xyz/fycz/myreader/ui/activity/RuleActivity.java
  4. 6
      app/src/main/java/xyz/fycz/myreader/ui/adapter/ReplaceRuleAdapter.java
  5. 2
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/ReplaceRuleHolder.java
  6. 4
      app/version_code.properties

@ -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)
#### 一、关于书源 #### 一、关于书源

@ -1,4 +1,7 @@
2021.01.19 2021.01.19
风月读书v1.8.0
1、修复内容替换规则部分无法删除的bug
风月读书v1.7.9 风月读书v1.7.9
1、新增阅读长按选择文字 1、新增阅读长按选择文字
2、新增选择文字悬浮菜单(拷贝、替换、发声、搜索、分享) 2、新增选择文字悬浮菜单(拷贝、替换、发声、搜索、分享)

@ -96,10 +96,12 @@ public class RuleActivity extends BaseActivity {
} }
protected void initRuleList() { protected void initRuleList() {
mAdapter = new ReplaceRuleAdapter(this, (which, data) -> { mAdapter = new ReplaceRuleAdapter(this, which -> {
mReplaceRules.remove(data); mReplaceRules.remove(which);
mAdapter.removeItem(which);
mAdapter.notifyItemRemoved(which); mAdapter.notifyItemRemoved(which);
mAdapter.removeItem2(data); if(which != mReplaceRules.size())
mAdapter.notifyItemRangeChanged(which, mReplaceRules.size() - which);
setUpBarTitle(); setUpBarTitle();
}); });
rvRuleList.setLayoutManager(new LinearLayoutManager(this)); rvRuleList.setLayoutManager(new LinearLayoutManager(this));

@ -27,11 +27,11 @@ public class ReplaceRuleAdapter extends BaseListAdapter<ReplaceRuleBean> {
return new ReplaceRuleHolder(activity, onDeleteListener); return new ReplaceRuleHolder(activity, onDeleteListener);
} }
public void removeItem2(ReplaceRuleBean ruleBean){ public void removeItem(int pos){
mList.remove(ruleBean); mList.remove(pos);
} }
public interface OnDeleteListener{ public interface OnDeleteListener{
void success(int which, ReplaceRuleBean ruleBean); void success(int which);
} }
} }

@ -112,7 +112,7 @@ public class ReplaceRuleHolder extends ViewHolderImpl<ReplaceRuleBean> {
.subscribe(new MyObserver<Boolean>() { .subscribe(new MyObserver<Boolean>() {
@Override @Override
public void onNext(Boolean aBoolean) { public void onNext(Boolean aBoolean) {
onDeleteListener.success(pos, data); onDeleteListener.success(pos);
refreshUI(); refreshUI();
} }

@ -1,2 +1,2 @@
#Tue Jan 19 18:24:22 CST 2021 #Tue Jan 19 18:54:31 CST 2021
VERSION_CODE=179 VERSION_CODE=180

Loading…
Cancel
Save