Compare commits
15 Commits
gallery-v1
...
gallery-v1
| Author | SHA1 | Date | |
|---|---|---|---|
| f764de4077 | |||
| 0788a52652 | |||
| ffea383a4e | |||
| 9c1e08a88b | |||
| abb28b766a | |||
| b6cd91c298 | |||
| 61c2bab83e | |||
| 5a700a0808 | |||
| dad179c15f | |||
| 1b62ff288f | |||
| 87ad6668a4 | |||
| 139083c22f | |||
| c49e68d7f1 | |||
| b035d461aa | |||
| 474ddcbb3b |
@@ -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'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Apr 28 10:57:44 HKT 2026
|
||||
stageCount=8
|
||||
#Thu Apr 30 23:01:42 HKT 2026
|
||||
stageCount=11
|
||||
libraryProject=
|
||||
baseVersion=15.0
|
||||
publishVersion=15.0.7
|
||||
publishVersion=15.0.10
|
||||
buildCount=0
|
||||
baseBetaVersion=15.0.8
|
||||
baseBetaVersion=15.0.11
|
||||
|
||||
@@ -130,7 +130,7 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
|
||||
private void showContextMenu(View view, final Album album) {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(view.getContext());
|
||||
builder.setTitle(album.getName());
|
||||
boolean isPinned = pinnedDbHelper != null && pinnedDbHelper.isPinned(album.getPath());
|
||||
final boolean isPinned = pinnedDbHelper != null && pinnedDbHelper.isPinned(album.getPath());
|
||||
String[] items = isPinned ? new String[]{"取消置顶"} : new String[]{"置顶"};
|
||||
builder.setItems(items, new android.content.DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
@@ -252,4 +252,4 @@ private void showContextMenu(View view, final Album album) {
|
||||
imageCount = itemView.findViewById(R.id.image_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,15 +3,24 @@ 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;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.RectF;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import java.io.File;
|
||||
@@ -78,6 +87,13 @@ public class CropActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.btn_info).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showCropInfoDialog();
|
||||
}
|
||||
});
|
||||
|
||||
zoomContainer = findViewById(R.id.zoom_container);
|
||||
|
||||
SeekBar seekBarZoom = findViewById(R.id.seekbar_zoom);
|
||||
@@ -98,6 +114,39 @@ 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) {
|
||||
colorDrawable.setColor(color);
|
||||
}
|
||||
});
|
||||
|
||||
cropCanvasView.setOnColorPickedListener(new CropCanvasView.OnColorPickedListener() {
|
||||
@Override
|
||||
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 + ")",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
cropCanvasView.setOnColorPickEndListener(new CropCanvasView.OnColorPickEndListener() {
|
||||
@Override
|
||||
public void onColorPickEnd() {
|
||||
cropCanvasView.setColorPickMode(false);
|
||||
btnColorPick.setAlpha(1.0f);
|
||||
}
|
||||
});
|
||||
|
||||
colorDrawable.setColor(cropCanvasView.getBackgroundColor());
|
||||
|
||||
loadImage();
|
||||
}
|
||||
|
||||
@@ -206,6 +255,67 @@ public class CropActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void showCropInfoDialog() {
|
||||
StringBuilder info = new StringBuilder();
|
||||
info.append("=== 画布信息 ===\n");
|
||||
info.append("画布宽度: ").append(cropCanvasView.getCanvasWidth()).append("px\n");
|
||||
info.append("画布高度: ").append(cropCanvasView.getCanvasHeight()).append("px\n");
|
||||
|
||||
info.append("\n=== 拾取颜色 ===\n");
|
||||
int bgColor = cropCanvasView.getBackgroundColor();
|
||||
info.append("背景颜色: #").append(String.format("%06X", bgColor & 0xFFFFFF)).append("\n");
|
||||
info.append("拾取坐标: ").append(cropCanvasView.getLastPickImageX()).append(",")
|
||||
.append(cropCanvasView.getLastPickImageY()).append("\n");
|
||||
|
||||
info.append("\n=== 裁剪结果 ===\n");
|
||||
RectF cropRect = cropCanvasView.getCropRect();
|
||||
if (cropRect != null) {
|
||||
info.append("裁剪区域: ").append((int)cropRect.left).append(",")
|
||||
.append((int)cropRect.top).append(",")
|
||||
.append((int)cropRect.right).append(",")
|
||||
.append((int)cropRect.bottom).append("\n");
|
||||
info.append("裁剪宽度: ").append((int)cropRect.width()).append("px\n");
|
||||
info.append("裁剪高度: ").append((int)cropRect.height()).append("px\n");
|
||||
}
|
||||
|
||||
Bitmap canvasBitmap = cropCanvasView.getCanvasBitmap();
|
||||
final Bitmap[] previewHolder = new Bitmap[1];
|
||||
if (canvasBitmap != null && !canvasBitmap.isRecycled() && cropRect != null) {
|
||||
int bmpX = Math.max(0, (int) cropRect.left);
|
||||
int bmpY = Math.max(0, (int) cropRect.top);
|
||||
int bmpW = Math.min((int) cropRect.width(), canvasBitmap.getWidth() - bmpX);
|
||||
int bmpH = Math.min((int) cropRect.height(), canvasBitmap.getHeight() - bmpY);
|
||||
if (bmpW > 0 && bmpH > 0) {
|
||||
previewHolder[0] = Bitmap.createBitmap(canvasBitmap, bmpX, bmpY, bmpW, bmpH);
|
||||
}
|
||||
}
|
||||
|
||||
final Bitmap previewBitmap = previewHolder[0];
|
||||
|
||||
View dialogView = getLayoutInflater().inflate(R.layout.dialog_crop_info, null);
|
||||
TextView infoText = dialogView.findViewById(R.id.info_text);
|
||||
ImageView previewImage = dialogView.findViewById(R.id.preview_image);
|
||||
infoText.setText(info.toString());
|
||||
if (previewBitmap != null) {
|
||||
previewImage.setImageBitmap(previewBitmap);
|
||||
}
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle("裁剪信息")
|
||||
.setView(dialogView)
|
||||
.setPositiveButton("确定", null)
|
||||
.create();
|
||||
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
if (previewBitmap != null && !previewBitmap.isRecycled()) {
|
||||
previewBitmap.recycle();
|
||||
}
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -12,6 +12,33 @@ import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
public class CropCanvasView extends View {
|
||||
public interface OnBackgroundColorChangedListener {
|
||||
void onBackgroundColorChanged(int color);
|
||||
}
|
||||
|
||||
public interface OnColorPickedListener {
|
||||
void onColorPicked(int color);
|
||||
}
|
||||
|
||||
public interface OnColorPickEndListener {
|
||||
void onColorPickEnd();
|
||||
}
|
||||
|
||||
private OnBackgroundColorChangedListener backgroundColorChangedListener;
|
||||
private OnColorPickedListener colorPickedListener;
|
||||
private OnColorPickEndListener colorPickEndListener;
|
||||
|
||||
public void setOnBackgroundColorChangedListener(OnBackgroundColorChangedListener listener) {
|
||||
this.backgroundColorChangedListener = listener;
|
||||
}
|
||||
|
||||
public void setOnColorPickedListener(OnColorPickedListener listener) {
|
||||
this.colorPickedListener = listener;
|
||||
}
|
||||
|
||||
public void setOnColorPickEndListener(OnColorPickEndListener listener) {
|
||||
this.colorPickEndListener = listener;
|
||||
}
|
||||
private Paint imagePaint;
|
||||
private Paint borderPaint;
|
||||
private Paint cornerPaint;
|
||||
@@ -39,11 +66,16 @@ public class CropCanvasView extends View {
|
||||
private RectF imageBounds = new RectF();
|
||||
private RectF canvasBounds = new RectF();
|
||||
private Bitmap originalBitmap;
|
||||
private Bitmap canvasBitmap;
|
||||
private float bitmapScale = 1.0f;
|
||||
private Bitmap displayBitmap;
|
||||
private RectF initialSpanRect;
|
||||
private float initialSpan;
|
||||
private int backgroundColor = Color.BLUE;
|
||||
private boolean colorPickMode = false;
|
||||
private int previewColor = 0;
|
||||
private float lastPickX = 0;
|
||||
private float lastPickY = 0;
|
||||
private float pickX, pickY;
|
||||
|
||||
private float displayScale = 1.0f;
|
||||
@@ -239,6 +271,9 @@ public class CropCanvasView extends View {
|
||||
|
||||
public void setBackgroundColor(int color) {
|
||||
this.backgroundColor = color;
|
||||
if (backgroundColorChangedListener != null) {
|
||||
backgroundColorChangedListener.onBackgroundColorChanged(color);
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@@ -246,6 +281,40 @@ public class CropCanvasView extends View {
|
||||
return backgroundColor;
|
||||
}
|
||||
|
||||
public int getPreviewColor() {
|
||||
return previewColor;
|
||||
}
|
||||
|
||||
public float getLastPickX() {
|
||||
return lastPickX;
|
||||
}
|
||||
|
||||
public float getLastPickY() {
|
||||
return lastPickY;
|
||||
}
|
||||
|
||||
public int getLastPickImageX() {
|
||||
if (originalBitmap == null || originalBitmap.isRecycled()) {
|
||||
return 0;
|
||||
}
|
||||
float imgX = screenToImageX(lastPickX);
|
||||
float imgY = screenToImageY(lastPickY);
|
||||
int bmpX = (int) ((imgX - imageBounds.left) * displayBitmapScale);
|
||||
int bmpY = (int) ((imgY - imageBounds.top) * displayBitmapScale);
|
||||
return Math.max(0, Math.min(bmpX, originalBitmap.getWidth() - 1));
|
||||
}
|
||||
|
||||
public int getLastPickImageY() {
|
||||
if (originalBitmap == null || originalBitmap.isRecycled()) {
|
||||
return 0;
|
||||
}
|
||||
float imgX = screenToImageX(lastPickX);
|
||||
float imgY = screenToImageY(lastPickY);
|
||||
int bmpX = (int) ((imgX - imageBounds.left) * displayBitmapScale);
|
||||
int bmpY = (int) ((imgY - imageBounds.top) * displayBitmapScale);
|
||||
return Math.max(0, Math.min(bmpY, originalBitmap.getHeight() - 1));
|
||||
}
|
||||
|
||||
public void setColorPickMode(boolean enable) {
|
||||
this.colorPickMode = enable;
|
||||
if (enable) {
|
||||
@@ -447,11 +516,46 @@ public class CropCanvasView extends View {
|
||||
}
|
||||
|
||||
if (colorPickMode) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
pickX = x;
|
||||
pickY = y;
|
||||
int color = getColorAt(x, y);
|
||||
setBackgroundColor(color);
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
if (originalBitmap != null && !originalBitmap.isRecycled()) {
|
||||
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) {
|
||||
backgroundColorChangedListener.onBackgroundColorChanged(previewColor);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
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(pickedColor);
|
||||
}
|
||||
}
|
||||
if (colorPickEndListener != null) {
|
||||
colorPickEndListener.onColorPickEnd();
|
||||
}
|
||||
previewColor = 0;
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -118,7 +118,7 @@ public class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ViewHolder>
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void showContextMenu(View view, final int position) {
|
||||
private void showContextMenu(final View view, final int position) {
|
||||
final String imagePath = imagePaths.get(position);
|
||||
final Uri imageUri = imageUrls.get(position);
|
||||
final boolean[] isPinned = {pinnedDbHelper != null && pinnedDbHelper.isPinned(imagePath)};
|
||||
@@ -244,4 +244,4 @@ public class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ViewHolder>
|
||||
coverIcon = itemView.findViewById(R.id.cover_icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +289,32 @@ private void loadAlbums() {
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.action_settings) {
|
||||
if (id == R.id.action_gallery) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else if (id == R.id.action_reset_gallery) {
|
||||
// 清除 图库/ACTION_VIEW 图片 Uri 的默认打开记录
|
||||
PackageManager pm = getPackageManager();
|
||||
|
||||
// 构建和你跳转一模一样的 Intent
|
||||
Intent clearIntent = new Intent(Intent.ACTION_VIEW, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
|
||||
try {
|
||||
// 仅在 API <= 30 时执行重置操作
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
|
||||
String mimeType = clearIntent.resolveType(getContentResolver());
|
||||
pm.clearPackagePreferredActivities(mimeType);
|
||||
Toast.makeText(this, "已清除默认打开方式", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
// API > 30 时,弹出提示说明适配限制
|
||||
Toast.makeText(this, "应用开发资源有限,本应用适配目标安卓版本为 (" + Build.VERSION_CODES.R + ")。", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} catch (SecurityException e) {
|
||||
Toast.makeText(this, "需要授予重置默认应用权限,请在系统设置中开启", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return true;
|
||||
} else if (id == R.id.action_settings) {
|
||||
startActivity(new Intent(this, SettingsActivity.class));
|
||||
return true;
|
||||
} else if (id == R.id.action_about) {
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package cc.winboll.studio.gallery.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import cc.winboll.studio.gallery.R;
|
||||
|
||||
/**
|
||||
* 颜色表对话框
|
||||
* 继承于普通对话框类,使用视图文件
|
||||
*/
|
||||
public class ColorPaletteDialog extends Dialog {
|
||||
|
||||
public ColorPaletteDialog(@NonNull Context context) {
|
||||
super(context, R.style.ColorPaletteDialog);
|
||||
}
|
||||
|
||||
public ColorPaletteDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_color_palette);
|
||||
|
||||
TextView titleText = findViewById(R.id.title_text);
|
||||
|
||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
getWindow().setAttributes(params);
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
|
||||
}
|
||||
|
||||
public interface OnColorItemClick {
|
||||
void onColorClick(int color);
|
||||
}
|
||||
}
|
||||
7
gallery/src/main/res/drawable/bg_color_circle.xml
Normal file
7
gallery/src/main/res/drawable/bg_color_circle.xml
Normal file
@@ -0,0 +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/transparent"/>
|
||||
<stroke android:width="2dp" android:color="@android:color/white"/>
|
||||
<size android:width="32dp" android:height="32dp"/>
|
||||
</shape>
|
||||
6
gallery/src/main/res/drawable/bg_color_circle_border.xml
Normal file
6
gallery/src/main/res/drawable/bg_color_circle_border.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<stroke android:width="2dp" android:color="@android:color/white"/>
|
||||
<size android:width="36dp" android:height="36dp"/>
|
||||
</shape>
|
||||
6
gallery/src/main/res/drawable/bg_dialog.xml
Normal file
6
gallery/src/main/res/drawable/bg_dialog.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@android:color/black"/>
|
||||
<stroke android:width="2dp" android:color="@android:color/white"/>
|
||||
</shape>
|
||||
21
gallery/src/main/res/drawable/ic_cover_reset.xml
Normal file
21
gallery/src/main/res/drawable/ic_cover_reset.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<!-- 底层:黑色方框+对勾 -->
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M21,3H3C1.9,3 1,3.9 1,5v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2V5C23,3.9 22.1,3 21,3zM21,19H3V5h18V19z"/>
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M9,12l2,2l4,-4l1.5,1.5L11,17l-3,-3z"/>
|
||||
|
||||
<!-- 上层 纯白色逆时针箭头 -->
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12.63,2C18.16,2 22.64,6.5 22.64,12C22.64,17.5 18.16,22 12.63,22C9.12,22 6.05,20.18 4.26,17.43L5.84,16.18C7.25,18.47 9.76,20 12.64,20A8,8 0,0 0,20.64 12A8,8 0,0 0,12.64 4C8.56,4 5.2,7.06 4.71,11H7.47L3.73,14.73L0,11H2.69C3.19,5.95 7.45,2 12.63,2"/>
|
||||
|
||||
</vector>
|
||||
@@ -15,17 +15,45 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_close"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ic_close"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview_window_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="封面剪裁"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="18sp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:layout_marginEnd="8dp"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/color_icon_container"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<View
|
||||
android:id="@+id/color_view"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bg_color_circle"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_color_pick"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ic_color_pick"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"/>
|
||||
|
||||
@@ -34,11 +62,19 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_info"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ic_info"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_done"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:padding="12dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ic_done"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"/>
|
||||
|
||||
|
||||
16
gallery/src/main/res/layout/dialog_color_palette.xml
Normal file
16
gallery/src/main/res/layout/dialog_color_palette.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</FrameLayout>
|
||||
26
gallery/src/main/res/layout/dialog_crop_info.xml
Normal file
26
gallery/src/main/res/layout/dialog_crop_info.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:background="@drawable/bg_dialog">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="monospace"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/preview_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:background="@android:color/black"/>
|
||||
|
||||
</LinearLayout>
|
||||
20
gallery/src/main/res/layout/item_color_icon.xml
Normal file
20
gallery/src/main/res/layout/item_color_icon.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/color_view"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
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>
|
||||
@@ -2,6 +2,18 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_gallery"
|
||||
android:title="@string/system_gallery"
|
||||
android:icon="@drawable/ic_cover"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_reset_gallery"
|
||||
android:title="@string/reset_gallery"
|
||||
android:icon="@drawable/ic_cover_reset"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_trash"
|
||||
android:title="@string/trash"
|
||||
|
||||
@@ -18,4 +18,6 @@
|
||||
<string name="no">No</string>
|
||||
<string name="debug_log">Debug Log</string>
|
||||
<string name="debug_message">Debug log message</string>
|
||||
<string name="system_gallery">系统相册</string>
|
||||
<string name="reset_gallery">重置</string>
|
||||
</resources>
|
||||
|
||||
@@ -8,4 +8,9 @@
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="ColorPaletteDialog" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user