Minor readability improvement

This commit is contained in:
Naveen
2023-04-30 15:18:33 +05:30
parent 75233a1bcd
commit 3a8a250844
2 changed files with 20 additions and 20 deletions

View File

@@ -1018,7 +1018,7 @@ class EventActivity : SimpleActivity() {
} }
} }
event_caldav_color_holder.setOnClickListener { event_color_holder.setOnClickListener {
showEventColorDialog() showEventColorDialog()
} }
} else { } else {
@@ -1052,9 +1052,9 @@ class EventActivity : SimpleActivity() {
val eventType = eventTypesDB.getEventTypeWithId(mEventTypeId) val eventType = eventTypesDB.getEventTypeWithId(mEventTypeId)
if (eventType != null) { if (eventType != null) {
runOnUiThread { runOnUiThread {
event_caldav_color_image.beVisible() event_color_image.beVisible()
event_caldav_color_holder.beVisible() event_color_holder.beVisible()
event_caldav_color_divider.beVisible() event_color_divider.beVisible()
updateEventColorInfo(eventType.color) updateEventColorInfo(eventType.color)
} }
} }
@@ -1081,9 +1081,9 @@ class EventActivity : SimpleActivity() {
setPadding(paddingLeft, 0, paddingRight, 0) setPadding(paddingLeft, 0, paddingRight, 0)
} }
event_caldav_color_image.beVisibleIf(canCustomizeColors) event_color_image.beVisibleIf(canCustomizeColors)
event_caldav_color_holder.beVisibleIf(canCustomizeColors) event_color_holder.beVisibleIf(canCustomizeColors)
event_caldav_color_divider.beVisibleIf(canCustomizeColors) event_color_divider.beVisibleIf(canCustomizeColors)
if (canCustomizeColors) { if (canCustomizeColors) {
updateEventColorInfo(calendarColor) updateEventColorInfo(calendarColor)
} }
@@ -1098,7 +1098,7 @@ class EventActivity : SimpleActivity() {
} else { } else {
mEventColor mEventColor
} }
event_caldav_color.setFillWithStroke(eventColor, getProperBackgroundColor()) event_color.setFillWithStroke(eventColor, getProperBackgroundColor())
} }
private fun getEventColors(eventType: EventType): IntArray { private fun getEventColors(eventType: EventType): IntArray {
@@ -1891,7 +1891,7 @@ class EventActivity : SimpleActivity() {
val textColor = getProperTextColor() val textColor = getProperTextColor()
arrayOf( arrayOf(
event_time_image, event_time_zone_image, event_repetition_image, event_reminder_image, event_type_image, event_caldav_calendar_image, event_time_image, event_time_zone_image, event_repetition_image, event_reminder_image, event_type_image, event_caldav_calendar_image,
event_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image, event_availability_image, event_caldav_color_image event_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image, event_availability_image, event_color_image
).forEach { ).forEach {
it.applyColorFilter(textColor) it.applyColorFilter(textColor)
} }

View File

@@ -507,24 +507,24 @@
android:importantForAccessibility="no" /> android:importantForAccessibility="no" />
<ImageView <ImageView
android:id="@+id/event_caldav_color_image" android:id="@+id/event_color_image"
android:layout_width="@dimen/smaller_icon_size" android:layout_width="@dimen/smaller_icon_size"
android:layout_height="@dimen/smaller_icon_size" android:layout_height="@dimen/smaller_icon_size"
android:layout_below="@+id/event_availability_divider" android:layout_below="@+id/event_availability_divider"
android:layout_alignTop="@+id/event_caldav_color_holder" android:layout_alignTop="@+id/event_color_holder"
android:layout_alignBottom="@+id/event_caldav_color_holder" android:layout_alignBottom="@+id/event_color_holder"
android:layout_marginStart="@dimen/normal_margin" android:layout_marginStart="@dimen/normal_margin"
android:padding="@dimen/medium_margin" android:padding="@dimen/medium_margin"
android:src="@drawable/ic_color_vector" /> android:src="@drawable/ic_color_vector" />
<RelativeLayout <RelativeLayout
android:id="@+id/event_caldav_color_holder" android:id="@+id/event_color_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/event_availability_divider" android:layout_below="@+id/event_availability_divider"
android:layout_marginTop="@dimen/medium_margin" android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin" android:layout_marginBottom="@dimen/medium_margin"
android:layout_toEndOf="@+id/event_caldav_color_image" android:layout_toEndOf="@+id/event_color_image"
android:background="?attr/selectableItemBackground"> android:background="?attr/selectableItemBackground">
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
@@ -533,14 +533,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/small_margin" android:layout_marginStart="@dimen/small_margin"
android:layout_marginEnd="@dimen/medium_margin" android:layout_marginEnd="@dimen/medium_margin"
android:layout_toStartOf="@+id/event_caldav_color" android:layout_toStartOf="@+id/event_color"
android:paddingTop="@dimen/normal_margin" android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin" android:paddingBottom="@dimen/normal_margin"
android:text="@string/event_color" android:text="@string/event_color"
android:textSize="@dimen/day_text_size" /> android:textSize="@dimen/day_text_size" />
<ImageView <ImageView
android:id="@+id/event_caldav_color" android:id="@+id/event_color"
android:layout_width="@dimen/color_sample_size" android:layout_width="@dimen/color_sample_size"
android:layout_height="@dimen/color_sample_size" android:layout_height="@dimen/color_sample_size"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
@@ -551,10 +551,10 @@
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:id="@+id/event_caldav_color_divider" android:id="@+id/event_color_divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/divider_height" android:layout_height="@dimen/divider_height"
android:layout_below="@+id/event_caldav_color_image" android:layout_below="@+id/event_color_image"
android:layout_marginTop="@dimen/medium_margin" android:layout_marginTop="@dimen/medium_margin"
android:background="@color/divider_grey" android:background="@color/divider_grey"
android:importantForAccessibility="no" /> android:importantForAccessibility="no" />
@@ -563,7 +563,7 @@
android:id="@+id/event_caldav_calendar_image" android:id="@+id/event_caldav_calendar_image"
android:layout_width="@dimen/smaller_icon_size" android:layout_width="@dimen/smaller_icon_size"
android:layout_height="@dimen/smaller_icon_size" android:layout_height="@dimen/smaller_icon_size"
android:layout_below="@+id/event_caldav_color_divider" android:layout_below="@+id/event_color_divider"
android:layout_alignTop="@+id/event_caldav_calendar_holder" android:layout_alignTop="@+id/event_caldav_calendar_holder"
android:layout_alignEnd="@+id/event_time_image" android:layout_alignEnd="@+id/event_time_image"
android:layout_alignBottom="@+id/event_caldav_calendar_holder" android:layout_alignBottom="@+id/event_caldav_calendar_holder"
@@ -576,7 +576,7 @@
android:id="@+id/event_caldav_calendar_holder" android:id="@+id/event_caldav_calendar_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/event_caldav_color_divider" android:layout_below="@+id/event_color_divider"
android:layout_toEndOf="@+id/event_caldav_calendar_image" android:layout_toEndOf="@+id/event_caldav_calendar_image"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:visibility="gone"> android:visibility="gone">