Always set event color click listener

This commit is contained in:
Naveen 2023-05-06 23:26:01 +05:30
parent 69eb932797
commit 207bb615d0

View file

@ -342,6 +342,10 @@ class EventActivity : SimpleActivity() {
event_all_day.toggle() event_all_day.toggle()
} }
event_color_holder.setOnClickListener {
showEventColorDialog()
}
updateTextColors(event_nested_scrollview) updateTextColors(event_nested_scrollview)
updateIconColors() updateIconColors()
refreshMenuItems() refreshMenuItems()
@ -649,11 +653,13 @@ class EventActivity : SimpleActivity() {
event_repetition_limit_label.text = getString(R.string.repeat) event_repetition_limit_label.text = getString(R.string.repeat)
resources.getString(R.string.forever) resources.getString(R.string.forever)
} }
mRepeatLimit > 0 -> { mRepeatLimit > 0 -> {
event_repetition_limit_label.text = getString(R.string.repeat_till) event_repetition_limit_label.text = getString(R.string.repeat_till)
val repeatLimitDateTime = Formatter.getDateTimeFromTS(mRepeatLimit) val repeatLimitDateTime = Formatter.getDateTimeFromTS(mRepeatLimit)
Formatter.getFullDate(this, repeatLimitDateTime) Formatter.getFullDate(this, repeatLimitDateTime)
} }
else -> { else -> {
event_repetition_limit_label.text = getString(R.string.repeat) event_repetition_limit_label.text = getString(R.string.repeat)
"${-mRepeatLimit} ${getString(R.string.times)}" "${-mRepeatLimit} ${getString(R.string.times)}"
@ -667,12 +673,14 @@ class EventActivity : SimpleActivity() {
mRepeatInterval.isXWeeklyRepetition() -> RepeatRuleWeeklyDialog(this, mRepeatRule) { mRepeatInterval.isXWeeklyRepetition() -> RepeatRuleWeeklyDialog(this, mRepeatRule) {
setRepeatRule(it) setRepeatRule(it)
} }
mRepeatInterval.isXMonthlyRepetition() -> { mRepeatInterval.isXMonthlyRepetition() -> {
val items = getAvailableMonthlyRepetitionRules() val items = getAvailableMonthlyRepetitionRules()
RadioGroupDialog(this, items, mRepeatRule) { RadioGroupDialog(this, items, mRepeatRule) {
setRepeatRule(it as Int) setRepeatRule(it as Int)
} }
} }
mRepeatInterval.isXYearlyRepetition() -> { mRepeatInterval.isXYearlyRepetition() -> {
val items = getAvailableYearlyRepetitionRules() val items = getAvailableYearlyRepetitionRules()
RadioGroupDialog(this, items, mRepeatRule) { RadioGroupDialog(this, items, mRepeatRule) {
@ -789,6 +797,7 @@ class EventActivity : SimpleActivity() {
mRepeatInterval.isXWeeklyRepetition() -> { mRepeatInterval.isXWeeklyRepetition() -> {
event_repetition_rule.text = if (mRepeatRule == EVERY_DAY_BIT) getString(R.string.every_day) else getSelectedDaysString(mRepeatRule) event_repetition_rule.text = if (mRepeatRule == EVERY_DAY_BIT) getString(R.string.every_day) else getSelectedDaysString(mRepeatRule)
} }
mRepeatInterval.isXMonthlyRepetition() -> { mRepeatInterval.isXMonthlyRepetition() -> {
val repeatString = if (mRepeatRule == REPEAT_ORDER_WEEKDAY_USE_LAST || mRepeatRule == REPEAT_ORDER_WEEKDAY) val repeatString = if (mRepeatRule == REPEAT_ORDER_WEEKDAY_USE_LAST || mRepeatRule == REPEAT_ORDER_WEEKDAY)
R.string.repeat else R.string.repeat_on R.string.repeat else R.string.repeat_on
@ -796,6 +805,7 @@ class EventActivity : SimpleActivity() {
event_repetition_rule_label.text = getString(repeatString) event_repetition_rule_label.text = getString(repeatString)
event_repetition_rule.text = getMonthlyRepetitionRuleText() event_repetition_rule.text = getMonthlyRepetitionRuleText()
} }
mRepeatInterval.isXYearlyRepetition() -> { mRepeatInterval.isXYearlyRepetition() -> {
val repeatString = if (mRepeatRule == REPEAT_ORDER_WEEKDAY_USE_LAST || mRepeatRule == REPEAT_ORDER_WEEKDAY) val repeatString = if (mRepeatRule == REPEAT_ORDER_WEEKDAY_USE_LAST || mRepeatRule == REPEAT_ORDER_WEEKDAY)
R.string.repeat else R.string.repeat_on R.string.repeat else R.string.repeat_on
@ -1019,10 +1029,6 @@ class EventActivity : SimpleActivity() {
updateAvailabilityImage() updateAvailabilityImage()
} }
} }
event_color_holder.setOnClickListener {
showEventColorDialog()
}
} else { } else {
updateCurrentCalendarInfo(null) updateCurrentCalendarInfo(null)
} }