fix(tips): match tip card sizing to iOS on the screen and camera - #1161
Merged
Conversation
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).
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.
Problem
The tip card rendered at inconsistent sizes. The My Tip Card screen and the scanner/camera each fed
TipCarda 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
TipcardViewsizing model, where the card width is primary and every inner metric derives from it (matchingFlipcash/Core/Screens/Main/Tips/TipcardView.swift):1.16(portrait)0.68 × width(square)0.08 × width0.09 × width0.06 × heightPer-surface width, matching iOS:
300dp(iOSTipcardScreen.cardWidth = 300)min(canvasWidth × 0.82, 320dp)(iOSBillCanvas.tipcardSize)Threaded via a new
cardWidth: Dp?param onTipCard/ScannableRenderer(null → camera formula; the screen pins300dp).Result (393dp/pt device)
Notes
BiasAlignmentvertical positioning; only the card's interior sizing changed.Test
:shared:bills,:features:tipping,:features:scanner,:features:currency-creatorcompile clean.