mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-16 23:12:47 +00:00
Add "Default" button to the color picker (#242)
This commit is contained in:
parent
a55cd619dc
commit
b797ebd064
1 changed files with 10 additions and 0 deletions
|
@ -128,6 +128,16 @@ open class ColorsSettingsFragment : Fragment(R.layout.color_settings) {
|
||||||
}
|
}
|
||||||
reloadKeyboard(hidden)
|
reloadKeyboard(hidden)
|
||||||
}
|
}
|
||||||
|
// The Default button appears only when a color has already been defined
|
||||||
|
if (csb.colorSwitch.isChecked) {
|
||||||
|
// Reset the color and the color picker to their initial state
|
||||||
|
builder.setNeutralButton(R.string.button_default) { _, _ ->
|
||||||
|
csb.colorSwitch.isChecked = false
|
||||||
|
val resetColor = Settings.readUserColor(prefs, requireContext(), colorPrefs[index], isNight)
|
||||||
|
picker.color = resetColor
|
||||||
|
csb.colorSwitch.toggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
val dialog = builder.create()
|
val dialog = builder.create()
|
||||||
dialog.show()
|
dialog.show()
|
||||||
// Reduce the size of the dialog in portrait mode
|
// Reduce the size of the dialog in portrait mode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue