diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-31 13:16:44 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:02 +0200 |
commit | d7716c9927d676dc3a94c41c5df3b878ed605e70 (patch) | |
tree | c34c9a9414404d0231dccaa83499dcd6e732fd17 /android | |
parent | 812970c785021f36a57a49d4590053d25247d298 (diff) |
android: enable AA for selections and handles, tune colors & alpha
Change-Id: Ieea5b084ce1b9550d202bff795d89929632cb724
Diffstat (limited to 'android')
2 files changed, 24 insertions, 8 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java index 49bec5603cc9..3fa46192846e 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelection.java @@ -24,7 +24,8 @@ import static org.libreoffice.canvas.GraphicSelectionHandle.HandlePosition; * rectangle. */ public class GraphicSelection implements CanvasElement { - private final Paint mPaint; + private final Paint mPaintStroke; + private final Paint mPaintFill; public RectF mRectangle = new RectF(); public RectF mScaledRectangle = new RectF(); private RectF mDrawRectangle = new RectF(); @@ -39,10 +40,17 @@ public class GraphicSelection implements CanvasElement { */ public GraphicSelection() { // Create the paint, which is needed at drawing - mPaint = new Paint(); - mPaint.setStyle(Paint.Style.STROKE); - mPaint.setColor(Color.BLACK); - mPaint.setStrokeWidth(2); + mPaintStroke = new Paint(); + mPaintStroke.setStyle(Paint.Style.STROKE); + mPaintStroke.setColor(Color.GRAY); + mPaintStroke.setStrokeWidth(2); + mPaintStroke.setAntiAlias(true); + + mPaintFill = new Paint(); + mPaintFill.setStyle(Paint.Style.FILL); + mPaintFill.setColor(Color.WHITE); + mPaintFill.setAlpha(200); + mPaintFill.setAntiAlias(true); // Create the handles of the selection mHandles[0] = new GraphicSelectionHandle(HandlePosition.TOP_LEFT); @@ -95,7 +103,10 @@ public class GraphicSelection implements CanvasElement { */ @Override public void draw(Canvas canvas) { - canvas.drawRect(mDrawRectangle, mPaint); + canvas.drawRect(mDrawRectangle, mPaintStroke); + if (mType != DragType.NONE) { + canvas.drawRect(mDrawRectangle, mPaintFill); + } for (GraphicSelectionHandle handle : mHandles) { handle.draw(canvas); } diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java index 52b662e4b80d..13487f65de87 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/canvas/GraphicSelectionHandle.java @@ -42,14 +42,19 @@ public class GraphicSelectionHandle implements CanvasElement { mHandlePosition = position; mStrokePaint.setStyle(Paint.Style.STROKE); - mStrokePaint.setColor(Color.BLACK); + mStrokePaint.setColor(Color.GRAY); mStrokePaint.setStrokeWidth(3); + mStrokePaint.setAntiAlias(true); mFillPaint.setStyle(Paint.Style.FILL); mFillPaint.setColor(Color.WHITE); + mFillPaint.setAlpha(200); + mFillPaint.setAntiAlias(true); mSelectedFillPaint.setStyle(Paint.Style.FILL); - mSelectedFillPaint.setColor(Color.BLUE); + mSelectedFillPaint.setColor(Color.GRAY); + mSelectedFillPaint.setAlpha(200); + mSelectedFillPaint.setAntiAlias(true); } /** |