Skip to content

feat(push-templates): add image border configurability across all pus… - #1044

Draft
deeksha-rgb wants to merge 5 commits into
developfrom
task/push-image-border-configurability
Draft

feat(push-templates): add image border configurability across all pus…#1044
deeksha-rgb wants to merge 5 commits into
developfrom
task/push-image-border-configurability

Conversation

@deeksha-rgb

Copy link
Copy Markdown
Contributor

…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.

…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.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 717b0e93-92e0-451c-aeaf-a0080e062370

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shubhambjadhavar

shubhambjadhavar commented Jul 29, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 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.
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