From e7c9964d4a49de810204cb0ffa054b6cf69e94ec Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 6 Jan 2017 21:08:34 +0100 Subject: [PATCH] simplify the settings spinner initialization --- .../gallery/activities/SettingsActivity.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index be4e8ae1a..f610c134e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -64,15 +64,10 @@ class SettingsActivity : SimpleActivity() { } private fun setupShowMedia() { - var isInitialSetup = true settings_show_media.setSelection(config.showMedia) settings_show_media.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { - if (isInitialSetup) - settings_show_media.setSelection(config.showMedia) - else - config.showMedia = settings_show_media.selectedItemPosition - isInitialSetup = false + config.showMedia = settings_show_media.selectedItemPosition } override fun onNothingSelected(parent: AdapterView<*>?) {