mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-22 07:42:52 +00:00
Colorpicker: preserve entered color
This commit is contained in:
parent
6aa8dc98ac
commit
3aab01aee3
2 changed files with 12 additions and 1 deletions
|
@ -343,6 +343,17 @@ public class ColorPickerView extends View {
|
|||
return Utils.adjustAlpha(this.alpha, color);
|
||||
}
|
||||
|
||||
public int getEnteredColor() {
|
||||
if (this.colorEdit != null)
|
||||
try {
|
||||
return Color.parseColor(this.colorEdit.getText().toString());
|
||||
} catch (Throwable ex) {
|
||||
return Color.TRANSPARENT;
|
||||
}
|
||||
else
|
||||
return getSelectedColor();
|
||||
}
|
||||
|
||||
public Integer[] getAllColors() {
|
||||
return initialColors;
|
||||
}
|
||||
|
|
|
@ -289,7 +289,7 @@ public class ColorPickerDialogBuilder {
|
|||
}
|
||||
|
||||
private void positiveButtonOnClick(DialogInterface dialog, ColorPickerClickListener onClickListener) {
|
||||
int selectedColor = colorPickerView.getSelectedColor();
|
||||
int selectedColor = colorPickerView.getEnteredColor();
|
||||
Integer[] allColors = colorPickerView.getAllColors();
|
||||
onClickListener.onClick(dialog, selectedColor, allColors);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue