Compare commits

...

4 Commits

6 changed files with 36 additions and 20 deletions

View File

@@ -109,7 +109,7 @@ dependencies {
*/
// WinBoLL库 nexus.winboll.cc 地址
api 'cc.winboll.studio:libaes:15.15.9'
api 'cc.winboll.studio:libappbase:15.15.20'
api 'cc.winboll.studio:libappbase:15.15.21'
// WinBoLL备用库 jitpack.io 地址
//api 'com.github.ZhanGSKen:AES:aes-v15.15.7'

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Tue Apr 28 13:58:55 HKT 2026
stageCount=9
#Tue Apr 28 19:41:44 CST 2026
stageCount=10
libraryProject=
baseVersion=15.0
publishVersion=15.0.8
buildCount=0
baseBetaVersion=15.0.9
publishVersion=15.0.9
buildCount=11
baseBetaVersion=15.0.10

View File

@@ -3,6 +3,7 @@ package cc.winboll.studio.gallery;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.RectF;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.content.DialogInterface;
@@ -115,10 +116,11 @@ public class CropActivity extends AppCompatActivity {
cropCanvasView = findViewById(R.id.crop_canvas_view);
final View colorView = findViewById(R.id.color_view);
final GradientDrawable colorDrawable = (GradientDrawable) colorView.getBackground();
cropCanvasView.setOnBackgroundColorChangedListener(new CropCanvasView.OnBackgroundColorChangedListener() {
@Override
public void onBackgroundColorChanged(int color) {
colorView.setBackgroundColor(color);
colorDrawable.setColor(color);
}
});
@@ -127,6 +129,7 @@ public class CropActivity extends AppCompatActivity {
public void onColorPicked(int color) {
int pickX = cropCanvasView.getLastPickImageX();
int pickY = cropCanvasView.getLastPickImageY();
colorDrawable.setColor(color);
Toast.makeText(CropActivity.this,
"颜色已拾取: #" + String.format("%06X", color & 0xFFFFFF) +
" (" + pickX + "," + pickY + ")",
@@ -142,7 +145,7 @@ public class CropActivity extends AppCompatActivity {
}
});
colorView.setBackgroundColor(cropCanvasView.getBackgroundColor());
colorDrawable.setColor(cropCanvasView.getBackgroundColor());
loadImage();
}

View File

@@ -518,7 +518,15 @@ public class CropCanvasView extends View {
if (colorPickMode) {
if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE) {
if (originalBitmap != null && !originalBitmap.isRecycled()) {
previewColor = getImageColorAt(x, y);
float imgX = screenToImageX(x);
float imgY = screenToImageY(y);
if (imageBounds.contains(imgX, imgY)) {
previewColor = getImageColorAt(x, y);
} else if (canvasBounds.contains(x, y)) {
previewColor = backgroundColor;
} else {
previewColor = Color.TRANSPARENT;
}
lastPickX = x;
lastPickY = y;
if (backgroundColorChangedListener != null) {
@@ -528,10 +536,19 @@ public class CropCanvasView extends View {
return true;
}
if (event.getAction() == MotionEvent.ACTION_UP) {
if (previewColor != 0 && previewColor != Color.TRANSPARENT) {
backgroundColor = previewColor;
if (canvasBounds.contains(x, y)) {
int pickedColor;
float imgX = screenToImageX(x);
float imgY = screenToImageY(y);
if (imageBounds.contains(imgX, imgY)) {
int colorAtPoint = getImageColorAt(x, y);
pickedColor = colorAtPoint;
backgroundColor = colorAtPoint;
} else {
pickedColor = backgroundColor;
}
if (colorPickedListener != null) {
colorPickedListener.onColorPicked(backgroundColor);
colorPickedListener.onColorPicked(pickedColor);
}
}
if (colorPickEndListener != null) {

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@android:color/holo_green_dark"/>
<solid android:color="@android:color/transparent"/>
<stroke android:width="2dp" android:color="@android:color/white"/>
<size android:width="32dp" android:height="32dp"/>
</shape>

View File

@@ -25,7 +25,8 @@
android:id="@+id/color_icon_container"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="8dp">
android:layout_marginStart="8dp"
android:background="@android:color/transparent">
<View
android:id="@+id/color_view"
@@ -34,12 +35,6 @@
android:layout_gravity="center"
android:background="@drawable/bg_color_circle"/>
<View
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="center"
android:background="@drawable/bg_color_circle_border"/>
</FrameLayout>
<ImageView