make the whole event repetition limit line clickable

This commit is contained in:
tibbi
2017-02-12 00:05:34 +01:00
parent 53e9f5cb79
commit d9bf97e509
2 changed files with 32 additions and 27 deletions

View File

@ -79,7 +79,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.setOnClickListener { showRepetitionLimitDialog() } event_repetition_limit_holder.setOnClickListener { showRepetitionLimitDialog() }
event_reminder_1.setOnClickListener { showReminder1Dialog() } event_reminder_1.setOnClickListener { showReminder1Dialog() }
event_reminder_2.setOnClickListener { showReminder2Dialog() } event_reminder_2.setOnClickListener { showReminder2Dialog() }
@ -149,8 +149,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
} }
private fun checkRepeatLimit(limit: Int) { private fun checkRepeatLimit(limit: Int) {
event_repetition_limit.beGoneIf(limit == 0) event_repetition_limit_holder.beGoneIf(limit == 0)
event_repetition_limit_label.beGoneIf(limit == 0)
checkRepetitionLimitText() checkRepetitionLimitText()
} }

View File

@ -239,39 +239,45 @@
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 <RelativeLayout
android:id="@+id/event_repetition_limit_label" android:id="@+id/event_repetition_limit_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"
android:layout_alignStart="@+id/event_repetition" android:layout_alignStart="@+id/event_repetition"
android:layout_below="@+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:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin" android:visibility="gone">
android:text="@string/forever"
android:textSize="@dimen/day_text_size" <com.simplemobiletools.commons.views.MyTextView
android:visibility="gone"/> android:id="@+id/event_repetition_limit_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/event_repetition_limit"
android:layout_toStartOf="@+id/event_repetition_limit"
android:clickable="false"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/repeat_till"
android:textSize="@dimen/day_text_size"/>
<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:clickable="false"
android:padding="@dimen/activity_margin"
android:text="@string/forever"
android:textSize="@dimen/day_text_size"/>
</RelativeLayout>
<ImageView <ImageView
android:id="@+id/event_repetition_divider" android:id="@+id/event_repetition_divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1px" android:layout_height="1px"
android:layout_below="@+id/event_repetition_limit" android:layout_below="@+id/event_repetition_limit_holder"
android:layout_marginBottom="@dimen/medium_margin" android:layout_marginBottom="@dimen/medium_margin"
android:layout_marginTop="@dimen/medium_margin" android:layout_marginTop="@dimen/medium_margin"
android:background="@color/darker_divider"/> android:background="@color/darker_divider"/>
@ -315,8 +321,8 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/normal_margin" android:layout_marginEnd="@dimen/activity_margin"
android:layout_marginRight="@dimen/normal_margin" android:layout_marginRight="@dimen/activity_margin"
android:clickable="false"/> android:clickable="false"/>
</RelativeLayout> </RelativeLayout>