From a0dffcf51f12ac50114e88c12c844e2e1b981366 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 13 Mar 2020 18:23:07 -0400 Subject: [PATCH] Address some build warnings --- .../kanade/tachiyomi/data/preference/PreferencesHelper.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 8 ++++---- .../eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt | 2 +- .../eu/kanade/tachiyomi/util/lang/StringExtensions.kt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index 17f66d08d..4fc67af9a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -4,7 +4,7 @@ import android.content.Context import android.content.SharedPreferences import android.net.Uri import android.os.Environment -import android.preference.PreferenceManager +import androidx.preference.PreferenceManager import com.f2prateek.rx.preferences.Preference import com.f2prateek.rx.preferences.RxSharedPreferences import eu.kanade.tachiyomi.R diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index a63b9a51a..80b46ebb0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -138,12 +138,12 @@ class ReaderActivity : BaseRxActivity() { /** * Called when the activity is created. Initializes the presenter and configuration. */ - override fun onCreate(savedState: Bundle?) { + override fun onCreate(savedInstanceState: Bundle?) { setTheme(when (preferences.readerTheme().getOrDefault()) { 0 -> R.style.Theme_Reader_Light else -> R.style.Theme_Reader }) - super.onCreate(savedState) + super.onCreate(savedInstanceState) setContentView(R.layout.reader_activity) if (presenter.needsInit()) { @@ -159,8 +159,8 @@ class ReaderActivity : BaseRxActivity() { else presenter.init(manga, chapterUrl) } - if (savedState != null) { - menuVisible = savedState.getBoolean(::menuVisible.name) + if (savedInstanceState != null) { + menuVisible = savedInstanceState.getBoolean(::menuVisible.name) } config = ReaderConfig() diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt index 03463af39..1dedec97e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt @@ -14,6 +14,6 @@ fun launchUI(block: suspend CoroutineScope.() -> Unit): Job = fun launchIO(block: suspend CoroutineScope.() -> Unit): Job = GlobalScope.launch(Dispatchers.IO, CoroutineStart.DEFAULT, block) -@UseExperimental(ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) fun launchNow(block: suspend CoroutineScope.() -> Unit): Job = GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, block) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt index 68d2786c9..2d4d3b9b1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt @@ -44,7 +44,7 @@ fun String.byteSize(): Int { * Returns a string containing the first [n] bytes from this string, or the entire string if this * string is shorter. */ -@UseExperimental(ExperimentalStdlibApi::class) +@OptIn(ExperimentalStdlibApi::class) fun String.takeBytes(n: Int): String { val bytes = toByteArray(Charsets.UTF_8) return if (bytes.size <= n) {