Auto-dismiss radio dialog when selecting an option
Fixes #654 and improves usability
This commit is contained in:
parent
bd04fddeb0
commit
7d3900f172
|
@ -64,11 +64,13 @@ class AppVersionSelectorDialog :
|
|||
tag.isChecked = true
|
||||
}
|
||||
dialogTitle.text = getString(R.string.version)
|
||||
dialogSave.setOnClickListener {
|
||||
dialogRadiogroup.setOnCheckedChangeListener { _, _ ->
|
||||
val checkedTag = dialogRadiogroup.checkedButtonTag
|
||||
|
||||
if (checkedTag != null) {
|
||||
prefs.edit { putString("${arguments?.getString(TAG_APP)}_version", checkedTag) }
|
||||
}
|
||||
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ class VancedThemeSelectorDialog :
|
|||
if (tag != null) {
|
||||
tag.isChecked = true
|
||||
}
|
||||
dialogSave.setOnClickListener {
|
||||
dialogRadiogroup.setOnCheckedChangeListener { _, _ ->
|
||||
val checkedTag = binding.dialogRadiogroup.checkedButtonTag
|
||||
if (checkedTag != null) {
|
||||
prefs.theme = checkedTag
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/BottomDialogCard">
|
||||
xmlns:tools="http://schemas.android.com/tools" style="@style/BottomDialogCard">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -18,14 +18,8 @@
|
|||
<RadioGroup
|
||||
android:id="@+id/dialog_radiogroup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</RadioGroup>
|
||||
android:layout_height="wrap_content"/>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<com.vanced.manager.ui.core.ThemedMaterialButton
|
||||
android:id="@+id/dialog_save"
|
||||
android:text="@string/save"
|
||||
style="@style/BottomDialogButtonStyle" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
Loading…
Reference in New Issue