Compare commits
4 Commits
powerbell-
...
powerbell-
| Author | SHA1 | Date | |
|---|---|---|---|
| 70a004d9e3 | |||
| c7f8aea1ce | |||
| 6d4381d78a | |||
| ddcd9a450e |
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sun Dec 14 18:30:51 HKT 2025
|
#Sun Dec 14 19:58:14 HKT 2025
|
||||||
stageCount=6
|
stageCount=7
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.14
|
baseVersion=15.14
|
||||||
publishVersion=15.14.5
|
publishVersion=15.14.6
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.14.6
|
baseBetaVersion=15.14.7
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package cc.winboll.studio.powerbell.activities;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Bitmap.CompressFormat;
|
import android.graphics.Bitmap.CompressFormat;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
@@ -16,7 +15,7 @@ import android.os.Looper;
|
|||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import androidx.annotation.NonNull;
|
import android.widget.LinearLayout;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class ImageCropUtils {
|
|||||||
|
|
||||||
// 3. 初始化 uCrop + 强制 PNG 配置(保留透明核心)
|
// 3. 初始化 uCrop + 强制 PNG 配置(保留透明核心)
|
||||||
UCrop uCrop = UCrop.of(inputUri, outputUri);
|
UCrop uCrop = UCrop.of(inputUri, outputUri);
|
||||||
|
uCrop.withAspectRatio(aspectX, aspectY);
|
||||||
UCrop.Options options = initCropOptions(activity, isFreeCrop, aspectX, aspectY); // 移除 isPng 参数
|
UCrop.Options options = initCropOptions(activity, isFreeCrop, aspectX, aspectY); // 移除 isPng 参数
|
||||||
|
|
||||||
// 4. 启动裁剪
|
// 4. 启动裁剪
|
||||||
@@ -116,6 +117,7 @@ public class ImageCropUtils {
|
|||||||
|
|
||||||
// 3. 初始化 uCrop + 强制 PNG 配置
|
// 3. 初始化 uCrop + 强制 PNG 配置
|
||||||
UCrop uCrop = UCrop.of(inputUri, outputUri);
|
UCrop uCrop = UCrop.of(inputUri, outputUri);
|
||||||
|
uCrop.withAspectRatio(aspectX, aspectY);
|
||||||
UCrop.Options options = initCropOptions(activity, isFreeCrop, aspectX, aspectY); // 移除 isPng 参数
|
UCrop.Options options = initCropOptions(activity, isFreeCrop, aspectX, aspectY); // 移除 isPng 参数
|
||||||
|
|
||||||
// 4. 启动裁剪
|
// 4. 启动裁剪
|
||||||
@@ -220,10 +222,20 @@ public class ImageCropUtils {
|
|||||||
* 移除 isPng 参数,全程用 PNG 配置
|
* 移除 isPng 参数,全程用 PNG 配置
|
||||||
*/
|
*/
|
||||||
private static UCrop.Options initCropOptions(Activity activity, boolean isFreeCrop, int aspectX, int aspectY) {
|
private static UCrop.Options initCropOptions(Activity activity, boolean isFreeCrop, int aspectX, int aspectY) {
|
||||||
|
|
||||||
UCrop.Options options = new UCrop.Options();
|
UCrop.Options options = new UCrop.Options();
|
||||||
|
|
||||||
// 1. 裁剪模式配置
|
// 裁剪模式配置(自由裁剪/固定比例)
|
||||||
options.setFreeStyleCropEnabled(isFreeCrop);
|
options.setFreeStyleCropEnabled(isFreeCrop); // 开启自由裁剪
|
||||||
|
|
||||||
|
// 裁剪配置(优化体验)
|
||||||
|
//options.setCompressionFormat(android.graphics.Bitmap.CompressFormat.JPEG); // 输出格式
|
||||||
|
//options.setCompressionQuality(100); // 图片质量
|
||||||
|
//options.setHideBottomControls(true); // 隐藏底部控制栏(简化界面)
|
||||||
|
//options.setToolbarTitle("图片裁剪"); // 工具栏标题
|
||||||
|
//options.setToolbarColor(activity.getResources().getColor(R.color.colorPrimary)); // 工具栏颜色(适配项目主题)
|
||||||
|
//options.setStatusBarColor(activity.getResources().getColor(R.color.colorPrimaryDark)); // 状态栏颜色
|
||||||
|
|
||||||
|
|
||||||
// 2. 核心:强制 PNG 保留透明(固定配置,无需判断原图格式)
|
// 2. 核心:强制 PNG 保留透明(固定配置,无需判断原图格式)
|
||||||
options.setCompressionFormat(FORCE_COMPRESS_FORMAT); // 强制 PNG 压缩
|
options.setCompressionFormat(FORCE_COMPRESS_FORMAT); // 强制 PNG 压缩
|
||||||
|
|||||||
@@ -13,135 +13,123 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
style="@style/DefaultAToolbar"/>
|
style="@style/DefaultAToolbar"/>
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
<RelativeLayout
|
<cc.winboll.studio.powerbell.views.BackgroundView
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/background_view">
|
||||||
|
|
||||||
|
</cc.winboll.studio.powerbell.views.BackgroundView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="400dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:text="Origin BG"
|
||||||
|
android:id="@+id/activitybackgroundpictureAButton5"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_margin="5dp"/>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:text="Received BG"
|
||||||
|
android:id="@+id/activitybackgroundpictureAButton4"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_margin="5dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
<cc.winboll.studio.powerbell.views.BackgroundView
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
android:layout_width="50dp"
|
||||||
android:orientation="vertical"
|
android:layout_height="36dp"
|
||||||
android:layout_width="match_parent"
|
android:text="◎"
|
||||||
android:layout_height="match_parent"
|
android:layout_gravity="center_vertical"
|
||||||
android:id="@+id/background_view">
|
android:layout_margin="5dp"
|
||||||
|
android:id="@+id/activitybackgroundpictureAButton1"/>
|
||||||
|
|
||||||
</cc.winboll.studio.powerbell.views.BackgroundView>
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:text="☑"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:id="@+id/activitybackgroundpictureAButton2"/>
|
||||||
|
|
||||||
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:text="♾"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:id="@+id/activitybackgroundpictureAButton9"
|
||||||
|
android:onClick="onNetworkBackgroundDialog"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="400dp">
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
<RelativeLayout
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
android:layout_width="match_parent"
|
android:layout_width="50dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="36dp"
|
||||||
|
android:text="[+]"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:id="@+id/activitybackgroundpictureAButton3"/>
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
android:layout_width="160dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:text="Origin BG"
|
android:text="[+~]"
|
||||||
android:id="@+id/activitybackgroundpictureAButton5"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_margin="5dp"
|
||||||
android:layout_margin="5dp"/>
|
android:id="@+id/activitybackgroundpictureAButton6"/>
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
android:layout_width="160dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
android:text="Received BG"
|
android:text="[◐]"
|
||||||
android:id="@+id/activitybackgroundpictureAButton4"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_margin="5dp"
|
||||||
android:layout_margin="5dp"/>
|
android:id="@+id/activitybackgroundpictureAButton7"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
<cc.winboll.studio.libaes.views.AButton
|
||||||
|
android:layout_width="50dp"
|
||||||
<LinearLayout
|
android:layout_height="36dp"
|
||||||
android:orientation="horizontal"
|
android:text="[○]"
|
||||||
android:layout_width="match_parent"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_height="wrap_content"
|
android:layout_margin="5dp"
|
||||||
android:gravity="right">
|
android:id="@+id/activitybackgroundpictureAButton8"/>
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:text="◎"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/activitybackgroundpictureAButton1"/>
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:text="☑"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/activitybackgroundpictureAButton2"/>
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:text="♾"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/activitybackgroundpictureAButton9"
|
|
||||||
android:onClick="onNetworkBackgroundDialog"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="right">
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:text="[+]"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/activitybackgroundpictureAButton3"/>
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:text="[+~]"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/activitybackgroundpictureAButton6"/>
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:text="[◐]"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/activitybackgroundpictureAButton7"/>
|
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.AButton
|
|
||||||
android:layout_width="50dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:text="[○]"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:id="@+id/activitybackgroundpictureAButton8"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user