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

Loading…
Cancel
Save