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