Compare commits
9 Commits
gallery-v1
...
gallery-v1
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d521fefdb | |||
| f7932c134f | |||
| 93c59b0424 | |||
| fe248349df | |||
| 4790238343 | |||
| f144d91bb6 | |||
| 9c0e56462e | |||
| 4d977646e6 | |||
| 2d912abf92 |
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Thu Apr 30 23:01:42 HKT 2026
|
#Fri May 01 09:21:07 HKT 2026
|
||||||
stageCount=11
|
stageCount=14
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.0
|
baseVersion=15.0
|
||||||
publishVersion=15.0.10
|
publishVersion=15.0.13
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.0.11
|
baseBetaVersion=15.0.14
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class CropActivity extends AppCompatActivity {
|
|||||||
private int cropWidth = 240;
|
private int cropWidth = 240;
|
||||||
private int cropHeight = 120;
|
private int cropHeight = 120;
|
||||||
private float cropRatio = 2.0f;
|
private float cropRatio = 2.0f;
|
||||||
|
private Preferences prefs;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -54,7 +55,8 @@ public class CropActivity extends AppCompatActivity {
|
|||||||
cropWidth = getIntent().getIntExtra(EXTRA_CROP_WIDTH, 240);
|
cropWidth = getIntent().getIntExtra(EXTRA_CROP_WIDTH, 240);
|
||||||
cropHeight = getIntent().getIntExtra(EXTRA_CROP_HEIGHT, 120);
|
cropHeight = getIntent().getIntExtra(EXTRA_CROP_HEIGHT, 120);
|
||||||
|
|
||||||
Preferences prefs = new Preferences(this);
|
prefs = new Preferences(this);
|
||||||
|
int bgType = prefs.getBgType();
|
||||||
if (cropWidth > 0 && cropHeight > 0) {
|
if (cropWidth > 0 && cropHeight > 0) {
|
||||||
cropRatio = (float) cropWidth / cropHeight;
|
cropRatio = (float) cropWidth / cropHeight;
|
||||||
} else {
|
} else {
|
||||||
@@ -70,13 +72,12 @@ public class CropActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final ImageView btnColorPick = findViewById(R.id.btn_color_pick);
|
final ImageView btnBg = findViewById(R.id.btn_color_pick);
|
||||||
btnColorPick.setOnClickListener(new View.OnClickListener() {
|
btnBg.setImageResource(R.drawable.ic_bg);
|
||||||
|
btnBg.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
boolean pickMode = !cropCanvasView.isColorPickMode();
|
showBgDialog();
|
||||||
cropCanvasView.setColorPickMode(pickMode);
|
|
||||||
btnColorPick.setAlpha(pickMode ? 0.5f : 1.0f);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -117,39 +118,56 @@ public class CropActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
final View colorView = findViewById(R.id.color_view);
|
final View colorView = findViewById(R.id.color_view);
|
||||||
final GradientDrawable colorDrawable = (GradientDrawable) colorView.getBackground();
|
final GradientDrawable colorDrawable = (GradientDrawable) colorView.getBackground();
|
||||||
|
|
||||||
|
cropCanvasView.setBackgroundType(bgType);
|
||||||
|
updateColorView(colorDrawable, bgType);
|
||||||
|
|
||||||
cropCanvasView.setOnBackgroundColorChangedListener(new CropCanvasView.OnBackgroundColorChangedListener() {
|
cropCanvasView.setOnBackgroundColorChangedListener(new CropCanvasView.OnBackgroundColorChangedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onBackgroundColorChanged(int color) {
|
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();
|
loadImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateColorView(GradientDrawable drawable, int bgType) {
|
||||||
|
switch (bgType) {
|
||||||
|
case 0:
|
||||||
|
drawable.setColor(0xFF808080);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
drawable.setColor(0xFFFFFFFF);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
default:
|
||||||
|
drawable.setColor(0xFF000000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showBgDialog() {
|
||||||
|
final String[] bgNames = {"灰白相间", "全白", "全黑"};
|
||||||
|
final int[] bgDrawables = {R.drawable.bg_checkerboard, R.drawable.bg_white, R.drawable.bg_black};
|
||||||
|
final View colorView = findViewById(R.id.color_view);
|
||||||
|
final GradientDrawable colorDrawable = (GradientDrawable) colorView.getBackground();
|
||||||
|
final int currentBgType = cropCanvasView.getBackgroundType();
|
||||||
|
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle("选择背景")
|
||||||
|
.setSingleChoiceItems(bgNames, currentBgType, new android.content.DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(android.content.DialogInterface dialog, int which) {
|
||||||
|
cropCanvasView.setBackgroundType(which);
|
||||||
|
prefs.setBgType(which);
|
||||||
|
updateColorView(colorDrawable, which);
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("取消", null)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
private void loadImage() {
|
private void loadImage() {
|
||||||
try {
|
try {
|
||||||
if (imagePath != null && new File(imagePath).exists()) {
|
if (imagePath != null && new File(imagePath).exists()) {
|
||||||
@@ -261,7 +279,9 @@ public class CropActivity extends AppCompatActivity {
|
|||||||
info.append("画布宽度: ").append(cropCanvasView.getCanvasWidth()).append("px\n");
|
info.append("画布宽度: ").append(cropCanvasView.getCanvasWidth()).append("px\n");
|
||||||
info.append("画布高度: ").append(cropCanvasView.getCanvasHeight()).append("px\n");
|
info.append("画布高度: ").append(cropCanvasView.getCanvasHeight()).append("px\n");
|
||||||
|
|
||||||
info.append("\n=== 拾取颜色 ===\n");
|
info.append("\n=== 背景类型 ===\n");
|
||||||
|
String[] bgNames = {"灰白相间", "全白", "全黑"};
|
||||||
|
info.append("背景: ").append(bgNames[cropCanvasView.getBackgroundType()]).append("\n");
|
||||||
int bgColor = cropCanvasView.getBackgroundColor();
|
int bgColor = cropCanvasView.getBackgroundColor();
|
||||||
info.append("背景颜色: #").append(String.format("%06X", bgColor & 0xFFFFFF)).append("\n");
|
info.append("背景颜色: #").append(String.format("%06X", bgColor & 0xFFFFFF)).append("\n");
|
||||||
info.append("拾取坐标: ").append(cropCanvasView.getLastPickImageX()).append(",")
|
info.append("拾取坐标: ").append(cropCanvasView.getLastPickImageX()).append(",")
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ package cc.winboll.studio.gallery;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapShader;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.Shader;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -71,6 +74,10 @@ public class CropCanvasView extends View {
|
|||||||
private Bitmap displayBitmap;
|
private Bitmap displayBitmap;
|
||||||
private RectF initialSpanRect;
|
private RectF initialSpanRect;
|
||||||
private float initialSpan;
|
private float initialSpan;
|
||||||
|
private int bgType = 2;
|
||||||
|
private Bitmap tileBitmap;
|
||||||
|
private BitmapShader tileShader;
|
||||||
|
private Paint bgPaint;
|
||||||
private int backgroundColor = Color.BLUE;
|
private int backgroundColor = Color.BLUE;
|
||||||
private boolean colorPickMode = false;
|
private boolean colorPickMode = false;
|
||||||
private int previewColor = 0;
|
private int previewColor = 0;
|
||||||
@@ -111,6 +118,60 @@ public class CropCanvasView extends View {
|
|||||||
cornerPaint = new Paint();
|
cornerPaint = new Paint();
|
||||||
cornerPaint.setColor(Color.WHITE);
|
cornerPaint.setColor(Color.WHITE);
|
||||||
cornerPaint.setStyle(Paint.Style.FILL);
|
cornerPaint.setStyle(Paint.Style.FILL);
|
||||||
|
|
||||||
|
bgType = 2;
|
||||||
|
bgPaint = new Paint();
|
||||||
|
initTileBitmap();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTileBitmap() {
|
||||||
|
if (tileBitmap != null && !tileBitmap.isRecycled()) {
|
||||||
|
tileBitmap.recycle();
|
||||||
|
tileBitmap = null;
|
||||||
|
}
|
||||||
|
tileShader = null;
|
||||||
|
|
||||||
|
if (bgType == 0) {
|
||||||
|
Drawable drawable = getContext().getDrawable(R.drawable.bg_checkerboard);
|
||||||
|
if (drawable != null) {
|
||||||
|
int w = drawable.getIntrinsicWidth();
|
||||||
|
int h = drawable.getIntrinsicHeight();
|
||||||
|
if (w <= 0) w = 10;
|
||||||
|
if (h <= 0) h = 10;
|
||||||
|
tileBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
|
||||||
|
Canvas c = new Canvas(tileBitmap);
|
||||||
|
drawable.setBounds(0, 0, w, h);
|
||||||
|
drawable.draw(c);
|
||||||
|
tileShader = new BitmapShader(tileBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackgroundType(int type) {
|
||||||
|
if (bgType != type) {
|
||||||
|
bgType = type;
|
||||||
|
initTileBitmap();
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBackgroundType() {
|
||||||
|
return bgType;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawBackground(Canvas canvas) {
|
||||||
|
if (bgType == 0 && tileShader != null) {
|
||||||
|
bgPaint.setShader(tileShader);
|
||||||
|
canvas.drawRect(canvasBounds, bgPaint);
|
||||||
|
} else if (bgType == 1) {
|
||||||
|
bgPaint.setShader(null);
|
||||||
|
bgPaint.setColor(Color.WHITE);
|
||||||
|
canvas.drawRect(canvasBounds, bgPaint);
|
||||||
|
} else {
|
||||||
|
bgPaint.setShader(null);
|
||||||
|
bgPaint.setColor(Color.BLACK);
|
||||||
|
canvas.drawRect(canvasBounds, bgPaint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImageBitmap(Bitmap bitmap) {
|
public void setImageBitmap(Bitmap bitmap) {
|
||||||
@@ -175,7 +236,7 @@ public class CropCanvasView extends View {
|
|||||||
}
|
}
|
||||||
Bitmap canvasBmp = Bitmap.createBitmap(canvasWidth, canvasHeight, Bitmap.Config.ARGB_8888);
|
Bitmap canvasBmp = Bitmap.createBitmap(canvasWidth, canvasHeight, Bitmap.Config.ARGB_8888);
|
||||||
Canvas canvas = new Canvas(canvasBmp);
|
Canvas canvas = new Canvas(canvasBmp);
|
||||||
canvas.drawColor(backgroundColor);
|
drawBackground(canvas);
|
||||||
if (displayBitmap != null && !displayBitmap.isRecycled()) {
|
if (displayBitmap != null && !displayBitmap.isRecycled()) {
|
||||||
if (displayBitmap == originalBitmap) {
|
if (displayBitmap == originalBitmap) {
|
||||||
canvas.drawBitmap(displayBitmap, imageBounds.left, imageBounds.top, imagePaint);
|
canvas.drawBitmap(displayBitmap, imageBounds.left, imageBounds.top, imagePaint);
|
||||||
@@ -409,7 +470,7 @@ public class CropCanvasView extends View {
|
|||||||
getDisplayMatrix(matrix);
|
getDisplayMatrix(matrix);
|
||||||
canvas.concat(matrix);
|
canvas.concat(matrix);
|
||||||
|
|
||||||
canvas.drawColor(backgroundColor);
|
drawBackground(canvas);
|
||||||
|
|
||||||
if (displayBitmap == originalBitmap) {
|
if (displayBitmap == originalBitmap) {
|
||||||
canvas.drawBitmap(displayBitmap, imageBounds.left, imageBounds.top, imagePaint);
|
canvas.drawBitmap(displayBitmap, imageBounds.left, imageBounds.top, imagePaint);
|
||||||
@@ -523,7 +584,7 @@ public class CropCanvasView extends View {
|
|||||||
if (imageBounds.contains(imgX, imgY)) {
|
if (imageBounds.contains(imgX, imgY)) {
|
||||||
previewColor = getImageColorAt(x, y);
|
previewColor = getImageColorAt(x, y);
|
||||||
} else if (canvasBounds.contains(x, y)) {
|
} else if (canvasBounds.contains(x, y)) {
|
||||||
previewColor = backgroundColor;
|
previewColor = (bgType == 1) ? Color.WHITE : Color.BLACK;
|
||||||
} else {
|
} else {
|
||||||
previewColor = Color.TRANSPARENT;
|
previewColor = Color.TRANSPARENT;
|
||||||
}
|
}
|
||||||
@@ -545,7 +606,7 @@ public class CropCanvasView extends View {
|
|||||||
pickedColor = colorAtPoint;
|
pickedColor = colorAtPoint;
|
||||||
backgroundColor = colorAtPoint;
|
backgroundColor = colorAtPoint;
|
||||||
} else {
|
} else {
|
||||||
pickedColor = backgroundColor;
|
pickedColor = (bgType == 1) ? Color.WHITE : Color.BLACK;
|
||||||
}
|
}
|
||||||
if (colorPickedListener != null) {
|
if (colorPickedListener != null) {
|
||||||
colorPickedListener.onColorPicked(pickedColor);
|
colorPickedListener.onColorPicked(pickedColor);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import android.view.View;
|
|||||||
import android.view.View.OnTouchListener;
|
import android.view.View.OnTouchListener;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.Toast;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -34,6 +35,7 @@ public class ImageViewerActivity extends Activity implements ViewPager.OnPageCha
|
|||||||
private ImageButton btnShare;
|
private ImageButton btnShare;
|
||||||
private ImageButton btnInfo;
|
private ImageButton btnInfo;
|
||||||
private ImageButton btnBg;
|
private ImageButton btnBg;
|
||||||
|
private ImageButton btnGallery;
|
||||||
private int bgType = 0;
|
private int bgType = 0;
|
||||||
private GestureDetector gestureDetector;
|
private GestureDetector gestureDetector;
|
||||||
private TrashManager trashManager;
|
private TrashManager trashManager;
|
||||||
@@ -63,6 +65,8 @@ public class ImageViewerActivity extends Activity implements ViewPager.OnPageCha
|
|||||||
btnInfo = findViewById(R.id.btn_info);
|
btnInfo = findViewById(R.id.btn_info);
|
||||||
btnBg = findViewById(R.id.btn_bg);
|
btnBg = findViewById(R.id.btn_bg);
|
||||||
|
|
||||||
|
btnGallery = findViewById(R.id.btn_gallery);
|
||||||
|
|
||||||
applyBg();
|
applyBg();
|
||||||
|
|
||||||
ImagePagerAdapter adapter = new ImagePagerAdapter(imageUrls, bgType);
|
ImagePagerAdapter adapter = new ImagePagerAdapter(imageUrls, bgType);
|
||||||
@@ -119,6 +123,20 @@ public class ImageViewerActivity extends Activity implements ViewPager.OnPageCha
|
|||||||
switchBg();
|
switchBg();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
btnGallery.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Toast.makeText(ImageViewerActivity.this, "Gallery", Toast.LENGTH_SHORT).show();
|
||||||
|
if (imageUrls != null && currentPosition >= 0 && currentPosition < imageUrls.size()) {
|
||||||
|
Uri imageUri = imageUrls.get(currentPosition);
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.setDataAndType(imageUri, "image/*");
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
startActivity(Intent.createChooser(intent, "打开相册"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleToolbar() {
|
private void toggleToolbar() {
|
||||||
|
|||||||
@@ -289,31 +289,12 @@ private void loadAlbums() {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
if (id == R.id.action_gallery) {
|
if (id == R.id.action_mi_gallery) {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
Toast.makeText(this, "Gallery clicked", Toast.LENGTH_SHORT).show();
|
||||||
|
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||||
|
intent.addCategory(Intent.CATEGORY_APP_GALLERY);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
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) {
|
} else if (id == R.id.action_settings) {
|
||||||
startActivity(new Intent(this, SettingsActivity.class));
|
startActivity(new Intent(this, SettingsActivity.class));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
android:fillColor="#000000"
|
android:fillColor="#FFFFFF"
|
||||||
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"/>
|
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
|
<path
|
||||||
android:fillColor="#000000"
|
android:fillColor="#FFFFFF"
|
||||||
android:pathData="M9,12l2,2l4,-4l1.5,1.5L11,17l-3,-3z"/>
|
android:pathData="M9,12l2,2l4,-4l1.5,1.5L11,17l-3,-3z"/>
|
||||||
</vector>
|
</vector>
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?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>
|
|
||||||
16
gallery/src/main/res/drawable/ic_mi_gallery.xml
Normal file
16
gallery/src/main/res/drawable/ic_mi_gallery.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?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="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8s-3.59,8 -8,8z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:pathData="M12,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5s5,-2.24 5,-5s-2.24,-5 -5,-5zM12,15c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3s3,1.34 3,3s-1.34,3 -3,3z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:pathData="M8,12l1.5,-2l2,2.5l2.5,-3l2,2.5"/>
|
||||||
|
</vector>
|
||||||
11
gallery/src/main/res/drawable/ic_view_gallery_outline.xml
Normal file
11
gallery/src/main/res/drawable/ic_view_gallery_outline.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:viewportWidth="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFF"
|
||||||
|
android:pathData="M1,3V21H23V3H1M21,5V14H3V5H21M11,16V19H8V16H11M3,16H6V19H3V16M13,19V16H16V19H13M18,19V16H21V19H18Z"/>
|
||||||
|
|
||||||
|
</vector>
|
||||||
@@ -36,6 +36,14 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"/>
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/btn_gallery"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
|
android:src="@drawable/ic_view_gallery_outline"
|
||||||
|
android:contentDescription="Gallery"/>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/btn_share"
|
android:id="@+id/btn_share"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
|
|||||||
@@ -3,15 +3,9 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_gallery"
|
android:id="@+id/action_mi_gallery"
|
||||||
android:title="@string/system_gallery"
|
android:title="@string/mi_gallery"
|
||||||
android:icon="@drawable/ic_cover"
|
android:icon="@drawable/ic_mi_gallery"
|
||||||
app:showAsAction="ifRoom"/>
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_reset_gallery"
|
|
||||||
android:title="@string/reset_gallery"
|
|
||||||
android:icon="@drawable/ic_cover_reset"
|
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="ifRoom"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
|||||||
@@ -19,5 +19,6 @@
|
|||||||
<string name="debug_log">Debug Log</string>
|
<string name="debug_log">Debug Log</string>
|
||||||
<string name="debug_message">Debug log message</string>
|
<string name="debug_message">Debug log message</string>
|
||||||
<string name="system_gallery">系统相册</string>
|
<string name="system_gallery">系统相册</string>
|
||||||
|
<string name="mi_gallery">小米相册</string>
|
||||||
<string name="reset_gallery">重置</string>
|
<string name="reset_gallery">重置</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user