Skip to content

Move logic from AndroidCalendar companion object to AndroidCalendarProvider#28

Merged
rfc2822 merged 13 commits intomainfrom
27-move-logic-from-androidcalendar-companion-object-to-androidcalendarstore
Jul 3, 2025
Merged

Move logic from AndroidCalendar companion object to AndroidCalendarProvider#28
rfc2822 merged 13 commits intomainfrom
27-move-logic-from-androidcalendar-companion-object-to-androidcalendarstore

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Jul 1, 2025

Preparation for bitfireAT/davx5-ose#1560

@rfc2822 rfc2822 self-assigned this Jul 1, 2025
@rfc2822 rfc2822 added the refactoring Quality improvement of existing functions label Jul 1, 2025
@rfc2822 rfc2822 linked an issue Jul 1, 2025 that may be closed by this pull request
@rfc2822 rfc2822 force-pushed the 27-move-logic-from-androidcalendar-companion-object-to-androidcalendarstore branch 2 times, most recently from 91b2f38 to 31236a3 Compare July 1, 2025 19:35
@rfc2822 rfc2822 force-pushed the 27-move-logic-from-androidcalendar-companion-object-to-androidcalendarstore branch from 31236a3 to e448038 Compare July 1, 2025 19:56
rfc2822 added 4 commits July 2, 2025 11:14
…droidcalendar-companion-object-to-androidcalendarstore
…-object-to-androidcalendarstore

# Conflicts:
#	lib/src/androidTest/kotlin/at/bitfire/ical4android/impl/TestJtxCollection.kt
#	lib/src/androidTest/kotlin/at/bitfire/ical4android/util/MiscUtilsTest.kt
#	lib/src/androidTest/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendarTest.kt
#	lib/src/main/kotlin/at/bitfire/ical4android/AndroidCalendar.kt
#	lib/src/main/kotlin/at/bitfire/ical4android/AndroidEvent.kt
#	lib/src/main/kotlin/at/bitfire/vcard4android/AndroidAddressBook.kt
@rfc2822 rfc2822 force-pushed the 27-move-logic-from-androidcalendar-companion-object-to-androidcalendarstore branch from e306550 to 583fc07 Compare July 2, 2025 14:59
@rfc2822 rfc2822 requested a review from Copilot July 2, 2025 15:47
@rfc2822 rfc2822 marked this pull request as ready for review July 2, 2025 15:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extracts calendar creation and lookup logic into a dedicated AndroidCalendarProvider class and updates all callers (production code and tests) to use it. It also adjusts batch operation logging and modernizes minor enum and logging patterns.

  • Introduce AndroidCalendarProvider for calendar CRUD operations
  • Refactor AndroidEvent, InitCalendarProviderRule and tests to use the new provider
  • Simplify batch‐operation logging and update Css3Color parsing and iteration

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
InitCalendarProviderRule.kt Use AndroidCalendarProvider and instance property for account
CalendarBatchOperation.kt Moved to storage.calendar package and adjusted imports
AndroidCalendarProvider.kt New provider class implementing calendar CRUD methods
AndroidCalendar.kt (storage/calendar) New storage model wrapping ContentProviderClient
BatchOperation.kt Simplified commit logging to use list formatting
Css3Color.kt Updated parsing to toColorInt(), replaced values() with entries
Task.kt Added import of new Css3Color
JtxICalObject.kt Added import of new Css3Color
Event.kt Added import of new Css3Color
AndroidEvent.kt Switched from provider to client, updated imports
CalendarBatchOperationTest.kt Updated package and calendar contract references
AndroidCalendarTest.kt Refactored to use AndroidCalendarProvider and client
TestCalendar.kt Updated to use AndroidCalendarProvider
AndroidEventTest.kt Refactored to use InitCalendarProviderRule.initialize() and client
LoggingTestRunner.kt Removed default handlers before adding LogcatHandler
build.gradle.kts Added Kotlin test dependency

@rfc2822 rfc2822 requested a review from sunkup July 2, 2025 15:54
@rfc2822 rfc2822 merged commit a365b91 into main Jul 3, 2025
9 checks passed
@rfc2822 rfc2822 deleted the 27-move-logic-from-androidcalendar-companion-object-to-androidcalendarstore branch July 3, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move logic from AndroidCalendar companion object to AndroidCalendarStore

2 participants