mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-01 11:07:34 +01:00
mark days with events with circles, not color change
This commit is contained in:
parent
7ae2a0b8f0
commit
43c1bfe6ba
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
20
app/src/main/res/drawable/circle_empty.xml
Normal file
20
app/src/main/res/drawable/circle_empty.xml
Normal 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>
|
Loading…
Reference in New Issue
Block a user