Fixed downloads not being deleted after reading

Fixed dark theme maybe
This commit is contained in:
Jay 2020-01-09 21:03:13 -08:00
parent 5f2eb19ea3
commit 7274498462
5 changed files with 9 additions and 8 deletions

View File

@ -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
}

View File

@ -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")

View File

@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/cardBackground" />
<item android:drawable="@color/splashBackground" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/splash_icon"
android:tint="@color/snackbarBackground"/>
android:src="@drawable/splash_icon"/>
</item>
</layer-list>

View File

@ -8,4 +8,5 @@
<color name="rippleColor">@color/md_white_1000_20</color>
<color name="dialogBackground">@color/md_grey_800</color>
<color name="colorAccent">#3399FF</color>
<color name="splashBackground">@color/colorDarkPrimary</color>
</resources>

View File

@ -6,6 +6,7 @@
<color name="drawerHighlight">@color/md_black_1000_12</color>
<color name="drawerPrimary">@color/colorPrimary</color>
<color name="cardBackground">#FFFFFF</color>
<color name="splashBackground">#455A64</color>
<color name="snackbarBackground">#323232</color>
<color name="trueSnackbarBackground">#323232</color>
<color name="dialogBackground">@color/md_white_1000</color>
@ -16,8 +17,6 @@
<color name="colorDarkPrimaryDark">#212121</color>
<color name="colorAmoledPrimary">@color/md_black_1000</color>
<color name="colorSplash">#455A64</color>
<!-- Light Theme -->
<color name="colorAccentLight">@color/md_blue_A400</color>
<color name="textColorPrimaryLight">@color/md_black_1000_87</color>