mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-23 22:50:59 +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() {
|
private fun setupShowMedia() {
|
||||||
|
var isInitialSetup = true
|
||||||
settings_show_media.setSelection(config.showMedia)
|
settings_show_media.setSelection(config.showMedia)
|
||||||
settings_show_media.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
settings_show_media.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||||
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
|
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
|
config.showMedia = settings_show_media.selectedItemPosition
|
||||||
|
isInitialSetup = false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNothingSelected(parent: AdapterView<*>?) {
|
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||||
|
Loading…
Reference in New Issue
Block a user