Skip to content

fix(tips): match tip card sizing to iOS on the screen and camera - #1161

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/tip-card-ios-sizing-parity
Jul 27, 2026
Merged

fix(tips): match tip card sizing to iOS on the screen and camera#1161
bmc08gt merged 1 commit into
code/cashfrom
fix/tip-card-ios-sizing-parity

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

The tip card rendered at inconsistent sizes. The My Tip Card screen and the scanner/camera each fed TipCard a different width constraint, and the card sized its QR off that constraint (maxWidth * 0.65) — so the two Android surfaces never matched each other, and neither matched iOS. iOS renders the card noticeably smaller/portrait; ours was wider and squarer.

Fix

Port iOS's TipcardView sizing model, where the card width is primary and every inner metric derives from it (matching Flipcash/Core/Screens/Main/Tips/TipcardView.swift):

Metric Formula
Aspect ratio 1.16 (portrait)
QR / scannable code 0.68 × width (square)
Corner radius 0.08 × width
Avatar 0.09 × width
Name-row top gap 0.06 × height

Per-surface width, matching iOS:

  • My Tip Card screen — fixed, device-independent 300dp (iOS TipcardScreen.cardWidth = 300)
  • Scanner / cameramin(canvasWidth × 0.82, 320dp) (iOS BillCanvas.tipcardSize)

Threaded via a new cardWidth: Dp? param on TipCard / ScannableRenderer (null → camera formula; the screen pins 300dp).

Result (393dp/pt device)

Surface iOS card / QR Android now
My Tip Card screen 300 / 204 300 / 204
Camera 289 / 196 289 / 196

Notes

  • Tint opacity is intentionally left as-is (Android camera uses its own frosted-blur / opaque-fallback path); this PR is sizing only.
  • The camera keeps its existing BiasAlignment vertical positioning; only the card's interior sizing changed.

Test

  • :shared:bills, :features:tipping, :features:scanner, :features:currency-creator compile clean.

The tip card rendered at inconsistent sizes: the "My Tip Card" screen and
the scanner/camera each fed TipCard a different width constraint, and the
card sized its QR off that constraint (maxWidth * 0.65), so the two never
matched — nor did either match iOS.

Port iOS's TipcardView sizing model, where the card width is primary and
everything derives from it:
- aspect ratio 1.16, QR = 0.68 * width, corner = 0.08 * width,
  avatar = 0.09 * width, name-row top gap = 0.06 * height
- "My Tip Card" screen pins a fixed, device-independent 300dp width
- scanner/camera uses min(canvasWidth * 0.82, 320dp)

This yields the same card proportions on both surfaces and matches iOS
(300/204 on the screen, 289/196 on the camera for a 393dp device).
@github-actions github-actions Bot added area: payments Payments, transfers, intents, billing type: fix Bug fix labels Jul 27, 2026
@bmc08gt
bmc08gt merged commit 123b1f3 into code/cash Jul 27, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/tip-card-ios-sizing-parity branch July 27, 2026 18:14
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 type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant