feat(ui): add USDF "$" watermark to the Dollars token card - #1250
Merged
Conversation
Draw an oversized bold "$" glyph bleeding off the top-right of the gold USDF/Dollars card, using mix-blend "overlay" at 30% so it reads as an emboss on the gradient rather than a solid mark (Figma 9120:15335). Gated to USDF (token.address == Mint.usdf); other tokens are unchanged. The glyph is pre-measured with a TextMeasurer and its font size is expressed in dp (via toSp) so it scales with the card height and ignores the user font scale. It's drawn in a drawWithContent layer that sits above the gradient, is clipped to the card's rounded shape, and ignores the content padding. Adds a render-only Robolectric harness (TokenCardWatermarkScreenshotTest) that captures the card to build/screenshots/ for eyeballing the mark without an emulator.
Replace the hardcoded 16.dp top-bleed / right-inset constants with CodeTheme.dimens.inset so the watermark tracks the card's content inset and flips to 16dp automatically on the 4pt-grid switch.
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.
What
Adds the oversized
$watermark to the gold USDF / Dollars token card.A bold white
$glyph bleeds off the top-right of the card, drawn with mix-blend overlay at 30% opacity so it reads as an emboss on the gradient rather than a solid mark.Details
token.address == Mint.usdfget the mark; all other tokens are unchanged.TextMeasurer; font size is expressed in dp (viatoSp) so it scales with the cardheightand ignores the user's font scale.drawWithContentlayer that sits above the gradient, is clipped to the card's rounded shape, and ignores the content padding.WatermarkFontScale,WatermarkAlpha, top bleed / right inset) are proportional to the card height, matching the Figma proportions (~213px glyph on a ~214px card).Testing
Adds
TokenCardWatermarkScreenshotTest— a render-only Robolectric harness (native graphics) that captures the card tobuild/screenshots/so the mark can be eyeballed without an emulator. It's not an assertion test.Verified visually: the gold Dollars card shows the
$; a non-USDF (USDC) card renders with no watermark.