diff --git a/app/build.gradle b/app/build.gradle index 416b936f4..0c81ee269 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,7 +64,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.32.6' + implementation 'com.simplemobiletools:commons:5.32.7' implementation 'joda-time:joda-time:2.10.1' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt index bf1e0e800..f3440ee55 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt @@ -868,7 +868,7 @@ class EventActivity : SimpleActivity() { if (eventType != null) { runOnUiThread { event_type.text = eventType.title - event_type_color.setFillWithStroke(eventType.color, config.backgroundColor) + event_type_color.setFillWithStroke(eventType.color, config.backgroundColor, getCornerRadius()) } } } @@ -933,7 +933,7 @@ class EventActivity : SimpleActivity() { val calendarColor = eventsHelper.getEventTypeWithCalDAVCalendarId(currentCalendar.id)?.color ?: currentCalendar.color runOnUiThread { - event_caldav_calendar_color.setFillWithStroke(calendarColor, config.backgroundColor) + event_caldav_calendar_color.setFillWithStroke(calendarColor, config.backgroundColor, getCornerRadius()) event_caldav_calendar_name.apply { text = currentCalendar.displayName setPadding(paddingLeft, paddingTop, paddingRight, resources.getDimension(R.dimen.tiny_margin).toInt()) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/FilterEventTypeAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/FilterEventTypeAdapter.kt index 2586b6520..c2bee12bd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/FilterEventTypeAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/FilterEventTypeAdapter.kt @@ -8,12 +8,14 @@ import com.simplemobiletools.calendar.pro.activities.SimpleActivity import com.simplemobiletools.calendar.pro.extensions.config import com.simplemobiletools.calendar.pro.models.EventType import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor +import com.simplemobiletools.commons.extensions.getCornerRadius import com.simplemobiletools.commons.extensions.setFillWithStroke import kotlinx.android.synthetic.main.filter_event_type_view.view.* import java.util.* class FilterEventTypeAdapter(val activity: SimpleActivity, val eventTypes: List, val displayEventTypes: Set) : RecyclerView.Adapter() { + private val cornerRadius = activity.getCornerRadius() private val selectedKeys = HashSet() init { @@ -55,7 +57,7 @@ class FilterEventTypeAdapter(val activity: SimpleActivity, val eventTypes: List< filter_event_type_checkbox.isChecked = isSelected filter_event_type_checkbox.setColors(activity.config.textColor, activity.getAdjustedPrimaryColor(), activity.config.backgroundColor) filter_event_type_checkbox.text = eventType.getDisplayTitle() - filter_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor) + filter_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor, cornerRadius) filter_event_type_holder.setOnClickListener { viewClicked(!isSelected, eventType) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/ManageEventTypesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/ManageEventTypesAdapter.kt index 26b18c063..99bdcc1ed 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/ManageEventTypesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/ManageEventTypesAdapter.kt @@ -13,6 +13,7 @@ import com.simplemobiletools.calendar.pro.models.EventType import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog +import com.simplemobiletools.commons.extensions.getCornerRadius import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.models.RadioItem @@ -22,6 +23,7 @@ import java.util.* class ManageEventTypesAdapter(activity: SimpleActivity, val eventTypes: ArrayList, val listener: DeleteEventTypesListener?, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) { + private val cornerRadius = activity.getCornerRadius() init { setupDragListener(true) @@ -69,7 +71,7 @@ class ManageEventTypesAdapter(activity: SimpleActivity, val eventTypes: ArrayLis view.apply { event_item_frame.isSelected = selectedKeys.contains(eventType.id?.toInt()) event_type_title.text = eventType.getDisplayTitle() - event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor) + event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor, cornerRadius) event_type_title.setTextColor(textColor) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/EditEventTypeDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/EditEventTypeDialog.kt index 418d2b330..e8096b897 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/EditEventTypeDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/EditEventTypeDialog.kt @@ -55,7 +55,7 @@ class EditEventTypeDialog(val activity: Activity, var eventType: EventType? = nu } private fun setupColor(view: ImageView) { - view.setFillWithStroke(eventType!!.color, activity.config.backgroundColor) + view.setFillWithStroke(eventType!!.color, activity.config.backgroundColor, activity.getCornerRadius()) } private fun eventTypeConfirmed(title: String, dialog: AlertDialog) { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt index 12fa27f61..2b575c0f0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/ImportEventsDialog.kt @@ -10,6 +10,7 @@ import com.simplemobiletools.calendar.pro.extensions.eventsHelper import com.simplemobiletools.calendar.pro.helpers.IcsImporter import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.* import com.simplemobiletools.calendar.pro.helpers.REGULAR_EVENT_TYPE_ID +import com.simplemobiletools.commons.extensions.getCornerRadius import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.toast @@ -86,7 +87,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal val eventType = activity.eventTypesDB.getEventTypeWithId(currEventTypeId) activity.runOnUiThread { view.import_event_type_title.text = eventType!!.getDisplayTitle() - view.import_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor) + view.import_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor, activity.getCornerRadius()) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/SelectEventCalendarDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/SelectEventCalendarDialog.kt index f01100d6d..1e70f1f4b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/SelectEventCalendarDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/dialogs/SelectEventCalendarDialog.kt @@ -11,6 +11,7 @@ import com.simplemobiletools.calendar.pro.extensions.config import com.simplemobiletools.calendar.pro.extensions.eventsHelper import com.simplemobiletools.calendar.pro.helpers.STORED_LOCALLY_ONLY import com.simplemobiletools.calendar.pro.models.CalDAVCalendar +import com.simplemobiletools.commons.extensions.getCornerRadius import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.updateTextColors @@ -60,7 +61,7 @@ class SelectEventCalendarDialog(val activity: Activity, val calendars: List