Skip to content

Fix: Extended Event custom icon rendering and sample update - #53

Merged
pushpalroy merged 5 commits into
mainfrom
fix_extended_event_point_issue
Aug 10, 2025
Merged

Fix: Extended Event custom icon rendering and sample update#53
pushpalroy merged 5 commits into
mainfrom
fix_extended_event_point_issue

Conversation

@pushpalroy

@pushpalroy pushpalroy commented Aug 10, 2025

Copy link
Copy Markdown
Owner

Overview

This PR addresses issues (#47) with the rendering of custom icons in JetLimeExtendedEvent and updates the ExtendedVerticalTimeLine sample to correctly showcase all event point types.

Bug Fixes in JetLimeExtendedEvent:

  • Custom Icon Background: Ensured that the base circle (defined by pointColor) and the fill (defined by pointFillColor and fillPercent) are drawn correctly behind custom icons. Previously, custom icons would appear without their intended background/fill.
  • Custom Icon Tinting: Corrected the application of tint to custom icons. The tint specified in EventPointType.custom(icon = ..., tint = ...) is now properly applied.
  • Fill Percentage Calculation: Refined the calculation for the radius of the filled portion of an event point to radius * fillPercent for improved clarity and robustness.

Sample Updates (ExtendedVerticalTimeLine & EventContent.kt):

  • Showcase All Point Types: The decidePointType() function in the sample's EventContent.kt has been updated to include EventPointType.custom, allowing the ExtendedVerticalTimeLine to demonstrate Default, filled, and custom point types.
  • Custom Icon Visibility: Resolved a visibility issue where the custom icon (using painterResource) was not visible in the sample, particularly in dark mode. This was due to the icon tint (MaterialTheme.colorScheme.onPrimaryContainer) not contrasting with the event point's background color (Color.White). The tint for the sample's custom icon has been changed to MaterialTheme.colorScheme.primary to ensure visibility across themes.
  • Composable decidePointType: The decidePointType() function is now correctly marked as @Composable as it utilizes painterResource.

These changes ensure that JetLimeExtendedEvent renders points consistently with JetLimeEvent and that the sample accurately reflects the library's capabilities.

Screenshot of the fixed version:

Screenshot_20250810_233546

@pushpalroy
pushpalroy marked this pull request as ready for review August 10, 2025 18:08
@pushpalroy
pushpalroy requested a review from Copilot August 10, 2025 18:09

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes custom icon rendering issues in JetLimeExtendedEvent and updates the sample app to properly showcase all event point types. The changes address bugs where custom icons weren't displaying their background/fill correctly and where tinting wasn't applied properly.

  • Fixed custom icon background and tinting in JetLimeExtendedEvent
  • Updated sample to demonstrate all event point types including custom icons
  • Improved icon visibility across different themes

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
jetlime/src/commonMain/kotlin/com/pushpal/jetlime/JetLimeExtendedEvent.kt Fixes custom icon rendering by ensuring background circles are drawn and applying proper tinting
sample/composeApp/src/commonMain/kotlin/timelines/event/EventContent.kt Updates sample to include custom event point types and adds @composable annotation
sample/composeApp/src/commonMain/kotlin/timelines/ExtendedVerticalTimeLine.kt Adds styling configuration to improve custom icon visibility
README.md Updates version badges for Compose and Kotlin

@pushpalroy pushpalroy self-assigned this Aug 10, 2025
@pushpalroy
pushpalroy merged commit 2239132 into main Aug 10, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants