diff --git a/app/build.gradle b/app/build.gradle index 234a56079..c4cbb92c7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.0.1' + implementation 'com.simplemobiletools:commons:4.0.2' implementation 'joda-time:joda-time:2.9.9' implementation 'com.facebook.stetho:stetho:1.5.0' implementation 'com.android.support:multidex:1.0.3' diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt index aa6d32387..dbeff977d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt @@ -307,7 +307,8 @@ class EventActivity : SimpleActivity() { } private fun getAvailableYearlyRepetitionRules(): ArrayList { - val items = arrayListOf(RadioItem(REPEAT_SAME_DAY, getString(R.string.repeat_on_the_same_day_monthly))) + val items = arrayListOf(RadioItem(REPEAT_SAME_DAY, getString(R.string.repeat_on_the_same_day_yearly))) + items.add(RadioItem(REPEAT_ORDER_WEEKDAY, getRepeatXthDayInMonthString(true, REPEAT_ORDER_WEEKDAY))) return items } @@ -367,6 +368,12 @@ class EventActivity : SimpleActivity() { }) } + private fun getRepeatXthDayInMonthString(includeBase: Boolean, repeatRule: Int): String { + val weekDayString = getRepeatXthDayString(includeBase, repeatRule) + val monthString = resources.getStringArray(R.array.in_months)[mEventStartDateTime.monthOfYear - 1] + return "$weekDayString $monthString" + } + private fun setRepeatRule(rule: Int) { mRepeatRule = rule checkRepetitionRuleText() @@ -405,6 +412,7 @@ class EventActivity : SimpleActivity() { private fun getYearlyRepetitionRuleText() = when (mRepeatRule) { REPEAT_SAME_DAY -> getString(R.string.the_same_day) + REPEAT_ORDER_WEEKDAY -> getRepeatXthDayInMonthString(false, mRepeatRule) else -> "" } diff --git a/app/src/main/res/layout/activity_event.xml b/app/src/main/res/layout/activity_event.xml index 2b0e115e0..fac0e5858 100644 --- a/app/src/main/res/layout/activity_event.xml +++ b/app/src/main/res/layout/activity_event.xml @@ -304,9 +304,7 @@ android:layout_toEndOf="@+id/event_repetition_rule_label" android:layout_toRightOf="@+id/event_repetition_rule_label" android:clickable="false" - android:ellipsize="end" android:gravity="end" - android:lines="1" android:padding="@dimen/activity_margin" android:text="@string/every_day" android:textSize="@dimen/day_text_size"/>