pull/49/head
kunfei 5 years ago
parent 845999f9f6
commit 6db5f27137
  1. 6
      app/src/main/java/io/legado/app/model/Debug.kt
  2. 4
      app/src/main/java/io/legado/app/ui/about/DonateActivity.kt
  3. 4
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  4. 2
      app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt
  5. 4
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt

@ -54,16 +54,16 @@ object Debug {
cancelDebug() cancelDebug()
debugSource = rssSource.sourceUrl debugSource = rssSource.sourceUrl
log(debugSource, "︾开始解析RSS") log(debugSource, "︾开始解析RSS")
Rss.getArticles(rssSource, 1) Rss.getArticles(rssSource, null)
.onSuccess { .onSuccess {
if (it == null) { if (it == null) {
log(debugSource, "︽解析失败", state = -1) log(debugSource, "︽解析失败", state = -1)
} else { } else {
val ruleContent = rssSource.ruleContent 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, "︽解析完成")
log(debugSource, showTime = false) log(debugSource, showTime = false)
rssContentDebug(it[0], ruleContent) rssContentDebug(it.articles[0], ruleContent)
} else { } else {
log(debugSource, "︽解析完成", state = 1000) log(debugSource, "︽解析完成", state = 1000)
} }

@ -32,7 +32,7 @@ class DonateActivity : BaseActivity(R.layout.activity_donate) {
val clipboard = this.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager val clipboard = this.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
val clipData = ClipData.newPlainText(null, "开源阅读软件") val clipData = ClipData.newPlainText(null, "开源阅读软件")
clipboard?.let { clipboard?.let {
clipboard.primaryClip = clipData clipboard.setPrimaryClip(clipData)
toast(R.string.copy_complete) 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 clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
val clipData = ClipData.newPlainText(null, "537954522") val clipData = ClipData.newPlainText(null, "537954522")
clipboard?.let { clipboard?.let {
clipboard.primaryClip = clipData clipboard.setPrimaryClip(clipData)
Toast.makeText(context, "高级功能已开启\n红包码已复制\n支付宝首页搜索“537954522” 立即领红包", Toast.LENGTH_LONG) Toast.makeText(context, "高级功能已开启\n红包码已复制\n支付宝首页搜索“537954522” 立即领红包", Toast.LENGTH_LONG)
.show() .show()
} }

@ -80,8 +80,8 @@ class BookSourceEditActivity :
} }
R.id.menu_copy_source -> { R.id.menu_copy_source -> {
GSON.toJson(getSource())?.let { sourceStr -> GSON.toJson(getSource())?.let { sourceStr ->
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
clipboard?.primaryClip = ClipData.newPlainText(null, sourceStr) clipboard?.setPrimaryClip(ClipData.newPlainText(null, sourceStr))
} }
} }
R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) } R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) }

@ -108,7 +108,7 @@ class ConfigFragment : PreferenceFragmentCompat(),
PreferKey.downloadPath -> getPrefString(PreferKey.downloadPath) PreferKey.downloadPath -> getPrefString(PreferKey.downloadPath)
?: App.INSTANCE.getExternalFilesDir(null)?.absolutePath ?: App.INSTANCE.getExternalFilesDir(null)?.absolutePath
?: App.INSTANCE.cacheDir.absolutePath ?: App.INSTANCE.cacheDir.absolutePath
else -> getPrefString(key, "") else -> getPrefString(key) ?: ""
} }
} }

@ -98,8 +98,8 @@ class RssSourceEditActivity :
} }
R.id.menu_copy_source -> { R.id.menu_copy_source -> {
GSON.toJson(getRssSource())?.let { sourceStr -> GSON.toJson(getRssSource())?.let { sourceStr ->
val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
clipboard?.primaryClip = ClipData.newPlainText(null, sourceStr) clipboard?.setPrimaryClip(ClipData.newPlainText(null, sourceStr))
} }
} }
R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) } R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) }

Loading…
Cancel
Save