update the colors on a few more places
This commit is contained in:
parent
7165cdb3ff
commit
89d9c2c3ef
|
@ -49,9 +49,10 @@ class EventListAdapter(val activity: SimpleActivity, val mItems: List<ListItem>,
|
|||
}
|
||||
|
||||
init {
|
||||
textColor = Config.newInstance(activity).textColor
|
||||
val config = Config.newInstance(activity)
|
||||
textColor = config.textColor
|
||||
topDivider = activity.resources.getDrawable(R.drawable.divider)
|
||||
primaryColor = activity.resources.getColor(R.color.color_primary)
|
||||
primaryColor = config.primaryColor
|
||||
val mTodayCode = Formatter.getDayCodeFromTS(mNow)
|
||||
todayDate = Formatter.getDate(activity, mTodayCode)
|
||||
}
|
||||
|
|
|
@ -93,10 +93,11 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||
|
||||
private fun setupButtons() {
|
||||
val baseColor = mConfig.textColor
|
||||
val primaryColor = mConfig.primaryColor
|
||||
mTextColor = baseColor.adjustAlpha(HIGH_ALPHA)
|
||||
mTextColorWithEvent = mRes.getColor(R.color.color_primary).adjustAlpha(HIGH_ALPHA)
|
||||
mTextColorWithEvent = primaryColor.adjustAlpha(HIGH_ALPHA)
|
||||
mWeakTextColor = baseColor.adjustAlpha(LOW_ALPHA)
|
||||
mWeakTextColorWithEvent = mRes.getColor(R.color.color_primary).adjustAlpha(LOW_ALPHA)
|
||||
mWeakTextColorWithEvent = primaryColor.adjustAlpha(LOW_ALPHA)
|
||||
|
||||
mHolder.apply {
|
||||
top_left_arrow.drawable.mutate().setColorFilter(mTextColor, PorterDuff.Mode.SRC_ATOP)
|
||||
|
@ -152,15 +153,15 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||
val letters = letterIDs
|
||||
|
||||
for (i in 0..6) {
|
||||
val dayTV = mHolder.findViewById(mRes.getIdentifier("label_" + i, "id", mPackageName)) as TextView
|
||||
dayTV.textSize = mDayTextSize
|
||||
dayTV.setTextColor(mTextColor)
|
||||
|
||||
var index = i
|
||||
if (!mSundayFirst)
|
||||
index = (index + 1) % letters.size
|
||||
|
||||
dayTV.text = getString(letters[index])
|
||||
(mHolder.findViewById(mRes.getIdentifier("label_$i", "id", mPackageName)) as TextView).apply {
|
||||
textSize = mDayTextSize
|
||||
setTextColor(mTextColor)
|
||||
text = getString(letters[index])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,16 +176,15 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||
week_num.beVisibleIf(displayWeekNumbers)
|
||||
|
||||
for (i in 0..5) {
|
||||
val weekIdTV = mHolder.findViewById(mRes.getIdentifier("week_num_" + i, "id", mPackageName)) as TextView
|
||||
weekIdTV.text = "${days[i * 7].weekOfYear}:"
|
||||
weekIdTV.setTextColor(mWeakTextColor)
|
||||
weekIdTV.beVisibleIf(displayWeekNumbers)
|
||||
(mHolder.findViewById(mRes.getIdentifier("week_num_$i", "id", mPackageName)) as TextView).apply {
|
||||
text = "${days[i * 7].weekOfYear}:"
|
||||
setTextColor(mWeakTextColor)
|
||||
beVisibleIf(displayWeekNumbers)
|
||||
}
|
||||
}
|
||||
|
||||
for (i in 0..len - 1) {
|
||||
val day = days[i]
|
||||
val dayTV = mHolder.findViewById(mRes.getIdentifier("day_" + i, "id", mPackageName)) as TextView
|
||||
|
||||
var curTextColor = if (day.hasEvent) mWeakTextColorWithEvent else mWeakTextColor
|
||||
var curTextSize = mDayTextSize
|
||||
|
||||
|
@ -196,11 +196,12 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||
curTextSize = mTodayTextSize
|
||||
}
|
||||
|
||||
dayTV.text = day.value.toString()
|
||||
dayTV.setTextColor(curTextColor)
|
||||
dayTV.textSize = curTextSize
|
||||
|
||||
dayTV.setOnClickListener { openDay(day.code) }
|
||||
(mHolder.findViewById(mRes.getIdentifier("day_$i", "id", mPackageName)) as TextView).apply {
|
||||
text = day.value.toString()
|
||||
setTextColor(curTextColor)
|
||||
textSize = curTextSize
|
||||
setOnClickListener { openDay(day.code) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class YearFragment : Fragment(), YearlyCalendar {
|
|||
val now = DateTime()
|
||||
if (now.year == mYear) {
|
||||
val monthLabel = mView.findViewById(res.getIdentifier("month_${now.monthOfYear}_label", "id", activity.packageName)) as TextView
|
||||
monthLabel.setTextColor(res.getColor(R.color.color_primary).adjustAlpha(HIGH_ALPHA))
|
||||
monthLabel.setTextColor(Config.newInstance(context).primaryColor.adjustAlpha(HIGH_ALPHA))
|
||||
|
||||
val monthView = mView.findViewById(res.getIdentifier("month_${now.monthOfYear}", "id", activity.packageName)) as SmallMonthView
|
||||
monthView.setTodaysId(now.dayOfMonth)
|
||||
|
|
Loading…
Reference in New Issue