show a repeat rule field if repetition is set to a day or month

This commit is contained in:
tibbi 2017-04-14 14:28:16 +02:00
parent ce7fac0489
commit 52ddc8ce59
2 changed files with 42 additions and 1 deletions

View File

@ -77,6 +77,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
event_all_day.setOnCheckedChangeListener { compoundButton, isChecked -> toggleAllDay(isChecked) } event_all_day.setOnCheckedChangeListener { compoundButton, isChecked -> toggleAllDay(isChecked) }
event_repetition.setOnClickListener { showRepeatIntervalDialog() } event_repetition.setOnClickListener { showRepeatIntervalDialog() }
event_repetition_limit_holder.setOnClickListener { showRepetitionLimitDialog() } event_repetition_limit_holder.setOnClickListener { showRepetitionLimitDialog() }
event_repetition_rule_holder.setOnClickListener { showRepetitionRuleDialog() }
event_reminder_1.setOnClickListener { showReminder1Dialog() } event_reminder_1.setOnClickListener { showReminder1Dialog() }
event_reminder_2.setOnClickListener { showReminder2Dialog() } event_reminder_2.setOnClickListener { showReminder2Dialog() }
@ -148,6 +149,8 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
private fun checkRepeatLimit(limit: Int) { private fun checkRepeatLimit(limit: Int) {
event_repetition_limit_holder.beGoneIf(limit == 0) event_repetition_limit_holder.beGoneIf(limit == 0)
checkRepetitionLimitText() checkRepetitionLimitText()
event_repetition_rule_holder.beGoneIf(mRepeatInterval != DAY && mRepeatInterval != MONTH)
} }
private fun showRepetitionLimitDialog() { private fun showRepetitionLimitDialog() {
@ -176,6 +179,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
} }
} }
private fun showRepetitionRuleDialog() {
}
private fun showEventTypeDialog() { private fun showEventTypeDialog() {
SelectEventTypeDialog(this, mEventTypeId) { SelectEventTypeDialog(this, mEventTypeId) {
mEventTypeId = it mEventTypeId = it

View File

@ -240,7 +240,7 @@
android:textSize="@dimen/day_text_size"/> android:textSize="@dimen/day_text_size"/>
<RelativeLayout <RelativeLayout
android:id="@+id/event_repetition_limit_holder" android:id="@+id/event_repetition_rule_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignLeft="@+id/event_repetition" android:layout_alignLeft="@+id/event_repetition"
@ -249,6 +249,40 @@
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:visibility="gone"> android:visibility="gone">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_rule_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/event_repetition_rule"
android:layout_toStartOf="@+id/event_repetition_rule"
android:clickable="false"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/repeat"
android:textSize="@dimen/day_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_rule"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:clickable="false"
android:padding="@dimen/activity_margin"
android:text="@string/every_day"
android:textSize="@dimen/day_text_size"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/event_repetition_limit_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/event_repetition"
android:layout_alignStart="@+id/event_repetition"
android:layout_below="@+id/event_repetition_rule_holder"
android:background="?attr/selectableItemBackground"
android:visibility="gone">
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_limit_label" android:id="@+id/event_repetition_limit_label"
android:layout_width="match_parent" android:layout_width="match_parent"