From 4e75a846608dd2ed54b3321f66a53650042c3bf3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 27 Dec 2016 01:09:56 +0100 Subject: [PATCH] select the proper item at settings spinner --- .../gallery/activities/SettingsActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 457bc58b8..7bbab27bf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -55,10 +55,15 @@ 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) { - config.showMedia = settings_show_media.selectedItemPosition + if (isInitialSetup) + settings_show_media.setSelection(config.showMedia) + else + config.showMedia = settings_show_media.selectedItemPosition + isInitialSetup = false } override fun onNothingSelected(parent: AdapterView<*>?) {