Update UserInterfaceSettingsActivity.kt

restart prompt for home layout changes
This commit is contained in:
ibo
2024-02-27 14:38:12 +01:00
committed by GitHub
parent efe5f546a2
commit a5310e82a2

View File

@@ -52,6 +52,25 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
}.show()
dialog.window?.setDimAmount(0.8f)
}
binding.uiSettingsHomeLayout.setOnClickListener {
val set = PrefManager.getVal<List<Boolean>>(PrefName.HomeLayoutShow).toMutableList()
val views = resources.getStringArray(R.array.home_layouts)
val dialog = AlertDialog.Builder(this, R.style.MyPopup)
.setTitle(getString(R.string.home_layout_show)).apply {
setMultiChoiceItems(
views,
PrefManager.getVal<List<Boolean>>(PrefName.HomeLayoutShow).toBooleanArray()
) { _, i, value ->
set[i] = value
}
setPositiveButton("ok") { _, _ ->
PrefManager.setVal(PrefName.HomeLayoutShow, set)
restartApp()
}
}.show()
dialog.window?.setDimAmount(0.8f)
}
binding.uiSettingsSmallView.isChecked = PrefManager.getVal(PrefName.SmallView)
binding.uiSettingsSmallView.setOnCheckedChangeListener { _, isChecked ->
@@ -116,4 +135,4 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
show()
}
}
}
}