20251216_171108_907

This commit is contained in:
2025-12-16 17:11:20 +08:00
parent 68d98d4be3
commit 9426618b59
5 changed files with 76 additions and 11 deletions

View File

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

View File

@@ -32,6 +32,7 @@ import cc.winboll.studio.powerbell.utils.FileUtils;
import cc.winboll.studio.powerbell.utils.ImageCropUtils;
import cc.winboll.studio.powerbell.utils.UriUtils;
import cc.winboll.studio.powerbell.views.BackgroundView;
import com.a4455jkjh.colorpicker.ColorPickerDialog;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;

View File

@@ -20,7 +20,9 @@ import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.powerbell.R;
import com.a4455jkjh.colorpicker.ColorPickerDialog;
/**
* @Author ZhanGSKen<zhangsken@qq.com>
@@ -660,6 +662,9 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
if (!isAppSelfUpdatingColor) {
if (id == R.id.iv_color_picker) {
showSystemColorPicker(); // 打开系统颜色选择器
} if (id == R.id.iv_color_scale) {
ToastUtils.show("iv_color_scale");
openColorPickerDialog(mCurrentColor); // 打开系统颜色选择器
} else if (id == R.id.tv_confirm) {
mListener.onColorSelected(mCurrentColor); // 确认选择,回调颜色
LogUtils.d(TAG, "confirm color | 回调颜色:" + String.format("#%08X", mCurrentColor));
@@ -674,5 +679,50 @@ public class ColorPaletteDialog extends Dialog implements View.OnClickListener,
}
}
}
void openColorPickerDialog(int nColor){
ToastUtils.show("openColorPickerDialog");
ColorPickerDialog dlg = new ColorPickerDialog(getContext(), nColor);
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {
@Override
public void beforeColorChanged() {
}
@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;
}
}
}
@Override
public void afterColorChanged() {
}
});
dlg.show();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

View File

@@ -7,15 +7,29 @@
android:padding="20dp"
android:background="#FFFFFFFF">
<ImageView
android:id="@+id/iv_color_picker"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:background="#FF0000"
android:clickable="true"
android:focusable="true"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/iv_color_picker"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#FF0000"
android:clickable="true"
android:focusable="true"/>
<ImageView
android:id="@+id/iv_color_scale"
android:layout_width="100dp"
android:layout_height="100dp"
android:clickable="true"
android:focusable="true"
android:src="@drawable/color_scale_logo"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"