chore: Make day numbers with event bg more visible

This commit is contained in:
Peter Vacho 2025-01-01 19:02:17 +01:00
parent a70c14634f
commit ce1374bee4
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -4,6 +4,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.p_vacho.neat_calendar.R
import com.p_vacho.neat_calendar.models.CalendarDay
@ -36,7 +37,9 @@ class CalendarDayItemAdapter(private val days: List<CalendarDay?>, private val o
// Visually indicate days with events
if (day.events.isNotEmpty()) {
holder.tvDay.setBackgroundResource(R.drawable.event_indicator_background)
val drawable = holder.tvDay.context.getDrawable(R.drawable.event_indicator_background)!!
drawable.mutate().alpha = (0.8 * 255).toInt() // Set 80% opacity
holder.tvDay.background = drawable
} else {
holder.tvDay.setBackgroundResource(android.R.color.transparent)
}