From 6afaa447e63979c781befe15b6da43c91d131fa7 Mon Sep 17 00:00:00 2001 From: Wenbin Date: Fri, 18 Dec 2020 22:36:17 +0800 Subject: [PATCH] Allow setting background color for ColorPickerWindow --- .../are/styles/toolitems/ARE_ToolItem_FontColor.java | 8 ++++++++ .../are/styles/toolitems/styles/ARE_Style_FontColor.java | 9 +++++++++ .../chinalwb/are/styles/windows/ColorPickerWindow.java | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/ARE_ToolItem_FontColor.java b/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/ARE_ToolItem_FontColor.java index f769161..bc1835b 100644 --- a/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/ARE_ToolItem_FontColor.java +++ b/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/ARE_ToolItem_FontColor.java @@ -18,8 +18,15 @@ public class ARE_ToolItem_FontColor extends ARE_ToolItem_Abstract { private final ColorPickerView colorPickerView; + private int colorPickerBackgroundColor; + public ARE_ToolItem_FontColor() { + this(android.R.color.white); + } + + public ARE_ToolItem_FontColor(int colorPickerBackgroundColor) { this.colorPickerView = null; + this.colorPickerBackgroundColor = colorPickerBackgroundColor; } public ARE_ToolItem_FontColor(ColorPickerView colorPickerView) { @@ -32,6 +39,7 @@ public IARE_Style getStyle() { AREditText editText = this.getEditText(); mStyle = new ARE_Style_FontColor(editText, (ImageView) mToolItemView, colorPickerView); } + ((ARE_Style_FontColor) mStyle).setColorPickerBackgroundColor(colorPickerBackgroundColor); return mStyle; } diff --git a/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/styles/ARE_Style_FontColor.java b/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/styles/ARE_Style_FontColor.java index 75279a8..78f04f3 100644 --- a/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/styles/ARE_Style_FontColor.java +++ b/ARE/are/src/main/java/com/chinalwb/are/styles/toolitems/styles/ARE_Style_FontColor.java @@ -5,6 +5,8 @@ import android.widget.EditText; import android.widget.ImageView; +import androidx.annotation.ColorInt; + import com.chinalwb.are.AREditText; import com.chinalwb.are.Util; import com.chinalwb.are.colorpicker.ColorPickerListener; @@ -25,6 +27,8 @@ public class ARE_Style_FontColor extends ARE_ABS_Dynamic_Style