From 43c1bfe6bad41b33fcde2609ac0eea974398794e Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 3 Jan 2017 23:07:32 +0100 Subject: [PATCH] mark days with events with circles, not color change --- .../calendar/fragments/MonthFragment.kt | 12 +++++------ app/src/main/res/drawable/circle_empty.xml | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/circle_empty.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt index 5a96de358..80140be03 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt @@ -179,24 +179,24 @@ class MonthFragment : Fragment(), MonthlyCalendar { } } + val eventBackground = resources.getDrawable(R.drawable.circle_empty) + eventBackground.setColorFilter(mTextColor.adjustAlpha(LOW_ALPHA), PorterDuff.Mode.SRC_IN) + for (i in 0..len - 1) { val day = days[i] - var curTextColor = if (day.hasEvent) mWeakTextColorWithEvent else mWeakTextColor var curTextSize = mDayTextSize - if (day.isThisMonth) { - curTextColor = if (day.hasEvent) mTextColorWithEvent else mTextColor - } - if (day.isToday) { curTextSize = mTodayTextSize } (mHolder.findViewById(mRes.getIdentifier("day_$i", "id", mPackageName)) as TextView).apply { text = day.value.toString() - setTextColor(curTextColor) + setTextColor(mTextColor) textSize = curTextSize setOnClickListener { openDay(day.code) } + if (day.hasEvent) + background = eventBackground } } } diff --git a/app/src/main/res/drawable/circle_empty.xml b/app/src/main/res/drawable/circle_empty.xml new file mode 100644 index 000000000..518a1f22d --- /dev/null +++ b/app/src/main/res/drawable/circle_empty.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + +