From 17ae73da68107a3db9d0f2c2768456680726b15f Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 3 Jan 2017 23:15:24 +0100 Subject: [PATCH] mark days with events with underlining, today with a circle --- .../calendar/fragments/MonthFragment.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 80140be03..1c079e134 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.calendar.fragments import android.content.Intent import android.content.res.Resources +import android.graphics.Paint import android.graphics.PorterDuff import android.os.Bundle import android.support.v4.app.Fragment @@ -180,22 +181,25 @@ class MonthFragment : Fragment(), MonthlyCalendar { } val eventBackground = resources.getDrawable(R.drawable.circle_empty) - eventBackground.setColorFilter(mTextColor.adjustAlpha(LOW_ALPHA), PorterDuff.Mode.SRC_IN) + eventBackground.setColorFilter(mTextColor.adjustAlpha(HIGH_ALPHA), PorterDuff.Mode.SRC_IN) for (i in 0..len - 1) { val day = days[i] - var curTextSize = mDayTextSize + var curTextColor = mWeakTextColor - if (day.isToday) { - curTextSize = mTodayTextSize + if (day.isThisMonth) { + curTextColor = mTextColor } (mHolder.findViewById(mRes.getIdentifier("day_$i", "id", mPackageName)) as TextView).apply { text = day.value.toString() - setTextColor(mTextColor) - textSize = curTextSize + setTextColor(curTextColor) setOnClickListener { openDay(day.code) } + if (day.hasEvent) + paintFlags = paintFlags or Paint.UNDERLINE_TEXT_FLAG + + if (day.isToday) background = eventBackground } }