From 941d8954b97fae5e1fe3d545bf8ae3bc7cf99103 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 1 Sep 2019 10:36:52 +0800 Subject: [PATCH] up --- .../app/ui/replacerule/ReplaceRuleActivity.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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()