mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
use full alpha on text colors on primary color
This commit is contained in:
@@ -273,7 +273,7 @@ fun Context.addDayNumber(rawTextColor: Int, day: DayMonthly, linearLayout: Linea
|
|||||||
|
|
||||||
if (day.isToday) {
|
if (day.isToday) {
|
||||||
val primaryColor = config.primaryColor
|
val primaryColor = config.primaryColor
|
||||||
setTextColor(config.primaryColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA))
|
setTextColor(config.primaryColor.getContrastColor())
|
||||||
if (dayLabelHeight == 0) {
|
if (dayLabelHeight == 0) {
|
||||||
onGlobalLayout {
|
onGlobalLayout {
|
||||||
val height = this@apply.height
|
val height = this@apply.height
|
||||||
@@ -300,7 +300,7 @@ fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resou
|
|||||||
val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
eventLayoutParams.setMargins(dividerMargin, 0, dividerMargin, dividerMargin)
|
eventLayoutParams.setMargins(dividerMargin, 0, dividerMargin, dividerMargin)
|
||||||
|
|
||||||
var textColor = it.color.getContrastColor().adjustAlpha(MEDIUM_ALPHA)
|
var textColor = it.color.getContrastColor()
|
||||||
if (!day.isThisMonth) {
|
if (!day.isThisMonth) {
|
||||||
backgroundDrawable.alpha = 64
|
backgroundDrawable.alpha = 64
|
||||||
textColor = textColor.adjustAlpha(0.25f)
|
textColor = textColor.adjustAlpha(0.25f)
|
||||||
|
@@ -22,7 +22,6 @@ import com.simplemobiletools.calendar.helpers.Formatter
|
|||||||
import com.simplemobiletools.calendar.interfaces.WeeklyCalendar
|
import com.simplemobiletools.calendar.interfaces.WeeklyCalendar
|
||||||
import com.simplemobiletools.calendar.models.Event
|
import com.simplemobiletools.calendar.models.Event
|
||||||
import com.simplemobiletools.calendar.views.MyScrollView
|
import com.simplemobiletools.calendar.views.MyScrollView
|
||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
|
||||||
import com.simplemobiletools.commons.extensions.beGone
|
import com.simplemobiletools.commons.extensions.beGone
|
||||||
import com.simplemobiletools.commons.extensions.getContrastColor
|
import com.simplemobiletools.commons.extensions.getContrastColor
|
||||||
import kotlinx.android.synthetic.main.fragment_week.*
|
import kotlinx.android.synthetic.main.fragment_week.*
|
||||||
@@ -270,7 +269,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
(inflater.inflate(R.layout.week_event_marker, null, false) as TextView).apply {
|
(inflater.inflate(R.layout.week_event_marker, null, false) as TextView).apply {
|
||||||
val backgroundColor = MainActivity.eventTypeColors.get(event.eventType, primaryColor)
|
val backgroundColor = MainActivity.eventTypeColors.get(event.eventType, primaryColor)
|
||||||
background = ColorDrawable(backgroundColor)
|
background = ColorDrawable(backgroundColor)
|
||||||
setTextColor(backgroundColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA))
|
setTextColor(backgroundColor.getContrastColor())
|
||||||
text = event.title
|
text = event.title
|
||||||
layout.addView(this)
|
layout.addView(this)
|
||||||
y = startMinutes * minuteHeight
|
y = startMinutes * minuteHeight
|
||||||
@@ -339,7 +338,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
|
|
||||||
val backgroundColor = MainActivity.eventTypeColors.get(event.eventType, primaryColor)
|
val backgroundColor = MainActivity.eventTypeColors.get(event.eventType, primaryColor)
|
||||||
background = ColorDrawable(backgroundColor)
|
background = ColorDrawable(backgroundColor)
|
||||||
setTextColor(backgroundColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA))
|
setTextColor(backgroundColor.getContrastColor())
|
||||||
text = event.title
|
text = event.title
|
||||||
|
|
||||||
val startDateTime = Formatter.getDateTimeFromTS(event.startTS)
|
val startDateTime = Formatter.getDateTimeFromTS(event.startTS)
|
||||||
|
@@ -147,7 +147,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
|
|||||||
|
|
||||||
day.dayEvents.forEach {
|
day.dayEvents.forEach {
|
||||||
var backgroundColor = it.color
|
var backgroundColor = it.color
|
||||||
var eventTextColor = backgroundColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA)
|
var eventTextColor = backgroundColor.getContrastColor()
|
||||||
|
|
||||||
if (!day.isThisMonth) {
|
if (!day.isThisMonth) {
|
||||||
eventTextColor = eventTextColor.adjustAlpha(0.25f)
|
eventTextColor = eventTextColor.adjustAlpha(0.25f)
|
||||||
|
Reference in New Issue
Block a user