use full alpha on text colors on primary color

This commit is contained in:
tibbi 2017-10-26 15:20:23 +02:00
parent 941c64dede
commit 8cfe655755
3 changed files with 5 additions and 6 deletions

View File

@ -273,7 +273,7 @@ fun Context.addDayNumber(rawTextColor: Int, day: DayMonthly, linearLayout: Linea
if (day.isToday) {
val primaryColor = config.primaryColor
setTextColor(config.primaryColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA))
setTextColor(config.primaryColor.getContrastColor())
if (dayLabelHeight == 0) {
onGlobalLayout {
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)
eventLayoutParams.setMargins(dividerMargin, 0, dividerMargin, dividerMargin)
var textColor = it.color.getContrastColor().adjustAlpha(MEDIUM_ALPHA)
var textColor = it.color.getContrastColor()
if (!day.isThisMonth) {
backgroundDrawable.alpha = 64
textColor = textColor.adjustAlpha(0.25f)

View File

@ -22,7 +22,6 @@ import com.simplemobiletools.calendar.helpers.Formatter
import com.simplemobiletools.calendar.interfaces.WeeklyCalendar
import com.simplemobiletools.calendar.models.Event
import com.simplemobiletools.calendar.views.MyScrollView
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.beGone
import com.simplemobiletools.commons.extensions.getContrastColor
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 {
val backgroundColor = MainActivity.eventTypeColors.get(event.eventType, primaryColor)
background = ColorDrawable(backgroundColor)
setTextColor(backgroundColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA))
setTextColor(backgroundColor.getContrastColor())
text = event.title
layout.addView(this)
y = startMinutes * minuteHeight
@ -339,7 +338,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
val backgroundColor = MainActivity.eventTypeColors.get(event.eventType, primaryColor)
background = ColorDrawable(backgroundColor)
setTextColor(backgroundColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA))
setTextColor(backgroundColor.getContrastColor())
text = event.title
val startDateTime = Formatter.getDateTimeFromTS(event.startTS)

View File

@ -147,7 +147,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
day.dayEvents.forEach {
var backgroundColor = it.color
var eventTextColor = backgroundColor.getContrastColor().adjustAlpha(MEDIUM_ALPHA)
var eventTextColor = backgroundColor.getContrastColor()
if (!day.isThisMonth) {
eventTextColor = eventTextColor.adjustAlpha(0.25f)