add some repetition limit related views

This commit is contained in:
tibbi
2017-02-05 21:32:24 +01:00
parent 9afe5dc7ae
commit e34efa0db5
2 changed files with 35 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
event_all_day.setOnCheckedChangeListener { compoundButton, isChecked -> toggleAllDay(isChecked) } event_all_day.setOnCheckedChangeListener { compoundButton, isChecked -> toggleAllDay(isChecked) }
event_reminder.setOnClickListener { showReminderDialog() } event_reminder.setOnClickListener { showReminderDialog() }
event_repetition.setOnClickListener { showRepeatIntervalDialog() } event_repetition.setOnClickListener { showRepeatIntervalDialog() }
event_repetition_limit.setOnClickListener { showRepetitionLimitDialog() }
if (mEvent.flags and FLAG_ALL_DAY != 0) if (mEvent.flags and FLAG_ALL_DAY != 0)
event_all_day.toggle() event_all_day.toggle()
@@ -106,9 +107,15 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
EventRepeatIntervalDialog(this, mRepeatInterval) { EventRepeatIntervalDialog(this, mRepeatInterval) {
mRepeatInterval = it mRepeatInterval = it
updateRepetitionText() updateRepetitionText()
event_repetition_limit.beGoneIf(it == 0)
event_repetition_limit_label.beGoneIf(it == 0)
} }
} }
private fun showRepetitionLimitDialog() {
}
private fun updateReminderText() { private fun updateReminderText() {
event_reminder.text = getReminderText(mReminderMinutes) event_reminder.text = getReminderText(mReminderMinutes)
} }

View File

@@ -208,5 +208,33 @@
android:paddingTop="@dimen/normal_margin" android:paddingTop="@dimen/normal_margin"
android:textSize="@dimen/day_text_size"/> android:textSize="@dimen/day_text_size"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_limit_label"
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"
android:layout_toLeftOf="@+id/event_repetition_limit"
android:layout_toStartOf="@+id/event_repetition_limit"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/repeat_till"
android:textSize="@dimen/day_text_size"
android:visibility="gone"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_repetition_limit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/event_repetition"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin"
android:text="@string/forever"
android:textSize="@dimen/day_text_size"
android:visibility="gone"/>
</RelativeLayout> </RelativeLayout>
</ScrollView> </ScrollView>