mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-19 10:13:55 +00:00
Update UserInterfaceSettingsActivity.kt
restart prompt for home layout changes
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user