Merge "Merge "Sharesheet - Add outline to image preview" into qt-dev am: 343b96786b" into qt-dev-plus-aosp

This commit is contained in:
Android Build Merger (Role)
2019-04-10 02:04:58 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 4 deletions

View File

@@ -3055,6 +3055,7 @@ public class ChooserActivity extends ResolverActivity {
private int mRadius = 0; private int mRadius = 0;
private Path mPath = new Path(); private Path mPath = new Path();
private Paint mOverlayPaint = new Paint(0); private Paint mOverlayPaint = new Paint(0);
private Paint mRoundRectPaint = new Paint(0);
private Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); private Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private String mExtraImageCount = null; private String mExtraImageCount = null;
@@ -3078,6 +3079,11 @@ public class ChooserActivity extends ResolverActivity {
mOverlayPaint.setColor(0x99000000); mOverlayPaint.setColor(0x99000000);
mOverlayPaint.setStyle(Paint.Style.FILL); mOverlayPaint.setStyle(Paint.Style.FILL);
mRoundRectPaint.setColor(context.getResources().getColor(R.color.chooser_row_divider));
mRoundRectPaint.setStyle(Paint.Style.STROKE);
mRoundRectPaint.setStrokeWidth(context.getResources()
.getDimensionPixelSize(R.dimen.chooser_preview_image_border));
mTextPaint.setColor(Color.WHITE); mTextPaint.setColor(Color.WHITE);
mTextPaint.setTextSize(context.getResources() mTextPaint.setTextSize(context.getResources()
.getDimensionPixelSize(R.dimen.chooser_preview_image_font_size)); .getDimensionPixelSize(R.dimen.chooser_preview_image_font_size));
@@ -3087,8 +3093,8 @@ public class ChooserActivity extends ResolverActivity {
private void updatePath(int width, int height) { private void updatePath(int width, int height) {
mPath.reset(); mPath.reset();
int imageWidth = width - getPaddingRight(); int imageWidth = width - getPaddingRight() - getPaddingLeft();
int imageHeight = height - getPaddingBottom(); int imageHeight = height - getPaddingBottom() - getPaddingTop();
mPath.addRoundRect(getPaddingLeft(), getPaddingTop(), imageWidth, imageHeight, mRadius, mPath.addRoundRect(getPaddingLeft(), getPaddingTop(), imageWidth, imageHeight, mRadius,
mRadius, Path.Direction.CW); mRadius, Path.Direction.CW);
} }
@@ -3120,7 +3126,6 @@ public class ChooserActivity extends ResolverActivity {
updatePath(width, height); updatePath(width, height);
} }
@Override @Override
protected void onDraw(Canvas canvas) { protected void onDraw(Canvas canvas) {
if (mRadius != 0) { if (mRadius != 0) {
@@ -3129,8 +3134,12 @@ public class ChooserActivity extends ResolverActivity {
super.onDraw(canvas); super.onDraw(canvas);
int x = getPaddingLeft();
int y = getPaddingRight();
int width = getWidth() - getPaddingRight() - getPaddingLeft();
int height = getHeight() - getPaddingBottom() - getPaddingTop();
if (mExtraImageCount != null) { if (mExtraImageCount != null) {
canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), mOverlayPaint); canvas.drawRect(x, y, width, height, mOverlayPaint);
int xPos = canvas.getWidth() / 2; int xPos = canvas.getWidth() / 2;
int yPos = (int) ((canvas.getHeight() / 2.0f) int yPos = (int) ((canvas.getHeight() / 2.0f)
@@ -3138,6 +3147,8 @@ public class ChooserActivity extends ResolverActivity {
canvas.drawText(mExtraImageCount, xPos, yPos, mTextPaint); canvas.drawText(mExtraImageCount, xPos, yPos, mTextPaint);
} }
canvas.drawRoundRect(x, y, width, height, mRadius, mRadius, mRoundRectPaint);
} }
} }
} }

View File

@@ -724,6 +724,7 @@
<dimen name="chooser_edge_margin_thin">16dp</dimen> <dimen name="chooser_edge_margin_thin">16dp</dimen>
<dimen name="chooser_edge_margin_normal">24dp</dimen> <dimen name="chooser_edge_margin_normal">24dp</dimen>
<dimen name="chooser_preview_image_font_size">20sp</dimen> <dimen name="chooser_preview_image_font_size">20sp</dimen>
<dimen name="chooser_preview_image_border">1dp</dimen>
<dimen name="chooser_preview_width">-1px</dimen> <dimen name="chooser_preview_width">-1px</dimen>
<dimen name="resolver_icon_size">42dp</dimen> <dimen name="resolver_icon_size">42dp</dimen>
<dimen name="resolver_badge_size">18dp</dimen> <dimen name="resolver_badge_size">18dp</dimen>

View File

@@ -2777,6 +2777,7 @@
<java-symbol type="dimen" name="chooser_edge_margin_normal" /> <java-symbol type="dimen" name="chooser_edge_margin_normal" />
<java-symbol type="dimen" name="chooser_preview_image_font_size"/> <java-symbol type="dimen" name="chooser_preview_image_font_size"/>
<java-symbol type="dimen" name="chooser_preview_width" /> <java-symbol type="dimen" name="chooser_preview_width" />
<java-symbol type="dimen" name="chooser_preview_image_border"/>
<java-symbol type="dimen" name="chooser_max_collapsed_height" /> <java-symbol type="dimen" name="chooser_max_collapsed_height" />
<java-symbol type="layout" name="chooser_grid" /> <java-symbol type="layout" name="chooser_grid" />
<java-symbol type="layout" name="chooser_grid_preview_text" /> <java-symbol type="layout" name="chooser_grid_preview_text" />
@@ -2790,6 +2791,7 @@
<java-symbol type="drawable" name="scroll_indicator_material" /> <java-symbol type="drawable" name="scroll_indicator_material" />
<java-symbol type="layout" name="chooser_row" /> <java-symbol type="layout" name="chooser_row" />
<java-symbol type="color" name="chooser_row_divider" />
<java-symbol type="layout" name="chooser_row_direct_share" /> <java-symbol type="layout" name="chooser_row_direct_share" />
<java-symbol type="bool" name="config_supportDoubleTapWake" /> <java-symbol type="bool" name="config_supportDoubleTapWake" />
<java-symbol type="drawable" name="ic_perm_device_info" /> <java-symbol type="drawable" name="ic_perm_device_info" />