Minor UX improvement

This commit is contained in:
Naveen
2023-04-30 16:18:48 +05:30
parent c4eeaeebc4
commit d7dd175bb5

View File

@@ -647,11 +647,13 @@ class EventActivity : SimpleActivity() {
event_repetition_limit_label.text = getString(R.string.repeat)
resources.getString(R.string.forever)
}
mRepeatLimit > 0 -> {
event_repetition_limit_label.text = getString(R.string.repeat_till)
val repeatLimitDateTime = Formatter.getDateTimeFromTS(mRepeatLimit)
Formatter.getFullDate(this, repeatLimitDateTime)
}
else -> {
event_repetition_limit_label.text = getString(R.string.repeat)
"${-mRepeatLimit} ${getString(R.string.times)}"
@@ -665,12 +667,14 @@ class EventActivity : SimpleActivity() {
mRepeatInterval.isXWeeklyRepetition() -> RepeatRuleWeeklyDialog(this, mRepeatRule) {
setRepeatRule(it)
}
mRepeatInterval.isXMonthlyRepetition() -> {
val items = getAvailableMonthlyRepetitionRules()
RadioGroupDialog(this, items, mRepeatRule) {
setRepeatRule(it as Int)
}
}
mRepeatInterval.isXYearlyRepetition() -> {
val items = getAvailableYearlyRepetitionRules()
RadioGroupDialog(this, items, mRepeatRule) {
@@ -787,6 +791,7 @@ class EventActivity : SimpleActivity() {
mRepeatInterval.isXWeeklyRepetition() -> {
event_repetition_rule.text = if (mRepeatRule == EVERY_DAY_BIT) getString(R.string.every_day) else getSelectedDaysString(mRepeatRule)
}
mRepeatInterval.isXMonthlyRepetition() -> {
val repeatString = if (mRepeatRule == REPEAT_ORDER_WEEKDAY_USE_LAST || mRepeatRule == REPEAT_ORDER_WEEKDAY)
R.string.repeat else R.string.repeat_on
@@ -794,6 +799,7 @@ class EventActivity : SimpleActivity() {
event_repetition_rule_label.text = getString(repeatString)
event_repetition_rule.text = getMonthlyRepetitionRuleText()
}
mRepeatInterval.isXYearlyRepetition() -> {
val repeatString = if (mRepeatRule == REPEAT_ORDER_WEEKDAY_USE_LAST || mRepeatRule == REPEAT_ORDER_WEEKDAY)
R.string.repeat else R.string.repeat_on
@@ -1050,11 +1056,11 @@ class EventActivity : SimpleActivity() {
ensureBackgroundThread {
val eventType = eventTypesDB.getEventTypeWithId(mEventTypeId)
event_color_image.beVisibleIf(eventType != null)
event_color_holder.beVisibleIf(eventType != null)
event_color_divider.beVisibleIf(eventType != null)
if (eventType != null) {
runOnUiThread {
event_color_image.beVisible()
event_color_holder.beVisible()
event_color_divider.beVisible()
updateEventColorInfo(eventType.color)
}
}