From f4394a705972b0468425fa7ca6ed362158db3566 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 4 Dec 2020 21:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=BA=90=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 4 ++ .../io/legado/app/ui/main/rss/RssFragment.kt | 7 +++- .../ui/rss/subscription/SourceSubscription.kt | 37 +++++++++++++++++++ .../main/res/layout/activity_read_record.xml | 2 +- .../main/res/layout/activity_source_sub.xml | 21 +++++++++++ app/src/main/res/menu/source_subscription.xml | 11 ++++++ app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 10 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/io/legado/app/ui/rss/subscription/SourceSubscription.kt create mode 100644 app/src/main/res/layout/activity_source_sub.xml create mode 100644 app/src/main/res/menu/source_subscription.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3e121884b..d455a6eb4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -171,6 +171,10 @@ + + (R.layout.fragment_rss), binding.recyclerView.adapter = adapter adapter.addHeaderView { ItemRssBinding.inflate(layoutInflater, it, false).apply { - tvName.text = "订阅源" + tvName.setText(R.string.source_subscription) ivIcon.setImageResource(R.mipmap.ic_launcher) + root.onClick { + startActivity() + } } } } diff --git a/app/src/main/java/io/legado/app/ui/rss/subscription/SourceSubscription.kt b/app/src/main/java/io/legado/app/ui/rss/subscription/SourceSubscription.kt new file mode 100644 index 000000000..5506c873f --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/rss/subscription/SourceSubscription.kt @@ -0,0 +1,37 @@ +package io.legado.app.ui.rss.subscription + +import android.os.Bundle +import android.view.Menu +import android.view.MenuItem +import io.legado.app.R +import io.legado.app.base.BaseActivity +import io.legado.app.databinding.ActivitySourceSubBinding + +class SourceSubscription : BaseActivity() { + + override fun getViewBinding(): ActivitySourceSubBinding { + return ActivitySourceSubBinding.inflate(layoutInflater) + } + + override fun onActivityCreated(savedInstanceState: Bundle?) { + + } + + override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.source_subscription, menu) + return super.onCompatCreateOptionsMenu(menu) + } + + override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.menu_add -> editSubscription() + } + return super.onCompatOptionsItemSelected(item) + } + + private fun editSubscription() { + + } + + +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_read_record.xml b/app/src/main/res/layout/activity_read_record.xml index 71f9a4a64..9d94c5c8f 100644 --- a/app/src/main/res/layout/activity_read_record.xml +++ b/app/src/main/res/layout/activity_read_record.xml @@ -1,8 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/source_subscription.xml b/app/src/main/res/menu/source_subscription.xml new file mode 100644 index 000000000..52bf86d0d --- /dev/null +++ b/app/src/main/res/menu/source_subscription.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index daab7109f..74816c0d6 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -787,5 +787,6 @@ 正文标题 显示/隐藏 页眉页脚 + 源订阅 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 24605786e..834cc11b7 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -788,5 +788,6 @@ 正文标题 显示/隐藏 页眉页脚 + 源订阅 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 7f4a3b1a0..c636ffe45 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -791,5 +791,6 @@ 正文标题 显示/隐藏 页眉页脚 + 源订阅 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index aef49bcc5..194fb98b8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -794,5 +794,6 @@ 正文标题 显示/隐藏 footer header + 源订阅