|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|