From 6db5f271372de34d62a0870c520b119acb30a42c Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 20 Nov 2019 23:04:39 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/model/Debug.kt | 6 +++--- app/src/main/java/io/legado/app/ui/about/DonateActivity.kt | 4 ++-- .../app/ui/book/source/edit/BookSourceEditActivity.kt | 4 ++-- app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt | 2 +- .../legado/app/ui/rss/source/edit/RssSourceEditActivity.kt | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/Debug.kt b/app/src/main/java/io/legado/app/model/Debug.kt index 0643a2a35..5351b19e4 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -54,16 +54,16 @@ object Debug { cancelDebug() debugSource = rssSource.sourceUrl log(debugSource, "︾开始解析RSS") - Rss.getArticles(rssSource, 1) + Rss.getArticles(rssSource, null) .onSuccess { if (it == null) { log(debugSource, "︽解析失败", state = -1) } else { val ruleContent = rssSource.ruleContent - if (it.isNotEmpty() && it[0].description.isNullOrEmpty() && !ruleContent.isNullOrEmpty()) { + if (it.articles.isNotEmpty() && it.articles[0].description.isNullOrEmpty() && !ruleContent.isNullOrEmpty()) { log(debugSource, "︽解析完成") log(debugSource, showTime = false) - rssContentDebug(it[0], ruleContent) + rssContentDebug(it.articles[0], ruleContent) } else { log(debugSource, "︽解析完成", state = 1000) } diff --git a/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt b/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt index 5134e1ec2..b5f6c7a8d 100644 --- a/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt +++ b/app/src/main/java/io/legado/app/ui/about/DonateActivity.kt @@ -32,7 +32,7 @@ class DonateActivity : BaseActivity(R.layout.activity_donate) { val clipboard = this.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager val clipData = ClipData.newPlainText(null, "开源阅读软件") clipboard?.let { - clipboard.primaryClip = clipData + clipboard.setPrimaryClip(clipData) toast(R.string.copy_complete) } } @@ -47,7 +47,7 @@ class DonateActivity : BaseActivity(R.layout.activity_donate) { val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager val clipData = ClipData.newPlainText(null, "537954522") clipboard?.let { - clipboard.primaryClip = clipData + clipboard.setPrimaryClip(clipData) Toast.makeText(context, "高级功能已开启\n红包码已复制\n支付宝首页搜索“537954522” 立即领红包", Toast.LENGTH_LONG) .show() } diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index 761dcf337..cefa60af7 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -80,8 +80,8 @@ class BookSourceEditActivity : } R.id.menu_copy_source -> { GSON.toJson(getSource())?.let { sourceStr -> - val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? - clipboard?.primaryClip = ClipData.newPlainText(null, sourceStr) + val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager + clipboard?.setPrimaryClip(ClipData.newPlainText(null, sourceStr)) } } R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) } diff --git a/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt index 24b296f7c..b7aa68e76 100644 --- a/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt @@ -108,7 +108,7 @@ class ConfigFragment : PreferenceFragmentCompat(), PreferKey.downloadPath -> getPrefString(PreferKey.downloadPath) ?: App.INSTANCE.getExternalFilesDir(null)?.absolutePath ?: App.INSTANCE.cacheDir.absolutePath - else -> getPrefString(key, "") + else -> getPrefString(key) ?: "" } } 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 2599fe1f3..d1704848e 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 @@ -98,8 +98,8 @@ class RssSourceEditActivity : } R.id.menu_copy_source -> { GSON.toJson(getRssSource())?.let { sourceStr -> - val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? - clipboard?.primaryClip = ClipData.newPlainText(null, sourceStr) + val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager + clipboard?.setPrimaryClip(ClipData.newPlainText(null, sourceStr)) } } R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) }