From 7274498462f66bcc028af489a483808734e850a7 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 9 Jan 2020 21:03:13 -0800 Subject: [PATCH] Fixed downloads not being deleted after reading Fixed dark theme maybe --- .../tachiyomi/data/download/DownloadPendingDeleter.kt | 6 ++++-- .../eu/kanade/tachiyomi/network/CloudflareInterceptor.kt | 2 +- app/src/main/res/drawable/splash_background.xml | 5 ++--- app/src/main/res/values-night/colors.xml | 1 + app/src/main/res/values/colors.xml | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadPendingDeleter.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadPendingDeleter.kt index a7ce329a8a..1a0b29311a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadPendingDeleter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadPendingDeleter.kt @@ -146,7 +146,8 @@ class DownloadPendingDeleter(context: Context) { private data class ChapterEntry( val id: Long, val url: String, - val name: String + val name: String, + val scanlator: String? ) /** @@ -170,7 +171,7 @@ class DownloadPendingDeleter(context: Context) { * Returns a chapter entry from a chapter model. */ private fun Chapter.toEntry(): ChapterEntry { - return ChapterEntry(id!!, url, name) + return ChapterEntry(id!!, url, name, scanlator) } /** @@ -188,6 +189,7 @@ class DownloadPendingDeleter(context: Context) { private fun ChapterEntry.toModel(): Chapter { return Chapter.create().also { it.id = id + it.scanlator = scanlator it.url = url it.name = name } diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt index ec66d2df40..b6ac0475c2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt @@ -71,7 +71,7 @@ class CloudflareInterceptor(private val context: Context) : Interceptor { val headers = request.headers.toMultimap().mapValues { it.value.getOrNull(0) ?: "" } handler.post { - val view = WebView(context) + val view = WebView(context.applicationContext) webView = view view.settings.javaScriptEnabled = true view.settings.userAgentString = request.header("User-Agent") diff --git a/app/src/main/res/drawable/splash_background.xml b/app/src/main/res/drawable/splash_background.xml index ff5ff95ead..7186c59ae3 100644 --- a/app/src/main/res/drawable/splash_background.xml +++ b/app/src/main/res/drawable/splash_background.xml @@ -1,13 +1,12 @@ - + + android:src="@drawable/splash_icon"/> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index e8658d3fc4..94ab3f0559 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -8,4 +8,5 @@ @color/md_white_1000_20 @color/md_grey_800 #3399FF + @color/colorDarkPrimary \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index c6d3a2a970..760f7a559f 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -6,6 +6,7 @@ @color/md_black_1000_12 @color/colorPrimary #FFFFFF + #455A64 #323232 #323232 @color/md_white_1000 @@ -16,8 +17,6 @@ #212121 @color/md_black_1000 - #455A64 - @color/md_blue_A400 @color/md_black_1000_87