From 2dc2d6728b89d35faff01a2af9956d8ffdac9be0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 22:39:30 +0800 Subject: [PATCH 01/10] up --- .../ui/book/source/edit/SourceEditActivity.kt | 144 ++++++++---------- .../rss/source/edit/RssSourceEditActivity.kt | 39 +++++ .../rss/source/edit/RssSourceEditViewModel.kt | 8 +- 3 files changed, 111 insertions(+), 80 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt index c7e6dbbf5..8e3f1c940 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt @@ -79,20 +79,14 @@ class SourceEditActivity : override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.menu_save -> { - val bookSource = getSource() - if (bookSource == null) { - toast("书源名称和URL不能为空") - } else { - viewModel.save(bookSource) { setResult(Activity.RESULT_OK); finish() } + getSource()?.let { + viewModel.save(it) { setResult(Activity.RESULT_OK); finish() } } } R.id.menu_debug_source -> { - val bookSource = getSource() - if (bookSource == null) { - toast("书源名称和URL不能为空") - } else { - viewModel.save(bookSource) { - startActivity(Pair("key", bookSource.bookSourceUrl)) + getSource()?.let { + viewModel.save(it) { + startActivity(Pair("key", it.bookSourceUrl)) } } } @@ -249,84 +243,76 @@ class SourceEditActivity : val bookInfoRule = BookInfoRule() val tocRule = TocRule() val contentRule = ContentRule() - for (entity in sourceEntities) { - with(entity) { - when (key) { - "bookSourceUrl" -> value?.let { source.bookSourceUrl = it } ?: return null - "bookSourceName" -> value?.let { source.bookSourceName = it } ?: return null - "bookSourceGroup" -> source.bookSourceGroup = value - "loginUrl" -> source.loginUrl = value - "bookUrlPattern" -> source.bookUrlPattern = value - "header" -> source.header = value - } + sourceEntities.forEach { + when (it.key) { + "bookSourceUrl" -> source.bookSourceUrl = it.value ?: "" + "bookSourceName" -> source.bookSourceName = it.value ?: "" + "bookSourceGroup" -> source.bookSourceGroup = it.value + "loginUrl" -> source.loginUrl = it.value + "bookUrlPattern" -> source.bookUrlPattern = it.value + "header" -> source.header = it.value } } - for (entity in searchEntities) { - with(entity) { - when (key) { - "searchUrl" -> source.searchUrl = value - "bookList" -> searchRule.bookList = value - "name" -> searchRule.name = value - "author" -> searchRule.author = value - "kind" -> searchRule.kind = value - "intro" -> searchRule.intro = value - "updateTime" -> searchRule.updateTime = value - "wordCount" -> searchRule.wordCount = value - "lastChapter" -> searchRule.lastChapter = value - "coverUrl" -> searchRule.coverUrl = value - "bookUrl" -> searchRule.bookUrl = value - } + if (source.bookSourceUrl.isBlank() || source.bookSourceName.isBlank()) { + toast("书源名称和URL不能为空") + return null + } + searchEntities.forEach { + when (it.key) { + "searchUrl" -> source.searchUrl = it.value + "bookList" -> searchRule.bookList = it.value + "name" -> searchRule.name = it.value + "author" -> searchRule.author = it.value + "kind" -> searchRule.kind = it.value + "intro" -> searchRule.intro = it.value + "updateTime" -> searchRule.updateTime = it.value + "wordCount" -> searchRule.wordCount = it.value + "lastChapter" -> searchRule.lastChapter = it.value + "coverUrl" -> searchRule.coverUrl = it.value + "bookUrl" -> searchRule.bookUrl = it.value } } - for (entity in findEntities) { - with(entity) { - when (key) { - "exploreUrl" -> source.exploreUrl = value - "bookList" -> exploreRule.bookList = value - "name" -> exploreRule.name = value - "author" -> exploreRule.author = value - "kind" -> exploreRule.kind = value - "intro" -> exploreRule.intro = value - "updateTime" -> exploreRule.updateTime = value - "wordCount" -> exploreRule.wordCount = value - "lastChapter" -> exploreRule.lastChapter = value - "coverUrl" -> exploreRule.coverUrl = value - "bookUrl" -> exploreRule.bookUrl = value - } + findEntities.forEach { + when (it.key) { + "exploreUrl" -> source.exploreUrl = it.value + "bookList" -> exploreRule.bookList = it.value + "name" -> exploreRule.name = it.value + "author" -> exploreRule.author = it.value + "kind" -> exploreRule.kind = it.value + "intro" -> exploreRule.intro = it.value + "updateTime" -> exploreRule.updateTime = it.value + "wordCount" -> exploreRule.wordCount = it.value + "lastChapter" -> exploreRule.lastChapter = it.value + "coverUrl" -> exploreRule.coverUrl = it.value + "bookUrl" -> exploreRule.bookUrl = it.value } } - for (entity in infoEntities) { - with(entity) { - when (key) { - "init" -> bookInfoRule.init = value - "name" -> bookInfoRule.name = value - "author" -> bookInfoRule.author = value - "kind" -> bookInfoRule.kind = value - "intro" -> bookInfoRule.intro = value - "updateTime" -> bookInfoRule.updateTime = value - "wordCount" -> bookInfoRule.wordCount = value - "lastChapter" -> bookInfoRule.lastChapter = value - "coverUrl" -> bookInfoRule.coverUrl = value - "tocUrl" -> bookInfoRule.tocUrl = value - } + infoEntities.forEach { + when (it.key) { + "init" -> bookInfoRule.init = it.value + "name" -> bookInfoRule.name = it.value + "author" -> bookInfoRule.author = it.value + "kind" -> bookInfoRule.kind = it.value + "intro" -> bookInfoRule.intro = it.value + "updateTime" -> bookInfoRule.updateTime = it.value + "wordCount" -> bookInfoRule.wordCount = it.value + "lastChapter" -> bookInfoRule.lastChapter = it.value + "coverUrl" -> bookInfoRule.coverUrl = it.value + "tocUrl" -> bookInfoRule.tocUrl = it.value } } - for (entity in tocEntities) { - with(entity) { - when (key) { - "chapterList" -> tocRule.chapterList = value - "chapterName" -> tocRule.chapterName = value - "chapterUrl" -> tocRule.chapterUrl = value - "nextTocUrl" -> tocRule.nextTocUrl = value - } + tocEntities.forEach { + when (it.key) { + "chapterList" -> tocRule.chapterList = it.value + "chapterName" -> tocRule.chapterName = it.value + "chapterUrl" -> tocRule.chapterUrl = it.value + "nextTocUrl" -> tocRule.nextTocUrl = it.value } } - for (entity in contentEntities) { - with(entity) { - when (key) { - "content" -> contentRule.content = value - "nextContentUrl" -> contentRule.nextContentUrl = value - } + contentEntities.forEach { + when (it.key) { + "content" -> contentRule.content = it.value + "nextContentUrl" -> contentRule.nextContentUrl = it.value } } source.ruleSearch = GSON.toJson(searchRule) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index e623420f4..cfee144db 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -1,9 +1,11 @@ package io.legado.app.ui.rss.source.edit +import android.app.Activity import android.graphics.Rect import android.os.Bundle import android.view.Gravity import android.view.Menu +import android.view.MenuItem import android.view.ViewTreeObserver import android.widget.EditText import android.widget.PopupWindow @@ -62,6 +64,20 @@ class RssSourceEditActivity : return super.onCompatCreateOptionsMenu(menu) } + override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.menu_save -> { + getRssSource()?.let { + viewModel.save(it) { + setResult(Activity.RESULT_OK) + finish() + } + } + } + } + return super.onCompatOptionsItemSelected(item) + } + private fun initView() { ATH.applyEdgeEffectColor(recycler_view) mSoftKeyboardTool = KeyboardToolPop(this, AppConst.keyboardToolChars, this) @@ -98,7 +114,30 @@ class RssSourceEditActivity : add(EditEntity("ruleContent", rssSource?.ruleContent, R.string.rss_rule_content)) add(EditEntity("ruleLink", rssSource?.ruleLink, R.string.rss_rule_link)) } + } + private fun getRssSource(): RssSource? { + val source = viewModel.sourceLiveData.value ?: RssSource() + sourceEntities.forEach { + when (it.key) { + "sourceName" -> source.sourceName = it.value ?: "" + "sourceUrl" -> source.sourceName = it.value ?: "" + "iconUrl" -> source.sourceName = it.value ?: "" + "ruleTitle" -> source.sourceName = it.value ?: "" + "ruleAuthor" -> source.sourceName = it.value ?: "" + "ruleGuid" -> source.sourceName = it.value ?: "" + "rulePubDate" -> source.sourceName = it.value ?: "" + "ruleCategories" -> source.sourceName = it.value ?: "" + "ruleDescription" -> source.sourceName = it.value ?: "" + "ruleImage" -> source.sourceName = it.value ?: "" + "ruleContent" -> source.sourceName = it.value ?: "" + "ruleLink" -> source.sourceName = it.value ?: "" + } + } + if (source.sourceName.isBlank() || source.sourceName.isBlank()) { + return null + } + return source } override fun sendText(text: String) { diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt index 53f7d01de..6d089a865 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt @@ -18,5 +18,11 @@ class RssSourceEditViewModel(application: Application) : BaseViewModel(applicati } } - + fun save(rssSource: RssSource, success: (() -> Unit)) { + execute { + App.db.rssSourceDao().insert(rssSource) + }.onSuccess { + success() + } + } } \ No newline at end of file From 54320528ddc6ce9935a68d44ce5d053f07606deb Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 22:44:42 +0800 Subject: [PATCH 02/10] up --- .../rss/source/edit/RssSourceEditActivity.kt | 20 +++++++++++++++++++ .../rss/source/edit/RssSourceEditViewModel.kt | 18 +++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index cfee144db..023aee11c 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -1,6 +1,9 @@ package io.legado.app.ui.rss.source.edit import android.app.Activity +import android.content.ClipData +import android.content.ClipboardManager +import android.content.Context import android.graphics.Rect import android.os.Bundle import android.view.Gravity @@ -17,10 +20,13 @@ import io.legado.app.constant.AppConst import io.legado.app.data.entities.EditEntity import io.legado.app.data.entities.RssSource import io.legado.app.lib.theme.ATH +import io.legado.app.ui.book.source.debug.SourceDebugActivity import io.legado.app.ui.widget.KeyboardToolPop +import io.legado.app.utils.GSON import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_book_source_edit.* import org.jetbrains.anko.displayMetrics +import org.jetbrains.anko.startActivity import kotlin.math.abs class RssSourceEditActivity : @@ -74,6 +80,20 @@ class RssSourceEditActivity : } } } + R.id.menu_debug_source -> { + getRssSource()?.let { + viewModel.save(it) { + startActivity(Pair("key", it.sourceUrl)) + } + } + } + R.id.menu_copy_source -> { + GSON.toJson(getRssSource())?.let { sourceStr -> + val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? + clipboard?.primaryClip = ClipData.newPlainText(null, sourceStr) + } + } + R.id.menu_paste_source -> viewModel.pasteSource() } return super.onCompatOptionsItemSelected(item) } diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt index 6d089a865..b4c0133a8 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditViewModel.kt @@ -1,10 +1,14 @@ package io.legado.app.ui.rss.source.edit import android.app.Application +import android.content.ClipboardManager +import android.content.Context import androidx.lifecycle.MutableLiveData import io.legado.app.App import io.legado.app.base.BaseViewModel import io.legado.app.data.entities.RssSource +import io.legado.app.utils.GSON +import io.legado.app.utils.fromJsonObject class RssSourceEditViewModel(application: Application) : BaseViewModel(application) { @@ -25,4 +29,18 @@ class RssSourceEditViewModel(application: Application) : BaseViewModel(applicati success() } } + + fun pasteSource() { + execute { + val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? + clipboard?.primaryClip?.let { + if (it.itemCount > 0) { + val json = it.getItemAt(0).text.toString() + GSON.fromJsonObject(json)?.let { source -> + sourceLiveData.postValue(source) + } ?: toast("格式不对") + } + } + } + } } \ No newline at end of file From ecd264bac724157dbf178ae15fb9488292db25c0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 22:47:53 +0800 Subject: [PATCH 03/10] up --- app/src/main/AndroidManifest.xml | 1 + .../ui/rss/source/debug/RssSourceDebugActivity.kt | 14 ++++++++++++++ .../ui/rss/source/edit/RssSourceEditActivity.kt | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 96e2b7ea2..928c4d99d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -70,6 +70,7 @@ + diff --git a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt index de8bf27dc..0c55e2270 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt @@ -1,2 +1,16 @@ package io.legado.app.ui.rss.source.debug +import android.os.Bundle +import io.legado.app.R +import io.legado.app.base.BaseActivity + + +class RssSourceDebugActivity : BaseActivity(R.layout.activity_book_source_debug, false) { + + + override fun onActivityCreated(savedInstanceState: Bundle?) { + + } + + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index 023aee11c..9fd580e9c 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -20,7 +20,7 @@ import io.legado.app.constant.AppConst import io.legado.app.data.entities.EditEntity import io.legado.app.data.entities.RssSource import io.legado.app.lib.theme.ATH -import io.legado.app.ui.book.source.debug.SourceDebugActivity +import io.legado.app.ui.rss.source.debug.RssSourceDebugActivity import io.legado.app.ui.widget.KeyboardToolPop import io.legado.app.utils.GSON import io.legado.app.utils.getViewModel @@ -83,7 +83,7 @@ class RssSourceEditActivity : R.id.menu_debug_source -> { getRssSource()?.let { viewModel.save(it) { - startActivity(Pair("key", it.sourceUrl)) + startActivity(Pair("key", it.sourceUrl)) } } } From 3fe9d763c9b864aca507fa6c393604b3f4e9dd12 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 22:49:29 +0800 Subject: [PATCH 04/10] up --- .../io/legado/app/ui/book/source/debug/SourceDebugActivity.kt | 4 ++-- .../legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt | 2 +- ...tivity_book_source_debug.xml => activity_source_debug.xml} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename app/src/main/res/layout/{activity_book_source_debug.xml => activity_source_debug.xml} (100%) diff --git a/app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugActivity.kt index b180f6b17..de2ef20e7 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugActivity.kt @@ -12,13 +12,13 @@ import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor import io.legado.app.ui.qrcode.QrCodeActivity import io.legado.app.utils.getViewModel -import kotlinx.android.synthetic.main.activity_book_source_debug.* +import kotlinx.android.synthetic.main.activity_source_debug.* import kotlinx.android.synthetic.main.view_search.* import kotlinx.coroutines.launch import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.toast -class SourceDebugActivity : VMBaseActivity(R.layout.activity_book_source_debug) { +class SourceDebugActivity : VMBaseActivity(R.layout.activity_source_debug) { override val viewModel: SourceDebugModel get() = getViewModel(SourceDebugModel::class.java) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt index 0c55e2270..3018a1f1e 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt @@ -5,7 +5,7 @@ import io.legado.app.R import io.legado.app.base.BaseActivity -class RssSourceDebugActivity : BaseActivity(R.layout.activity_book_source_debug, false) { +class RssSourceDebugActivity : BaseActivity(R.layout.activity_source_debug, false) { override fun onActivityCreated(savedInstanceState: Bundle?) { diff --git a/app/src/main/res/layout/activity_book_source_debug.xml b/app/src/main/res/layout/activity_source_debug.xml similarity index 100% rename from app/src/main/res/layout/activity_book_source_debug.xml rename to app/src/main/res/layout/activity_source_debug.xml From 9634cfac60fbb6aa463afd941f86d13ce2f15e4d Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 22:58:50 +0800 Subject: [PATCH 05/10] up --- .../io/legado/app/ui/book/source/edit/SourceEditActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt index 8e3f1c940..4eb28dcea 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt @@ -141,7 +141,7 @@ class SourceEditActivity : } //基本信息 sourceEntities.clear() - searchEntities.apply { + sourceEntities.apply { add(EditEntity("bookSourceUrl", bookSource?.bookSourceUrl, R.string.book_source_url)) add(EditEntity("bookSourceName", bookSource?.bookSourceName, R.string.book_source_name)) add( From 0b76f7b967d7cc87e1b5901d8a07e7c689d0a212 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 23:00:55 +0800 Subject: [PATCH 06/10] up --- .../io/legado/app/ui/rss/source/manage/RssSourceActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 047a342d4..f0052917e 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 @@ -43,7 +43,7 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { - R.id.menu_add_book_source -> startActivity() + R.id.menu_add -> startActivity() } return super.onCompatOptionsItemSelected(item) } From b3da0df8a55e61e679a6897efeb3189d54199d1b Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 23:05:22 +0800 Subject: [PATCH 07/10] up --- .../io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index 9fd580e9c..4113261fb 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -36,7 +36,7 @@ class RssSourceEditActivity : private var mSoftKeyboardTool: PopupWindow? = null private var mIsSoftKeyBoardShowing = false - private lateinit var adapter: RssSourceEditAdapter + private val adapter = RssSourceEditAdapter() private val sourceEntities: ArrayList = ArrayList() override val viewModel: RssSourceEditViewModel From 699b715f3d785cf9d2f5b86514a7e5cb68bb56fb Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 23:06:25 +0800 Subject: [PATCH 08/10] up --- .../io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index 4113261fb..79eb9552d 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -134,6 +134,7 @@ class RssSourceEditActivity : add(EditEntity("ruleContent", rssSource?.ruleContent, R.string.rss_rule_content)) add(EditEntity("ruleLink", rssSource?.ruleLink, R.string.rss_rule_link)) } + adapter.editEntities = sourceEntities } private fun getRssSource(): RssSource? { From 54bad44495afc75ff8405c408256ad48dc2b41c3 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 23:11:23 +0800 Subject: [PATCH 09/10] up --- app/src/main/res/layout/activity_rss_source_edit.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/activity_rss_source_edit.xml b/app/src/main/res/layout/activity_rss_source_edit.xml index 5579d3de5..d47a244de 100644 --- a/app/src/main/res/layout/activity_rss_source_edit.xml +++ b/app/src/main/res/layout/activity_rss_source_edit.xml @@ -1,6 +1,7 @@ From 0b3199e204b8178ba9260dcd49e3dc2d3d734c08 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 1 Oct 2019 23:13:48 +0800 Subject: [PATCH 10/10] up --- app/src/main/res/layout/activity_rss_source_edit.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/activity_rss_source_edit.xml b/app/src/main/res/layout/activity_rss_source_edit.xml index d47a244de..dd2545faf 100644 --- a/app/src/main/res/layout/activity_rss_source_edit.xml +++ b/app/src/main/res/layout/activity_rss_source_edit.xml @@ -12,6 +12,7 @@ android:layout_height="wrap_content" app:contentInsetStartWithNavigation="0dp" app:displayHomeAsUp="true" + app:fitStatusBar="false" app:title="@string/rss_source_edit" />