-
Notifications
You must be signed in to change notification settings - Fork 3
AndroidEvent: move companion object methods to where they belong to #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 relocates AndroidEvent companion object methods into AndroidCalendar, cleans up related imports, and updates tests to use the new API.
- Moved
numDirectInstances,numInstances, and deletion helper fromAndroidEventcompanion intoAndroidCalendar - Added
updateEventinAndroidCalendarfor row updates - Refactored tests and
InitCalendarProviderRuleto callcalendar.numInstances(...)and removed deprecated companion tests
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/main/kotlin/at/bitfire/synctools/test/InitCalendarProviderRule.kt | Replaced AndroidEvent.numInstances calls with calendar.numInstances, removed unused import |
| lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt | Added updateEvent, numDirectInstances, and numInstances methods for event-instance logic |
| lib/src/main/kotlin/at/bitfire/ical4android/AndroidEvent.kt | Removed companion object methods (markAsDeleted, instance counters) and related imports |
| lib/src/androidTest/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendarTest.kt | Expanded tests for direct/total instance counts, adjusted assertions for Android version differences |
| lib/src/androidTest/kotlin/at/bitfire/ical4android/impl/TestCalendar.kt | Added withColors parameter to findOrCreate to control color provisioning |
| lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidEventTest.kt | Updated to use TestCalendar.findOrCreate(..., withColors = true) and removed companion-based tests |
Comments suppressed due to low confidence (1)
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt:192
- Typo in comment: change "occurence" to "occurrence" for correct spelling.
// if this event doesn't have a last occurrence, it's endless and always has instances
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt
Outdated
Show resolved
Hide resolved
lib/src/androidTest/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendarTest.kt
Show resolved
Hide resolved
bb2a273 to
c54fafe
Compare
sunkup
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes 👍
Move the remaining
AndroidEventcompanion object methods toAndroidCalendarso that the way is free for refactoring the actual event data access.