From 75c9d978471b3398a6477cd54beb8e1c5cb737d1 Mon Sep 17 00:00:00 2001 From: Agnieszka C <85929121+Aga-C@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:54:24 +0200 Subject: [PATCH] Added margins to week numbers in month views (#265) --- app/src/main/kotlin/org/fossify/calendar/views/MonthView.kt | 2 +- app/src/main/res/layout-land/fragment_month_day.xml | 1 + app/src/main/res/layout/fragment_month.xml | 1 + app/src/main/res/layout/fragment_month_day.xml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/fossify/calendar/views/MonthView.kt b/app/src/main/kotlin/org/fossify/calendar/views/MonthView.kt index caee570c8..9d4e4df80 100644 --- a/app/src/main/kotlin/org/fossify/calendar/views/MonthView.kt +++ b/app/src/main/kotlin/org/fossify/calendar/views/MonthView.kt @@ -306,7 +306,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con val weekOfYear = days.getOrNull(i * 7 + 3)?.weekOfYear ?: 1 val id = "$weekOfYear:" val yPos = i * dayHeight + weekDaysLetterHeight - canvas.drawText(id, horizontalOffset.toFloat() * 0.9f, yPos + textPaint.textSize, weekNumberPaint) + canvas.drawText(id, horizontalOffset.toFloat(), yPos + textPaint.textSize, weekNumberPaint) } } diff --git a/app/src/main/res/layout-land/fragment_month_day.xml b/app/src/main/res/layout-land/fragment_month_day.xml index 503e45926..f600e5372 100644 --- a/app/src/main/res/layout-land/fragment_month_day.xml +++ b/app/src/main/res/layout-land/fragment_month_day.xml @@ -11,6 +11,7 @@ android:id="@+id/month_day_view_wrapper" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/smaller_margin" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/month_day_list_holder" app:layout_constraintWidth_percent="0.45" /> diff --git a/app/src/main/res/layout/fragment_month.xml b/app/src/main/res/layout/fragment_month.xml index d89615dbd..e9649def6 100644 --- a/app/src/main/res/layout/fragment_month.xml +++ b/app/src/main/res/layout/fragment_month.xml @@ -10,6 +10,7 @@ android:id="@+id/month_view_wrapper" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_marginLeft="@dimen/smaller_margin" android:layout_below="@+id/top_left_arrow" /> diff --git a/app/src/main/res/layout/fragment_month_day.xml b/app/src/main/res/layout/fragment_month_day.xml index e3fdcb21e..5b14f1c47 100644 --- a/app/src/main/res/layout/fragment_month_day.xml +++ b/app/src/main/res/layout/fragment_month_day.xml @@ -11,6 +11,7 @@ android:id="@+id/month_day_view_wrapper" android:layout_width="match_parent" android:layout_height="0dp" + android:layout_marginLeft="@dimen/small_margin" app:layout_constraintBottom_toTopOf="@+id/month_day_list_holder" app:layout_constraintHeight_percent="0.3" app:layout_constraintStart_toStartOf="parent"