From 78c77632124cc6d89c5b35244490b4eb06640e21 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Tue, 16 Dec 2025 20:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A2=9C=E8=89=B2=E6=8B=BE?= =?UTF-8?q?=E5=8F=96=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- powerbell/build.properties | 4 +- .../powerbell/dialogs/ColorPaletteDialog.java | 67 ++++++++++++------- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/powerbell/build.properties b/powerbell/build.properties index b2bee88..b175947 100644 --- a/powerbell/build.properties +++ b/powerbell/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Tue Dec 16 09:46:41 GMT 2025 +#Tue Dec 16 11:58:30 GMT 2025 stageCount=7 libraryProject= baseVersion=15.14 publishVersion=15.14.6 -buildCount=52 +buildCount=63 baseBetaVersion=15.14.7 diff --git a/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/ColorPaletteDialog.java b/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/ColorPaletteDialog.java index ea5fb28..540f1d5 100644 --- a/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/ColorPaletteDialog.java +++ b/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/ColorPaletteDialog.java @@ -668,7 +668,7 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener, showSystemColorPicker(); // 打开系统颜色选择器 } if (id == R.id.iv_color_scaler) { //ToastUtils.show("iv_color_scale"); - openColorPickerDialog(mCurrentColor); // 打开系统颜色选择器 + openColorScalerDialog(mCurrentColor); // 打开系统颜色选择器 } else if (id == R.id.tv_confirm) { mListener.onColorSelected(mCurrentColor); // 确认选择,回调颜色 LogUtils.d(TAG, "confirm color | 回调颜色:" + String.format("#%08X", mCurrentColor)); @@ -683,11 +683,10 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener, } } } - - void openColorPickerDialog(int nColor){ + void openColorScalerDialog(int nColor) { //ToastUtils.show("openColorPickerDialog"); - ColorPickerDialog dlg = new ColorPickerDialog(getContext(), nColor); + final ColorScalerDialog dlg = new ColorScalerDialog(getContext(), nColor); dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() { @Override @@ -696,37 +695,53 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener, @Override public void onColorChanged(int color) { - if (!isAppSelfUpdatingColor) { - isAppSelfUpdatingColor = true; - try { - mOriginalAlpha = Color.alpha(color); - mOriginalAlphaPercent = alpha2Percent(mOriginalAlpha); - mOriginalR = Color.red(color); - mOriginalG = Color.green(color); - mOriginalB = Color.blue(color); - mCurrentAlpha = mOriginalAlpha; - mCurrentAlphaPercent = mOriginalAlphaPercent; - mCurrentR = mOriginalR; - mCurrentG = mOriginalG; - mCurrentB = mOriginalB; - mCurrentBrightnessPercent = DEFAULT_BRIGHTNESS; - mCurrentColor = color; - updateAllViews(); - LogUtils.d(TAG, "select system color | 选择颜色:" + String.format("#%08X", color) - + " | 透明度:" + mCurrentAlphaPercent + "%"); - } finally { - isAppSelfUpdatingColor = false; - } - } + dlg.currentColorScalerDialogColor = color; } @Override public void afterColorChanged() { + } }); dlg.show(); } + + class ColorScalerDialog extends ColorPickerDialog { + public int currentColorScalerDialogColor = 0; + public ColorScalerDialog(Context context, int p) { + super(context, p); + } + + @Override + public void dismiss() { + super.dismiss(); + int color = currentColorScalerDialogColor; + ToastUtils.show(String.format("dismiss color %d", color)); + if (!isAppSelfUpdatingColor) { + isAppSelfUpdatingColor = true; + try { + mOriginalAlpha = Color.alpha(color); + mOriginalAlphaPercent = alpha2Percent(mOriginalAlpha); + mOriginalR = Color.red(color); + mOriginalG = Color.green(color); + mOriginalB = Color.blue(color); + mCurrentAlpha = mOriginalAlpha; + mCurrentAlphaPercent = mOriginalAlphaPercent; + mCurrentR = mOriginalR; + mCurrentG = mOriginalG; + mCurrentB = mOriginalB; + mCurrentBrightnessPercent = DEFAULT_BRIGHTNESS; + mCurrentColor = color; + updateAllViews(); + LogUtils.d(TAG, "select system color | 选择颜色:" + String.format("#%08X", color) + + " | 透明度:" + mCurrentAlphaPercent + "%"); + } finally { + isAppSelfUpdatingColor = false; + } + } + } + } }