mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
simplify the settings spinner initialization
This commit is contained in:
parent
8a1deddc55
commit
e7c9964d4a
1 changed files with 1 additions and 6 deletions
|
@ -64,15 +64,10 @@ 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 a new issue