Skip to content

Commit ea31dc6

Browse files
committed
use rounded corneres at the current day too
1 parent 674a429 commit ea31dc6

2 files changed

Lines changed: 32 additions & 13 deletions

File tree

app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,12 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
170170
setTextSize(R.id.day_monthly_number_id, context.getWidgetFontSize() - 3f)
171171

172172
if (day.isToday) {
173-
setBackgroundColor(R.id.day_monthly_number_id, textColor)
174173
setTextColor(R.id.day_monthly_number_id, textColor.getContrastColor())
174+
setViewVisibility(R.id.day_monthly_number_background, View.VISIBLE)
175+
setInt(R.id.day_monthly_number_background, "setColorFilter", textColor)
175176
} else {
176177
setTextColor(R.id.day_monthly_number_id, textColor)
178+
setViewVisibility(R.id.day_monthly_number_background, View.GONE)
177179
}
178180
}
179181
views.addView(id, newRemoteView)
Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
android:id="@+id/day_monthly_number_id"
4+
android:id="@+id/day_monthly_number_holder"
55
android:layout_width="match_parent"
6-
android:layout_height="wrap_content"
7-
android:layout_marginStart="@dimen/tiny_margin"
8-
android:layout_marginEnd="@dimen/tiny_margin"
9-
android:ellipsize="none"
10-
android:gravity="center_horizontal"
11-
android:maxLines="1"
12-
android:paddingStart="@dimen/tiny_margin"
13-
android:paddingEnd="@dimen/tiny_margin"
14-
android:textSize="@dimen/normal_text_size"
15-
tools:text="1" />
6+
android:layout_height="wrap_content">
7+
8+
<ImageView
9+
android:id="@+id/day_monthly_number_background"
10+
android:layout_width="match_parent"
11+
android:layout_height="match_parent"
12+
android:layout_alignBottom="@+id/day_monthly_number_id"
13+
android:layout_margin="@dimen/one_dp"
14+
android:contentDescription="@null"
15+
android:src="@drawable/day_monthly_event_background_widget"
16+
android:visibility="gone" />
17+
18+
<TextView
19+
android:id="@+id/day_monthly_number_id"
20+
android:layout_width="match_parent"
21+
android:layout_height="wrap_content"
22+
android:layout_marginStart="@dimen/tiny_margin"
23+
android:layout_marginEnd="@dimen/tiny_margin"
24+
android:ellipsize="none"
25+
android:gravity="center_horizontal"
26+
android:maxLines="1"
27+
android:paddingStart="@dimen/tiny_margin"
28+
android:paddingEnd="@dimen/tiny_margin"
29+
android:textSize="@dimen/normal_text_size"
30+
tools:text="1" />
31+
32+
</RelativeLayout>

0 commit comments

Comments
 (0)