pull/783/head
gedoor 4 years ago
parent 3f767d3a28
commit 692ad361a8
  1. 7
      app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt

@ -154,8 +154,8 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
else -> { else -> {
App.db.replaceRuleDao.liveDataSearch("%$searchKey%") App.db.replaceRuleDao.liveDataSearch("%$searchKey%")
} }
} }.apply {
replaceRuleLiveData?.observe(this, { observe(this@ReplaceRuleActivity, {
if (dataInit) { if (dataInit) {
setResult(Activity.RESULT_OK) setResult(Activity.RESULT_OK)
} }
@ -163,6 +163,7 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
dataInit = true dataInit = true
}) })
} }
}
private fun observeGroupData() { private fun observeGroupData() {
App.db.replaceRuleDao.liveGroup().observe(this, { App.db.replaceRuleDao.liveGroup().observe(this, {
@ -239,7 +240,7 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
} }
override fun onQueryTextChange(newText: String?): Boolean { override fun onQueryTextChange(newText: String?): Boolean {
observeReplaceRuleData("%$newText%") observeReplaceRuleData(newText)
return false return false
} }

Loading…
Cancel
Save