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 1/3] 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" From b618d977738df74a3fc182450ee012f53b58ab49 Mon Sep 17 00:00:00 2001 From: Agnieszka C <85929121+Aga-C@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:55:11 +0100 Subject: [PATCH 2/3] Added right margin --- 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 + 3 files changed, 3 insertions(+) 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 f600e5372..b228eb1f7 100644 --- a/app/src/main/res/layout-land/fragment_month_day.xml +++ b/app/src/main/res/layout-land/fragment_month_day.xml @@ -12,6 +12,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/smaller_margin" + android:layout_marginRight="@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 e9649def6..52e6cdbb3 100644 --- a/app/src/main/res/layout/fragment_month.xml +++ b/app/src/main/res/layout/fragment_month.xml @@ -11,6 +11,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="@dimen/smaller_margin" + android:layout_marginRight="@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 5b14f1c47..ff6f0a39d 100644 --- a/app/src/main/res/layout/fragment_month_day.xml +++ b/app/src/main/res/layout/fragment_month_day.xml @@ -12,6 +12,7 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginLeft="@dimen/small_margin" + android:layout_marginRight="@dimen/small_margin" app:layout_constraintBottom_toTopOf="@+id/month_day_list_holder" app:layout_constraintHeight_percent="0.3" app:layout_constraintStart_toStartOf="parent" From 46c678c855e8573c37e700ff085b16dacbc8a338 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Tue, 14 Jan 2025 20:46:36 +0530 Subject: [PATCH 3/3] Revert the month view margins for now --- app/src/main/res/layout-land/fragment_month_day.xml | 2 -- app/src/main/res/layout/fragment_month.xml | 2 -- app/src/main/res/layout/fragment_month_day.xml | 2 -- 3 files changed, 6 deletions(-) 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 b228eb1f7..503e45926 100644 --- a/app/src/main/res/layout-land/fragment_month_day.xml +++ b/app/src/main/res/layout-land/fragment_month_day.xml @@ -11,8 +11,6 @@ android:id="@+id/month_day_view_wrapper" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginLeft="@dimen/smaller_margin" - android:layout_marginRight="@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 52e6cdbb3..d89615dbd 100644 --- a/app/src/main/res/layout/fragment_month.xml +++ b/app/src/main/res/layout/fragment_month.xml @@ -10,8 +10,6 @@ android:id="@+id/month_view_wrapper" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginLeft="@dimen/smaller_margin" - android:layout_marginRight="@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 ff6f0a39d..e3fdcb21e 100644 --- a/app/src/main/res/layout/fragment_month_day.xml +++ b/app/src/main/res/layout/fragment_month_day.xml @@ -11,8 +11,6 @@ android:id="@+id/month_day_view_wrapper" android:layout_width="match_parent" android:layout_height="0dp" - android:layout_marginLeft="@dimen/small_margin" - android:layout_marginRight="@dimen/small_margin" app:layout_constraintBottom_toTopOf="@+id/month_day_list_holder" app:layout_constraintHeight_percent="0.3" app:layout_constraintStart_toStartOf="parent"