diff --git a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt index 2957d9953..0348ef71a 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt @@ -1,6 +1,8 @@ package io.legado.app.ui.replacerule import android.os.Bundle +import android.view.Menu +import android.view.MenuItem import androidx.core.content.ContextCompat import androidx.lifecycle.LiveData import androidx.lifecycle.Observer @@ -34,6 +36,18 @@ class ReplaceRuleActivity : VMBaseActivity(R.layout.activi initSwipeToDelete() } + override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.replace_rule, menu) + return super.onCompatCreateOptionsMenu(menu) + } + + override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + + } + return super.onCompatOptionsItemSelected(item) + } + private fun initRecyclerView() { ATH.applyEdgeEffectColor(rv_replace_rule) rv_replace_rule.layoutManager = LinearLayoutManager(this) @@ -71,6 +85,7 @@ class ReplaceRuleActivity : VMBaseActivity(R.layout.activi }) } + private fun initDataObservers() { rulesLiveData?.removeObservers(this) rulesLiveData = LivePagedListBuilder(App.db.replaceRuleDao().observeAll(), 30).build()