From 3f9bbb443f346b619fce6af2d705b1a6a12f11da Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 17 May 2020 10:38:04 +0200 Subject: [PATCH] fixing some offset glitches at the yearly view --- .../calendar/pro/views/SmallMonthView.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/SmallMonthView.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/SmallMonthView.kt index 098c2d3d8..117563411 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/SmallMonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/SmallMonthView.kt @@ -41,9 +41,9 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie init { val attributes = context.theme.obtainStyledAttributes( - attrs, - R.styleable.SmallMonthView, - 0, 0) + attrs, + R.styleable.SmallMonthView, + 0, 0) try { days = attributes.getInt(R.styleable.SmallMonthView_days, 31) @@ -79,11 +79,11 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie for (y in 1..6) { for (x in 1..7) { if (curId in 1..days) { - canvas.drawText(curId.toString(), x * dayWidth, y * dayWidth, getPaint(curId)) + canvas.drawText(curId.toString(), x * dayWidth - (dayWidth / 4), y * dayWidth, getPaint(curId)) if (curId == todaysId) { val dividerConstant = if (isLandscape) 6 else 4 - canvas.drawCircle(x * dayWidth - dayWidth / dividerConstant, y * dayWidth - dayWidth / dividerConstant, dayWidth * 0.41f, todayCirclePaint) + canvas.drawCircle(x * dayWidth - dayWidth / 2, y * dayWidth - dayWidth / dividerConstant, dayWidth * 0.41f, todayCirclePaint) } } curId++