mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
Allow changing CalDAV event color
This commit is contained in:
@@ -10,6 +10,7 @@ import android.graphics.drawable.LayerDrawable
|
|||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.CalendarContract.Attendees
|
import android.provider.CalendarContract.Attendees
|
||||||
|
import android.provider.CalendarContract.Colors
|
||||||
import android.provider.ContactsContract.CommonDataKinds
|
import android.provider.ContactsContract.CommonDataKinds
|
||||||
import android.provider.ContactsContract.CommonDataKinds.StructuredName
|
import android.provider.ContactsContract.CommonDataKinds.StructuredName
|
||||||
import android.provider.ContactsContract.Data
|
import android.provider.ContactsContract.Data
|
||||||
@@ -825,6 +826,19 @@ class EventActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showEventColorDialog() {
|
||||||
|
hideKeyboard()
|
||||||
|
ensureBackgroundThread {
|
||||||
|
val eventType = eventsHelper.getEventTypeWithCalDAVCalendarId(calendarId = mEventCalendarId)!!
|
||||||
|
runOnUiThread {
|
||||||
|
SelectEventTypeColorDialog(activity = this, eventType = eventType, selectedColor = mEvent.color, colorType = Colors.TYPE_EVENT) { color ->
|
||||||
|
mEvent.color = color
|
||||||
|
event_caldav_color.setFillWithStroke(color, getProperBackgroundColor())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkReminderTexts() {
|
private fun checkReminderTexts() {
|
||||||
updateReminder1Text()
|
updateReminder1Text()
|
||||||
updateReminder2Text()
|
updateReminder2Text()
|
||||||
@@ -936,6 +950,9 @@ class EventActivity : SimpleActivity() {
|
|||||||
event_caldav_calendar_image.beVisible()
|
event_caldav_calendar_image.beVisible()
|
||||||
event_caldav_calendar_holder.beVisible()
|
event_caldav_calendar_holder.beVisible()
|
||||||
event_caldav_calendar_divider.beVisible()
|
event_caldav_calendar_divider.beVisible()
|
||||||
|
event_caldav_color_image.beVisible()
|
||||||
|
event_caldav_color_holder.beVisible()
|
||||||
|
event_caldav_color_divider.beVisible()
|
||||||
|
|
||||||
val calendars = calDAVHelper.getCalDAVCalendars("", true).filter {
|
val calendars = calDAVHelper.getCalDAVCalendars("", true).filter {
|
||||||
it.canWrite() && config.getSyncedCalendarIdsAsList().contains(it.id)
|
it.canWrite() && config.getSyncedCalendarIdsAsList().contains(it.id)
|
||||||
@@ -959,6 +976,7 @@ class EventActivity : SimpleActivity() {
|
|||||||
updateAvailabilityImage()
|
updateAvailabilityImage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
event_caldav_color_holder.setOnClickListener { showEventColorDialog() }
|
||||||
} else {
|
} else {
|
||||||
updateCurrentCalendarInfo(null)
|
updateCurrentCalendarInfo(null)
|
||||||
}
|
}
|
||||||
@@ -974,6 +992,9 @@ class EventActivity : SimpleActivity() {
|
|||||||
event_caldav_calendar_divider.beVisibleIf(currentCalendar == null)
|
event_caldav_calendar_divider.beVisibleIf(currentCalendar == null)
|
||||||
event_caldav_calendar_email.beGoneIf(currentCalendar == null)
|
event_caldav_calendar_email.beGoneIf(currentCalendar == null)
|
||||||
event_caldav_calendar_color.beGoneIf(currentCalendar == null)
|
event_caldav_calendar_color.beGoneIf(currentCalendar == null)
|
||||||
|
event_caldav_color_image.beGoneIf(currentCalendar == null)
|
||||||
|
event_caldav_color_holder.beGoneIf(currentCalendar == null)
|
||||||
|
event_caldav_color_divider.beGoneIf(currentCalendar == null)
|
||||||
|
|
||||||
if (currentCalendar == null) {
|
if (currentCalendar == null) {
|
||||||
mEventCalendarId = STORED_LOCALLY_ONLY
|
mEventCalendarId = STORED_LOCALLY_ONLY
|
||||||
@@ -1002,6 +1023,13 @@ class EventActivity : SimpleActivity() {
|
|||||||
event_caldav_calendar_holder.apply {
|
event_caldav_calendar_holder.apply {
|
||||||
setPadding(paddingLeft, 0, paddingRight, 0)
|
setPadding(paddingLeft, 0, paddingRight, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val eventColor = if (mEvent.color == 0) {
|
||||||
|
calendarColor
|
||||||
|
} else {
|
||||||
|
mEvent.color
|
||||||
|
}
|
||||||
|
event_caldav_color.setFillWithStroke(eventColor, getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1791,7 +1819,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_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image, event_availability_image, event_caldav_color_image
|
||||||
).forEach {
|
).forEach {
|
||||||
it.applyColorFilter(textColor)
|
it.applyColorFilter(textColor)
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ class EditEventTypeDialog(val activity: Activity, var eventType: EventType? = nu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SelectEventTypeColorDialog(activity, eventType!!) {
|
SelectEventTypeColorDialog(activity, eventType!!, eventType!!.color) {
|
||||||
eventType!!.color = it
|
eventType!!.color = it
|
||||||
setupColor(type_color)
|
setupColor(type_color)
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.simplemobiletools.calendar.pro.dialogs
|
package com.simplemobiletools.calendar.pro.dialogs
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
|
import android.provider.CalendarContract.Colors
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.RadioButton
|
import android.widget.RadioButton
|
||||||
import android.widget.RadioGroup
|
import android.widget.RadioGroup
|
||||||
@@ -16,11 +17,17 @@ import com.simplemobiletools.commons.extensions.setupDialogStuff
|
|||||||
import kotlinx.android.synthetic.main.dialog_select_event_type_color.view.*
|
import kotlinx.android.synthetic.main.dialog_select_event_type_color.view.*
|
||||||
import kotlinx.android.synthetic.main.radio_button_with_color.view.*
|
import kotlinx.android.synthetic.main.radio_button_with_color.view.*
|
||||||
|
|
||||||
class SelectEventTypeColorDialog(val activity: Activity, val eventType: EventType, val callback: (color: Int) -> Unit) {
|
class SelectEventTypeColorDialog(
|
||||||
|
val activity: Activity,
|
||||||
|
val eventType: EventType,
|
||||||
|
val selectedColor: Int,
|
||||||
|
val colorType: Int = Colors.TYPE_CALENDAR,
|
||||||
|
val callback: (color: Int) -> Unit
|
||||||
|
) {
|
||||||
private var dialog: AlertDialog? = null
|
private var dialog: AlertDialog? = null
|
||||||
private val radioGroup: RadioGroup
|
private val radioGroup: RadioGroup
|
||||||
private var wasInit = false
|
private var wasInit = false
|
||||||
private val colors = activity.calDAVHelper.getAvailableCalDAVCalendarColors(eventType)
|
private val colors = activity.calDAVHelper.getAvailableCalDAVCalendarColors(eventType, colorType)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val view = activity.layoutInflater.inflate(R.layout.dialog_select_event_type_color, null) as ViewGroup
|
val view = activity.layoutInflater.inflate(R.layout.dialog_select_event_type_color, null) as ViewGroup
|
||||||
@@ -29,8 +36,8 @@ class SelectEventTypeColorDialog(val activity: Activity, val eventType: EventTyp
|
|||||||
showCustomColorPicker()
|
showCustomColorPicker()
|
||||||
}
|
}
|
||||||
|
|
||||||
colors.forEachIndexed { index, value ->
|
colors.forEach { (color, key) ->
|
||||||
addRadioButton(index, value)
|
addRadioButton(key.toInt(), color)
|
||||||
}
|
}
|
||||||
|
|
||||||
wasInit = true
|
wasInit = true
|
||||||
@@ -50,22 +57,22 @@ class SelectEventTypeColorDialog(val activity: Activity, val eventType: EventTyp
|
|||||||
val view = activity.layoutInflater.inflate(R.layout.radio_button_with_color, null)
|
val view = activity.layoutInflater.inflate(R.layout.radio_button_with_color, null)
|
||||||
(view.dialog_radio_button as RadioButton).apply {
|
(view.dialog_radio_button as RadioButton).apply {
|
||||||
text = if (color == 0) activity.getString(R.string.transparent) else String.format("#%06X", 0xFFFFFF and color)
|
text = if (color == 0) activity.getString(R.string.transparent) else String.format("#%06X", 0xFFFFFF and color)
|
||||||
isChecked = color == eventType.color
|
isChecked = color == selectedColor
|
||||||
id = colorKey
|
id = colorKey
|
||||||
}
|
}
|
||||||
|
|
||||||
view.dialog_radio_color.setFillWithStroke(color, activity.getProperBackgroundColor())
|
view.dialog_radio_color.setFillWithStroke(color, activity.getProperBackgroundColor())
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
viewClicked(colorKey)
|
viewClicked(color)
|
||||||
}
|
}
|
||||||
radioGroup.addView(view, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
|
radioGroup.addView(view, RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun viewClicked(colorKey: Int) {
|
private fun viewClicked(color: Int) {
|
||||||
if (!wasInit)
|
if (!wasInit)
|
||||||
return
|
return
|
||||||
|
|
||||||
callback(colors[colorKey])
|
callback(color)
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -557,9 +557,13 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
|
|
||||||
val dayColumn = dayColumns[dayOfWeek]
|
val dayColumn = dayColumns[dayOfWeek]
|
||||||
(inflater.inflate(R.layout.week_event_marker, null, false) as ConstraintLayout).apply {
|
(inflater.inflate(R.layout.week_event_marker, null, false) as ConstraintLayout).apply {
|
||||||
var backgroundColor = eventTypeColors.get(event.eventType, primaryColor)
|
var backgroundColor = if (event.color == 0) {
|
||||||
|
eventTypeColors.get(event.eventType, primaryColor)
|
||||||
|
} else {
|
||||||
|
event.color
|
||||||
|
}
|
||||||
var textColor = backgroundColor.getContrastColor()
|
var textColor = backgroundColor.getContrastColor()
|
||||||
val currentEventWeeklyView = eventTimeRanges[currentDayCode]!!.get(event.id)
|
val currentEventWeeklyView = eventTimeRanges[currentDayCode]!![event.id]
|
||||||
|
|
||||||
val adjustAlpha = if (event.isTask()) {
|
val adjustAlpha = if (event.isTask()) {
|
||||||
dimCompletedTasks && event.isTaskCompleted()
|
dimCompletedTasks && event.isTaskCompleted()
|
||||||
|
@@ -5,7 +5,6 @@ import android.content.ContentUris
|
|||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.provider.CalendarContract.*
|
import android.provider.CalendarContract.*
|
||||||
import android.util.SparseIntArray
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.reflect.TypeToken
|
import com.google.gson.reflect.TypeToken
|
||||||
@@ -116,35 +115,25 @@ class CalDAVHelper(val context: Context) {
|
|||||||
|
|
||||||
private fun getCalDAVColorKey(eventType: EventType): String? {
|
private fun getCalDAVColorKey(eventType: EventType): String? {
|
||||||
val colors = getAvailableCalDAVCalendarColors(eventType)
|
val colors = getAvailableCalDAVCalendarColors(eventType)
|
||||||
val colorKey = colors.indexOf(eventType.color)
|
return colors[eventType.color]
|
||||||
return if (colorKey > 0) {
|
|
||||||
colorKey.toString()
|
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
fun getAvailableCalDAVCalendarColors(eventType: EventType): ArrayList<Int> {
|
fun getAvailableCalDAVCalendarColors(eventType: EventType, colorType: Int = Colors.TYPE_CALENDAR): Map<Int, String> {
|
||||||
val colors = SparseIntArray()
|
val colors = mutableMapOf<String, Int>()
|
||||||
val uri = Colors.CONTENT_URI
|
val uri = Colors.CONTENT_URI
|
||||||
val projection = arrayOf(Colors.COLOR, Colors.COLOR_KEY)
|
val projection = arrayOf(Colors.COLOR, Colors.COLOR_KEY)
|
||||||
val selection = "${Colors.COLOR_TYPE} = ? AND ${Colors.ACCOUNT_NAME} = ?"
|
val selection = "${Colors.COLOR_TYPE} = ? AND ${Colors.ACCOUNT_NAME} = ?"
|
||||||
val selectionArgs = arrayOf(Colors.TYPE_CALENDAR.toString(), eventType.caldavEmail)
|
val selectionArgs = arrayOf(colorType.toString(), eventType.caldavEmail)
|
||||||
|
|
||||||
context.queryCursor(uri, projection, selection, selectionArgs) { cursor ->
|
context.queryCursor(uri, projection, selection, selectionArgs) { cursor ->
|
||||||
val colorKey = cursor.getIntValue(Colors.COLOR_KEY)
|
val colorKey = cursor.getStringValue(Colors.COLOR_KEY)
|
||||||
val color = cursor.getIntValue(Colors.COLOR)
|
val color = cursor.getIntValue(Colors.COLOR)
|
||||||
colors.put(colorKey, color)
|
colors[colorKey] = color
|
||||||
}
|
}
|
||||||
|
|
||||||
var sortedColors = ArrayList<Int>(colors.size())
|
return colors.toSortedMap().entries
|
||||||
(0 until colors.size()).mapTo(sortedColors) { colors[it] }
|
.associate { (k, v) -> v to k }
|
||||||
if (sortedColors.isNotEmpty()) {
|
|
||||||
sortedColors = sortedColors.distinct() as ArrayList<Int>
|
|
||||||
}
|
|
||||||
|
|
||||||
return sortedColors
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
@@ -181,7 +170,8 @@ class CalDAVHelper(val context: Context) {
|
|||||||
Events.EVENT_TIMEZONE,
|
Events.EVENT_TIMEZONE,
|
||||||
Events.CALENDAR_TIME_ZONE,
|
Events.CALENDAR_TIME_ZONE,
|
||||||
Events.DELETED,
|
Events.DELETED,
|
||||||
Events.AVAILABILITY
|
Events.AVAILABILITY,
|
||||||
|
Events.EVENT_COLOR
|
||||||
)
|
)
|
||||||
|
|
||||||
val selection = "${Events.CALENDAR_ID} = $calendarId"
|
val selection = "${Events.CALENDAR_ID} = $calendarId"
|
||||||
@@ -210,6 +200,7 @@ class CalDAVHelper(val context: Context) {
|
|||||||
val reminders = getCalDAVEventReminders(id)
|
val reminders = getCalDAVEventReminders(id)
|
||||||
val attendees = Gson().toJson(getCalDAVEventAttendees(id))
|
val attendees = Gson().toJson(getCalDAVEventAttendees(id))
|
||||||
val availability = cursor.getIntValue(Events.AVAILABILITY)
|
val availability = cursor.getIntValue(Events.AVAILABILITY)
|
||||||
|
val color = cursor.getIntValue(Events.EVENT_COLOR)
|
||||||
|
|
||||||
if (endTS == 0L) {
|
if (endTS == 0L) {
|
||||||
val duration = cursor.getStringValue(Events.DURATION) ?: ""
|
val duration = cursor.getStringValue(Events.DURATION) ?: ""
|
||||||
@@ -230,7 +221,8 @@ class CalDAVHelper(val context: Context) {
|
|||||||
reminder2?.minutes ?: REMINDER_OFF, reminder3?.minutes ?: REMINDER_OFF,
|
reminder2?.minutes ?: REMINDER_OFF, reminder3?.minutes ?: REMINDER_OFF,
|
||||||
reminder1?.type ?: REMINDER_NOTIFICATION, reminder2?.type ?: REMINDER_NOTIFICATION,
|
reminder1?.type ?: REMINDER_NOTIFICATION, reminder2?.type ?: REMINDER_NOTIFICATION,
|
||||||
reminder3?.type ?: REMINDER_NOTIFICATION, repeatRule.repeatInterval, repeatRule.repeatRule,
|
reminder3?.type ?: REMINDER_NOTIFICATION, repeatRule.repeatInterval, repeatRule.repeatRule,
|
||||||
repeatRule.repeatLimit, ArrayList(), attendees, importId, eventTimeZone, allDay, eventTypeId, source = source, availability = availability
|
repeatRule.repeatLimit, ArrayList(), attendees, importId, eventTimeZone, allDay, eventTypeId,
|
||||||
|
source = source, availability = availability, color = color
|
||||||
)
|
)
|
||||||
|
|
||||||
if (event.getIsAllDay()) {
|
if (event.getIsAllDay()) {
|
||||||
@@ -291,7 +283,6 @@ class CalDAVHelper(val context: Context) {
|
|||||||
|
|
||||||
existingEvent.apply {
|
existingEvent.apply {
|
||||||
this.id = null
|
this.id = null
|
||||||
color = 0
|
|
||||||
lastUpdated = 0L
|
lastUpdated = 0L
|
||||||
repetitionExceptions = ArrayList()
|
repetitionExceptions = ArrayList()
|
||||||
}
|
}
|
||||||
@@ -394,14 +385,23 @@ class CalDAVHelper(val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun fillEventContentValues(event: Event): ContentValues {
|
private fun fillEventContentValues(event: Event): ContentValues {
|
||||||
|
val calendarId = event.getCalDAVCalendarId()
|
||||||
return ContentValues().apply {
|
return ContentValues().apply {
|
||||||
put(Events.CALENDAR_ID, event.getCalDAVCalendarId())
|
put(Events.CALENDAR_ID, calendarId)
|
||||||
put(Events.TITLE, event.title)
|
put(Events.TITLE, event.title)
|
||||||
put(Events.DESCRIPTION, event.description)
|
put(Events.DESCRIPTION, event.description)
|
||||||
put(Events.EVENT_LOCATION, event.location)
|
put(Events.EVENT_LOCATION, event.location)
|
||||||
put(Events.STATUS, Events.STATUS_CONFIRMED)
|
put(Events.STATUS, Events.STATUS_CONFIRMED)
|
||||||
put(Events.AVAILABILITY, event.availability)
|
put(Events.AVAILABILITY, event.availability)
|
||||||
|
|
||||||
|
val eventType = eventsHelper.getEventTypeWithCalDAVCalendarId(calendarId)!!
|
||||||
|
val colors = getAvailableCalDAVCalendarColors(eventType, Colors.TYPE_EVENT)
|
||||||
|
if (event.color == 0) {
|
||||||
|
put(Events.EVENT_COLOR_KEY, "")
|
||||||
|
} else {
|
||||||
|
put(Events.EVENT_COLOR_KEY, colors[event.color])
|
||||||
|
}
|
||||||
|
|
||||||
val repeatRule = Parser().getRepeatCode(event)
|
val repeatRule = Parser().getRepeatCode(event)
|
||||||
if (repeatRule.isEmpty()) {
|
if (repeatRule.isEmpty()) {
|
||||||
putNull(Events.RRULE)
|
putNull(Events.RRULE)
|
||||||
|
@@ -337,7 +337,10 @@ class EventsHelper(val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
it.color = eventTypeColors.get(it.eventType) ?: context.getProperPrimaryColor()
|
|
||||||
|
if (it.color == 0) {
|
||||||
|
it.color = eventTypeColors.get(it.eventType) ?: context.getProperPrimaryColor()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(events)
|
callback(events)
|
||||||
|
@@ -507,10 +507,63 @@
|
|||||||
android:importantForAccessibility="no" />
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/event_caldav_calendar_image"
|
android:id="@+id/event_caldav_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_alignBottom="@+id/event_caldav_color_holder"
|
||||||
|
android:layout_marginStart="@dimen/normal_margin"
|
||||||
|
android:padding="@dimen/medium_margin"
|
||||||
|
android:src="@drawable/ic_color_vector" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/event_caldav_color_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/event_availability_divider"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:layout_toEndOf="@+id/event_caldav_color_image"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/event_color_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/small_margin"
|
||||||
|
android:layout_marginEnd="@dimen/medium_margin"
|
||||||
|
android:layout_toStartOf="@+id/event_caldav_color"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
android:text="@string/change_color"
|
||||||
|
android:textSize="@dimen/day_text_size" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/event_caldav_color"
|
||||||
|
android:layout_width="@dimen/color_sample_size"
|
||||||
|
android:layout_height="@dimen/color_sample_size"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginEnd="@dimen/activity_margin"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/event_caldav_color_divider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/divider_height"
|
||||||
|
android:layout_below="@+id/event_caldav_color_image"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:background="@color/divider_grey"
|
||||||
|
android:importantForAccessibility="no" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/event_caldav_calendar_image"
|
||||||
|
android:layout_width="@dimen/smaller_icon_size"
|
||||||
|
android:layout_height="@dimen/smaller_icon_size"
|
||||||
|
android:layout_below="@+id/event_caldav_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"
|
||||||
@@ -523,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_availability_divider"
|
android:layout_below="@+id/event_caldav_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">
|
||||||
|
Reference in New Issue
Block a user