From 7a8d92cb95b890ca70c9654806743ec8cd01a9a2 Mon Sep 17 00:00:00 2001 From: kenkeiras Date: Thu, 25 Jan 2018 23:43:23 +0100 Subject: [PATCH] Add little logo to the ticker. --- .../minicards/parts/logic/Ticker.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java b/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java index 7718fe6..e620cff 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java @@ -122,6 +122,24 @@ public class Ticker implements Part { new Rect(_left, _top, _right, _bottom), paint); + + + // Craw a little clock + Paint clockPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + clockPaint.setStyle(Paint.Style.STROKE); + clockPaint.setColor(Color.YELLOW); + clockPaint.setStrokeWidth(2f); + + int halfX = (_left + _right) / 2; + int halfY = (_top + _bottom) / 2; + int radius = (_bottom - _top) / 2; + + canvas.drawCircle(halfX, halfY, + radius * .8f, clockPaint); + + canvas.drawLine(halfX, halfY - radius * 0.2f, + halfX, halfY - radius * 0.8f, + clockPaint); } }