From a33042eda9facc705b959e9802d70e8d5a07ec81 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 20 Sep 2019 10:26:15 +0800 Subject: [PATCH] up --- .../ui/rss/source/manage/RssSourceActivity.kt | 16 ++++++++++++++++ app/src/main/res/menu/rss_source.xml | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 app/src/main/res/menu/rss_source.xml diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index 3b729e01e..e70d8d4e9 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -1,6 +1,8 @@ package io.legado.app.ui.rss.source.manage import android.os.Bundle +import android.view.Menu +import android.view.MenuItem import androidx.appcompat.widget.SearchView import androidx.core.content.ContextCompat import androidx.recyclerview.widget.DividerItemDecoration @@ -15,6 +17,7 @@ import io.legado.app.lib.theme.primaryTextColor import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_rss_source.* import kotlinx.android.synthetic.main.view_search.* +import kotlinx.android.synthetic.main.view_title_bar.* class RssSourceActivity : VMBaseActivity(R.layout.activity_rss_source), @@ -26,10 +29,23 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r private lateinit var adapter: RssSourceAdapter override fun onActivityCreated(savedInstanceState: Bundle?) { + setSupportActionBar(toolbar) initRecyclerView() initSearchView() } + override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.rss_source, menu) + return super.onCompatCreateOptionsMenu(menu) + } + + override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + + } + return super.onCompatOptionsItemSelected(item) + } + private fun initRecyclerView() { ATH.applyEdgeEffectColor(recycler_view) recycler_view.layoutManager = LinearLayoutManager(this) diff --git a/app/src/main/res/menu/rss_source.xml b/app/src/main/res/menu/rss_source.xml new file mode 100644 index 000000000..e73b6af79 --- /dev/null +++ b/app/src/main/res/menu/rss_source.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file