mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
select the proper item at settings spinner
This commit is contained in:
parent
fe85ef685b
commit
4e75a84660
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
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 a new issue