mark days with events with circles, not color change

This commit is contained in:
tibbi 2017-01-03 23:07:32 +01:00
parent 7ae2a0b8f0
commit 43c1bfe6ba
2 changed files with 26 additions and 6 deletions

View File

@ -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
}
}
}

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="@dimen/small_margin"
android:right="@dimen/small_margin">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="ring"
android:thicknessRatio="2"
android:useLevel="false">
<solid android:color="@android:color/transparent"/>
<stroke
android:width="1dp"
android:color="@android:color/white"/>
</shape>
</item>
</layer-list>