Skip to content

feat(tips): frost the tip card with a translucent fill and blurred backdrop#1150

Merged
bmc08gt merged 1 commit into
code/cashfrom
feat/tip-card-frosted-blur
Jul 24, 2026
Merged

feat(tips): frost the tip card with a translucent fill and blurred backdrop#1150
bmc08gt merged 1 commit into
code/cashfrom
feat/tip-card-frosted-blur

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

What & why

The tip card rendered with two different opaque near-blacks depending on where it appeared — the theme Brand color in most places and a hardcoded 0xFF101011 override on the My Tip Card screen. Per the design (Figma: #000000 fill @ 36%, radius 30, background blur 40), the intent is a single translucent fill with a frosted-glass backdrop, not solid opaque colors.

Changes

  • Unified color/opacity. Theme tipCard → black; removed the 0xFF101011 override. TipCard applies one shared alpha to the fill, so translucency is identical at every call site by construction.
  • Backdrop hook. New LocalTipCardBackdrop renders an optional layer under the fill, clipped to the card's rounded bounds. Haze (dev.chrisbanes.haze) is added to shared:bills for Compose-content backdrops.
  • Scanner camera frost. Haze can't blur the camera (a CameraX PreviewView / AndroidView, outside the Compose layer), so CodeScanner exposes its PreviewView and the scanner snapshots PreviewView.bitmap once when a tip card appears, drawing it blurred behind the card.
  • Perf. The snapshot is a single frozen frame, not a live loop — a continuous main-thread getBitmap readback stuttered the live preview even on flagship hardware (e.g. S25). One readback, masked by the card's enter animation.
  • Graceful degradation. The frosted backdrop is gated to capable devices (API 31+ and not low-RAM). Modifier.blur needs API 31+; below that (and on low-RAM devices) the card renders an opaque approximation of the frosted tone (TipCardOpaqueFallback) with no camera capture at all.

Who sees what

  • Frosted (frozen snapshot): Android 12+ / non-low-RAM — the majority.
  • Opaque fallback: Android 10–11 (no blur API) and any OS-flagged low-RAM device.

Tuning knobs (single constants)

  • TipCardAlpha (frosted card default alpha), the 0.36f override on the My Tip Card screen, TipCardBlurRadius, and TipCardOpaqueFallback.

Testing notes

  • All touched modules compile (shared:bills, features:scanner, features:tipping, ui:scanner, ui:theme).

…ckdrop

Unify the tip card's color/opacity and give it a frosted-glass look over
the content behind it.

- Fix the differing per-usage colors: the card rendered as two opaque
  near-blacks (theme Brand vs a hardcoded 0xFF101011 override in the My
  Tip Card screen). It now uses a single translucent fill (theme black)
  with one shared alpha applied in TipCard, so it reads identically
  everywhere.
- Add a backdrop hook (LocalTipCardBackdrop) rendered under the fill and
  clipped to the card's rounded bounds; Haze is wired into shared:bills
  for future Compose-content backdrops.
- Scanner: Haze can't blur the camera (an AndroidView outside the Compose
  layer), so snapshot PreviewView.bitmap once when the card appears and
  draw it blurred behind the card. A single frozen frame avoids the
  per-frame main-thread readback that stuttered the live preview even on
  flagship hardware.
- Gate the frosted backdrop to capable devices (API 31+ and not low-RAM);
  elsewhere the card renders an opaque approximation of the frosted tone.
@github-actions github-actions Bot added type: feature New functionality area: payments Payments, transfers, intents, billing area: ui Compose UI, theme, components, resources area: scanner QR/Kikcode scanning, camera and removed type: feature New functionality labels Jul 24, 2026
@bmc08gt
bmc08gt merged commit 931aa4a into code/cash Jul 24, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the feat/tip-card-frosted-blur branch July 24, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: payments Payments, transfers, intents, billing area: scanner QR/Kikcode scanning, camera area: ui Compose UI, theme, components, resources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant