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

@ -154,14 +154,15 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
else -> { else -> {
App.db.replaceRuleDao.liveDataSearch("%$searchKey%") App.db.replaceRuleDao.liveDataSearch("%$searchKey%")
} }
}.apply {
observe(this@ReplaceRuleActivity, {
if (dataInit) {
setResult(Activity.RESULT_OK)
}
adapter.setItems(it, adapter.diffItemCallBack)
dataInit = true
})
} }
replaceRuleLiveData?.observe(this, {
if (dataInit) {
setResult(Activity.RESULT_OK)
}
adapter.setItems(it, adapter.diffItemCallBack)
dataInit = true
})
} }
private fun observeGroupData() { private fun observeGroupData() {
@ -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