渐变像素对话框调试完成。

This commit is contained in:
2025-12-16 17:48:59 +08:00
parent 9426618b59
commit dffcc0f8a0
3 changed files with 11 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Tue Dec 16 09:10:00 GMT 2025 #Tue Dec 16 09:46:41 GMT 2025
stageCount=7 stageCount=7
libraryProject= libraryProject=
baseVersion=15.14 baseVersion=15.14
publishVersion=15.14.6 publishVersion=15.14.6
buildCount=48 buildCount=52
baseBetaVersion=15.14.7 baseBetaVersion=15.14.7

View File

@@ -68,6 +68,7 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
// 控件引用(新增透明度进度条+文本) // 控件引用(新增透明度进度条+文本)
private ImageView ivColorPicker; // 颜色预览拾取框 private ImageView ivColorPicker; // 颜色预览拾取框
private ImageView ivColorScaler; // 颜色渐变拾取框
private EditText etR; // R分量输入框显示实时调节值 private EditText etR; // R分量输入框显示实时调节值
private EditText etG; // G分量输入框显示实时调节值 private EditText etG; // G分量输入框显示实时调节值
private EditText etB; // B分量输入框显示实时调节值 private EditText etB; // B分量输入框显示实时调节值
@@ -145,6 +146,7 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
*/ */
private void initViewBind(View view) { private void initViewBind(View view) {
ivColorPicker = view.findViewById(R.id.iv_color_picker); ivColorPicker = view.findViewById(R.id.iv_color_picker);
ivColorScaler = view.findViewById(R.id.iv_color_scaler);
etR = view.findViewById(R.id.et_r); etR = view.findViewById(R.id.et_r);
etG = view.findViewById(R.id.et_g); etG = view.findViewById(R.id.et_g);
etB = view.findViewById(R.id.et_b); etB = view.findViewById(R.id.et_b);
@@ -158,7 +160,7 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
tvCancel = view.findViewById(R.id.tv_cancel); tvCancel = view.findViewById(R.id.tv_cancel);
// 控件非空校验(小米低版本容错,绑定失败直接关闭对话框) // 控件非空校验(小米低版本容错,绑定失败直接关闭对话框)
if (ivColorPicker == null || etR == null || etG == null || etB == null || etColorValue == null if (ivColorPicker == null || ivColorScaler == null || etR == null || etG == null || etB == null || etColorValue == null
|| sbAlpha == null || tvAlphaValue == null || sbAlpha == null || tvAlphaValue == null
|| tvBrightnessMinus == null || tvBrightnessValue == null || tvBrightnessPlus == null || tvBrightnessMinus == null || tvBrightnessValue == null || tvBrightnessPlus == null
|| tvConfirm == null || tvCancel == null) { || tvConfirm == null || tvCancel == null) {
@@ -201,6 +203,7 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
private void initListener() { private void initListener() {
// 点击监听(按钮+颜色拾取框) // 点击监听(按钮+颜色拾取框)
ivColorPicker.setOnClickListener(this); ivColorPicker.setOnClickListener(this);
ivColorScaler.setOnClickListener(this);
tvConfirm.setOnClickListener(this); tvConfirm.setOnClickListener(this);
tvCancel.setOnClickListener(this); tvCancel.setOnClickListener(this);
tvBrightnessMinus.setOnClickListener(this); tvBrightnessMinus.setOnClickListener(this);
@@ -657,13 +660,14 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
// ====================== 点击事件实现(统一处理,逻辑清晰) ====================== // ====================== 点击事件实现(统一处理,逻辑清晰) ======================
@Override @Override
public void onClick(View v) { public void onClick(View v) {
//ToastUtils.show("onClick");
int id = v.getId(); int id = v.getId();
// 关键:所有点击事件均加判断(避免并发冲突/重复触发) // 关键:所有点击事件均加判断(避免并发冲突/重复触发)
if (!isAppSelfUpdatingColor) { if (!isAppSelfUpdatingColor) {
if (id == R.id.iv_color_picker) { if (id == R.id.iv_color_picker) {
showSystemColorPicker(); // 打开系统颜色选择器 showSystemColorPicker(); // 打开系统颜色选择器
} if (id == R.id.iv_color_scale) { } if (id == R.id.iv_color_scaler) {
ToastUtils.show("iv_color_scale"); //ToastUtils.show("iv_color_scale");
openColorPickerDialog(mCurrentColor); // 打开系统颜色选择器 openColorPickerDialog(mCurrentColor); // 打开系统颜色选择器
} else if (id == R.id.tv_confirm) { } else if (id == R.id.tv_confirm) {
mListener.onColorSelected(mCurrentColor); // 确认选择,回调颜色 mListener.onColorSelected(mCurrentColor); // 确认选择,回调颜色
@@ -682,7 +686,7 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
void openColorPickerDialog(int nColor){ void openColorPickerDialog(int nColor){
ToastUtils.show("openColorPickerDialog"); //ToastUtils.show("openColorPickerDialog");
ColorPickerDialog dlg = new ColorPickerDialog(getContext(), nColor); ColorPickerDialog dlg = new ColorPickerDialog(getContext(), nColor);
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() { dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {

View File

@@ -22,7 +22,7 @@
android:focusable="true"/> android:focusable="true"/>
<ImageView <ImageView
android:id="@+id/iv_color_scale" android:id="@+id/iv_color_scaler"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="100dp" android:layout_height="100dp"
android:clickable="true" android:clickable="true"