chore: Make day numbers with event bg more visible
This commit is contained in:
parent
a70c14634f
commit
ce1374bee4
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue