0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

Fix deprecations on Preferences.kt

+ cleaned a suppressing which had no use
This commit is contained in:
Brayan 2022-06-03 07:13:12 -03:00 committed by David Allison
parent 5844ce1178
commit 8efea26e98

View File

@ -210,13 +210,12 @@ class Preferences : AnkiActivity() {
}
}
@Suppress("deprecation") // startActivity
fun restartWithNewDeckPicker() {
// PERF: DB access on foreground thread
CollectionHelper.getInstance().closeCollection(true, "Preference Modification: collection path changed")
val deckPicker = Intent(this, DeckPicker::class.java)
deckPicker.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(deckPicker)
startActivityWithAnimation(deckPicker, ActivityTransitionAnimation.Direction.DEFAULT)
}
override fun onSaveInstanceState(outState: Bundle) {
@ -805,7 +804,6 @@ class Preferences : AnkiActivity() {
override val analyticsScreenNameConstant: String
get() = "prefs.appearance"
@Suppress("deprecation") // startActivityForResult
override fun initSubscreen() {
addPreferencesFromResource(R.xml.preferences_appearance)
mBackgroundImage = requirePreference<SwitchPreference>("deckPickerBackground")