Skip to content

feat(wallet): iOS-parity Receive screen — text input + note + invoice / address tabs#580

Open
dmnyc wants to merge 1 commit into
barrydeen:mainfrom
dmnyc:feat/wallet-receive-redesign
Open

feat(wallet): iOS-parity Receive screen — text input + note + invoice / address tabs#580
dmnyc wants to merge 1 commit into
barrydeen:mainfrom
dmnyc:feat/wallet-receive-redesign

Conversation

@dmnyc
Copy link
Copy Markdown
Contributor

@dmnyc dmnyc commented May 26, 2026

Summary

Ports the iOS ReceiveInvoiceSheet layout to Android. The orange numpad-style Receive screen is replaced with a form: amount text field, optional note field, and a Create invoice CTA. When the user has a Spark lightning address, an Invoice / Lightning Address segmented control appears at the top and the address tab renders the QR + Copy / Share row inline.

Before / After:

iOS (target) Android (this PR)
Form: AMOUNT + NOTE + Create invoice Same layout, Material 3 components, surface variant rounded fields

Changes

  • WalletScreen.kt
    • Rewrites ReceiveAmountContent from a SatsNumpad driver to a BasicTextField-based form: AMOUNT field (numeric keyboard, "0" placeholder, "sats" or fiat suffix), NOTE field (placeholder "For coffee, etc."), Create invoice button.
    • In fiat mode, live sats conversion is shown below the amount.
    • Adds optional Invoice / Lightning Address SingleChoiceSegmentedButtonRow at the top — only rendered when walletViewModel.lightningAddress is non-blank.
    • Adds ReceiveAddressBlock composable: QR card with the address centered below + Copy / Share row beneath. Reuses the same QR generation path as LightningAddressQRContent.
  • WalletViewModel.kt
    • generateInvoice now takes (amountSats: Long, description: String = "") and passes the description to WalletProvider.makeInvoice. The description ends up in the BOLT11 invoice memo.
    • Adds setReceiveAmount(value: String) for the new text-input path. The old updateReceiveAmount(digit) / receiveAmountBackspace() setters stay untouched since the Send flow still uses them.
  • values/strings.xml — new English strings:
    • wallet_receive_invoice_tab = "Invoice"
    • wallet_receive_address_tab = "Lightning Address"
    • wallet_receive_amount_label = "AMOUNT"
    • wallet_receive_note_label = "NOTE (OPTIONAL)"
    • wallet_receive_note_placeholder = "For coffee, etc."
    • wallet_receive_create_invoice = "Create invoice"
    • Translations to follow in a separate PR.

What's NOT in this PR

Test plan

  • Build (./gradlew assembleDebug) on clean main base
  • Device tested on R5CW60D6EJF — design approved
  • Invoice creation succeeds with and without note (note appears in BOLT11 memo)
  • Fiat mode shows "≈ N sats" supporting line and creates invoice with the converted sats amount
  • Segmented control appears only when a lightning address is set up; switching tabs shows the address QR + Copy / Share inline
  • Create invoice button is disabled (gray) when amount is empty or zero

Reference

iOS: wisp-ios/WalletView.swiftReceiveInvoiceSheet (~lines 984–1230)

… / address tabs

Replaces the orange numpad-style Receive screen with a form layout matching
iOS ReceiveInvoiceSheet:

- AMOUNT label + single text field (numeric keyboard, "0" placeholder,
  "sats" or fiat suffix). In fiat mode shows the live sats conversion
  below the field.
- NOTE (OPTIONAL) label + single-line text field with "For coffee, etc."
  placeholder — plumbed through generateInvoice(amountSats, description)
  so the note is embedded in the BOLT11 invoice description.
- Create invoice full-width button; disabled (gray) until the amount
  parses to > 0 sats.
- Invoice / Lightning Address segmented control at the top, shown only
  when the user has a Spark lightning address. Switching to the address
  tab renders the address QR + Copy / Share row inline (no nav churn).

Touches:

- WalletScreen.kt: rewrites ReceiveAmountContent; adds ReceiveAddressBlock.
  Uses BasicTextField for the hero amount field (custom placeholder
  inside a rounded surface) and a second BasicTextField for the note.
- WalletViewModel.kt: generateInvoice now takes (amountSats, description);
  adds setReceiveAmount(value) for the new text-input path. The existing
  digit-by-digit updateReceiveAmount / receiveAmountBackspace stay
  untouched (still used by Send numpad).
- strings.xml: new English strings for the labels / placeholders / CTA.
  Translations to follow.

Tested on device.
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.

1 participant