Fixed Issue of reader not following theme on app relaunch from memory

Cache now checks for downloads outside of library too
This commit is contained in:
Jay 2020-02-04 17:48:49 -08:00
parent 27fbcf2082
commit 0aca015171
2 changed files with 9 additions and 1 deletions

View file

@ -126,7 +126,7 @@ class DownloadCache(
//rootDir.files = sourceDirs
val db:DatabaseHelper by injectLazy()
val mangas = db.getLibraryMangas().executeAsBlocking()
val mangas = db.getMangas().executeAsBlocking()
sourceDirs.forEach { sourceValue ->
val sourceDir = sourceValue.value

View file

@ -20,6 +20,7 @@ import android.view.WindowManager
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.SeekBar
import androidx.appcompat.app.AppCompatDelegate
import androidx.biometric.BiometricManager
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.google.android.material.bottomsheet.BottomSheetDialog
@ -150,6 +151,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
* Called when the activity is created. Initializes the presenter and configuration.
*/
override fun onCreate(savedState: Bundle?) {
AppCompatDelegate.setDefaultNightMode(
when (preferences.theme()) {
1 -> AppCompatDelegate.MODE_NIGHT_NO
2, 3, 4 -> AppCompatDelegate.MODE_NIGHT_YES
else -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
}
)
setTheme(when (preferences.readerTheme().getOrDefault()) {
0 -> R.style.Theme_Base_Reader_Light
1 -> R.style.Theme_Base_Reader_Dark