feat(push-templates): add image border configurability across all pus… - #1044
Draft
deeksha-rgb wants to merge 5 commits into
Draft
feat(push-templates): add image border configurability across all pus…#1044deeksha-rgb wants to merge 5 commits into
deeksha-rgb wants to merge 5 commits into
Conversation
…h templates New JSON keys: pt_img_border_clr, pt_img_corner_radius, pt_img_border_width Templates updated: - Basic (BigImageContentView) - Auto Carousel (AutoCarouselContentView) - Manual Carousel (ManualCarouselContentView) - Rating (RatingContentView) - Five Icons (FiveIconBigContentView, FiveIconSmallContentView) - Product Display (ProductDisplayLinearBigContentView) - Zero Bezel (ZeroBezelBigContentView, ZeroBezelSmallContentView) - Timer (TimerBigContentView) - Vertical Image (VerticalImageBigContentView, VerticalImageSmallContentView) Border processing via bitmap post-processing (Canvas clipPath + drawRoundRect) to work within RemoteViews constraints. All params optional with safe defaults for full backward compatibility. GIF frames processed individually. pt_img_border_clr registered in COLOR_KEYS for dark mode adaptation.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
getImageDataListFromExtras used key.contains("pt_img") which also matched
pt_img_border_clr, pt_img_corner_radius, pt_img_border_width — causing
extra phantom images to be added to the list. Templates requiring an exact
image count (e.g. product display needs exactly 3) silently dropped the
notification as a result.
Now only keys like pt_img1, pt_img2, pt_img3 are matched (digit immediately
after "pt_img").
When the deep link list was empty and the user swiped to a new position, the old condition (deepLinkList.size() < newPosition) evaluated to true and called deepLinkList.get(0) on an empty list, throwing an IndexOutOfBoundsException. The exception was silently caught, which meant notificationManager.notify() was never called and the carousel appeared frozen on the same image. Restructured the conditions to check isEmpty() first before any index access.
…tion images Replaced the Path.clipPath approach with BitmapShader for rendering rounded corners on notification images. BitmapShader produces smooth anti-aliased edges without the jagged artifacts that clipPath causes on lower-end devices. When border or corner radius is active (imageBorderData.isActive), the scale type is forced to FIT_CENTER so the full image is visible within the container and the rounded corners are not clipped by the view edges. Without border, the original scale type set by the sender is respected. Also recycled intermediate GIF frame bitmaps after processing to reduce memory pressure, and guarded against setting an empty deep link string on the manual carousel initial render.
The collapsed thumbnail (40dp) was receiving the same border and corner radius as the expanded image. At that size any corner radius looks like a circle and the border is too thick, so border data is no longer passed to the collapsed media, keeping its appearance unchanged. The v31 layout for the expanded view was missing paddingStart on the image container, causing the image to sit flush against the left edge of the notification card with no breathing room. Added matching paddingStart and vertical margins to align with the pre-v31 layout behavior. Also fixed the collapsed v31 layout where paddingStart was a hardcoded 4dp instead of the shared padding_horizontal dimension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…h templates
New JSON keys: pt_img_border_clr, pt_img_corner_radius, pt_img_border_width
Templates updated:
Border processing via bitmap post-processing (Canvas clipPath + drawRoundRect) to work within RemoteViews constraints. All params optional with safe defaults for full backward compatibility. GIF frames processed individually. pt_img_border_clr registered in COLOR_KEYS for dark mode adaptation.