mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-23 14:41:06 +01:00
select the proper item at settings spinner
This commit is contained in:
parent
fe85ef685b
commit
4e75a84660
@ -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<*>?) {
|
||||
|
Loading…
Reference in New Issue
Block a user