use red text if the events start is later then end

This commit is contained in:
tibbi 2017-05-21 21:23:01 +02:00
parent 858396a36d
commit 0d96caf25d
2 changed files with 11 additions and 0 deletions

View File

@ -468,10 +468,12 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
private fun updateStartDateText() {
event_start_date.text = Formatter.getDate(applicationContext, mEventStartDateTime)
checkStartEndValidity()
}
private fun updateStartTimeText() {
event_start_time.text = Formatter.getTime(this, mEventStartDateTime)
checkStartEndValidity()
}
private fun updateEndTexts() {
@ -481,10 +483,18 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
private fun updateEndDateText() {
event_end_date.text = Formatter.getDate(applicationContext, mEventEndDateTime)
checkStartEndValidity()
}
private fun updateEndTimeText() {
event_end_time.text = Formatter.getTime(this, mEventEndDateTime)
checkStartEndValidity()
}
private fun checkStartEndValidity() {
val textColor = if (mEventStartDateTime.isAfter(mEventEndDateTime)) resources.getColor(R.color.red_text) else config.textColor
event_end_date.setTextColor(textColor)
event_end_time.setTextColor(textColor)
}
@SuppressLint("NewApi")

View File

@ -2,4 +2,5 @@
<resources>
<color name="dark_theme_dialog_background">#ff444444</color>
<color name="darker_divider">#66808080</color>
<color name="red_text">#FFF62F2F</color>
</resources>