Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
a1c412d
feat(payments): add the Advanced payments screen and route to it when…
HashEngineering Nov 4, 2026
c24a3cd
feat(payments): build the Advanced Receive tab to the Figma design
HashEngineering Nov 4, 2026
f766d81
revert(payments): keep the Receive buttons to the design spec
HashEngineering Nov 4, 2026
b2b1be7
feat(payments): offer Specify amount on every Advanced Receive tab
HashEngineering Nov 4, 2026
a1b5196
refactor(payments): simplify the Advanced payments and Receive code
HashEngineering Nov 4, 2026
9b0de6c
fix(payments): keep the restored Receive page on rotation; stop loggi…
HashEngineering Nov 4, 2026
de052a8
fix(ui): place the fit-content picker thumb by absolute offset so RTL…
HashEngineering Nov 4, 2026
1e8cf0f
fix(ui): match the Receive card to the updated Figma (MO-1123)
HashEngineering Nov 6, 2026
316d189
fix(ui): draw Compose QR codes without bitmap filtering
HashEngineering Nov 9, 2026
59a8766
Merge remote-tracking branch 'origin/feat/advanced-mode-setting' into…
HashEngineering Nov 10, 2026
f20030c
Merge branch 'feat/advanced-mode-setting' into feat/advanced-payments…
HashEngineering Nov 10, 2026
66694e1
refactor(payments): cut per-update work on the Receive page and picker
HashEngineering Nov 10, 2026
4ee5970
fix(payments): let Receive scroll clear of the bottom bar; RTL picker…
HashEngineering Nov 11, 2026
fd6ee67
fix(payments): resolve amount-request addresses from the wallet; revi…
HashEngineering Nov 11, 2026
263f160
fix(payments): bring the Identity tab back after a failed identity read
HashEngineering Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions common/src/main/java/org/dash/wallet/common/data/BaseConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ abstract class BaseConfig(
produceMigrations = { migrations }
)

protected val data = context.dataStore.data
/**
* The store's preferences WITHOUT [data]'s IOException rescue: an unreadable
* store arrives as the THROW it was, not as [emptyPreferences]. The one source
* for [data] and the `*PreservingErrors` reads; collect it (with a retry such as
* `retryReadErrors`) where "could not read" must not pass for "never written".
*/
protected val dataPreservingErrors: Flow<Preferences> = context.dataStore.data

protected val data = dataPreservingErrors
.catch { exception ->
if (exception is IOException) {
emit(emptyPreferences())
Expand Down Expand Up @@ -146,7 +154,7 @@ abstract class BaseConfig(
* IOException, for the caller to fail closed on.
*/
open fun <T> observePreservingErrors(key: Preferences.Key<T>): Flow<T?> {
return context.dataStore.data.map { preferences -> preferences[key] }
return dataPreservingErrors.map { preferences -> preferences[key] }
}

open suspend fun <T> get(key: Preferences.Key<T>): T? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,15 @@ object MyTheme {
fontWeight = FontWeight(400)
)

// Callout - the "Text/Callout" style (e.g. the Receive card's address value, Figma
// 7062:49310): BodyLarge's size with a tighter 21sp line height.
val Callout = TextStyle(
fontSize = 16.sp,
lineHeight = 21.sp,
fontFamily = interRegular,
fontWeight = FontWeight(400)
)

// Footnote styles - secondary/explanatory text. From the "New/Text" styles that design
// system components apply (e.g. SystemMessage's description, node 8378:445); not yet on
// the documented typography page (node 5856:804). Same metrics as the deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class ReceiveInfoView(context: Context, attrs: AttributeSet?) : ConstraintLayout
private var paymentRequestUri: String = ""
private var username: String? = null

/** Set by [setPaymentRequest]: the QR content as given, never built by [PaymentURI]. */
private var presetPaymentRequest: String? = null

init {
binding = ReceiveInfoViewBinding.inflate(LayoutInflater.from(context), this)
val attrsArray = context.obtainStyledAttributes(attrs, R.styleable.ReceiveInfoView)
Expand Down Expand Up @@ -92,6 +95,9 @@ class ReceiveInfoView(context: Context, attrs: AttributeSet?) : ConstraintLayout
}

fun setInfo(address: String, amount: Dash?) {
if (presetPaymentRequest != null) {
leavePresetPaymentRequest()
}
if (this.address != address) {
this.address = address
this.amount = amount
Expand All @@ -109,13 +115,45 @@ class ReceiveInfoView(context: Context, attrs: AttributeSet?) : ConstraintLayout
* already have been paid on it.
*/
fun clearInfo() {
if (presetPaymentRequest != null) {
leavePresetPaymentRequest()
refresh()
return
}
if (address != null || amount != null) {
address = null
amount = null
refresh()
}
}

/**
* Show [address] under [addressLabel] with a QR of [paymentRequest] exactly as given. For
* addresses [PaymentURI] cannot carry (bech32 shielded or Platform addresses, identity IDs):
* the caller builds the request. Copy copies [paymentRequest]; Share shares [address], as
* [setInfo] does. [setInfo] or [clearInfo] go back to the [PaymentURI] request.
*/
fun setPaymentRequest(addressLabel: String, address: String, paymentRequest: String) {
presetPaymentRequest = paymentRequest
this.address = address
this.amount = null
binding.addressLabel.text = addressLabel
refresh()
}

/** The [setPaymentRequest] QR: shown as given, kept out of [refreshQr]'s [PaymentURI]. */
private fun showPresetQr(paymentRequest: String) {
paymentRequestUri = paymentRequest
binding.qrPreview.setImageDrawable(Qr.themeAwareDrawable(paymentRequest, resources))
}

private fun leavePresetPaymentRequest() {
presetPaymentRequest = null
address = null
amount = null
binding.addressLabel.setText(R.string.dash_address)
}

fun setProfile(username: String?, displayName: String?, avatar: String?, avatarHash: ByteArray?) {
this.username = username

Expand Down Expand Up @@ -160,7 +198,12 @@ class ReceiveInfoView(context: Context, attrs: AttributeSet?) : ConstraintLayout
binding.addressPreviewPane.isVisible = false
}

refreshQr()
val presetPaymentRequest = this.presetPaymentRequest
if (presetPaymentRequest != null) {
showPresetQr(presetPaymentRequest)
} else {
refreshQr()
}
}

private fun refreshQr() {
Expand All @@ -186,26 +229,26 @@ class ReceiveInfoView(context: Context, attrs: AttributeSet?) : ConstraintLayout
private fun handleCopyAddress(address: String) {
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager

if (amount != null && paymentRequestUri.isNotEmpty()) {
if ((amount != null || presetPaymentRequest != null) && paymentRequestUri.isNotEmpty()) {
clipboardManager.setPrimaryClip(ClipData.newPlainText("Dash payment request", paymentRequestUri))
} else {
clipboardManager.setPrimaryClip(ClipData.newPlainText("Dash address", address))
}

Toast.makeText(context, R.string.copied, Toast.LENGTH_SHORT).show()
log.info("address copied to clipboard: {}", address)
log.info("address copied to clipboard")
}

private fun handleCopyUsername(username: String) {
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
clipboardManager.setPrimaryClip(ClipData.newPlainText("Dash Username", username))
Toast.makeText(context, R.string.copied, Toast.LENGTH_SHORT).show()
log.info("username copied to clipboard: {}", username)
log.info("username copied to clipboard")
}

private fun handleShare(paymentRequestUri: String) {
val title = resources.getString(R.string.request_coins_share_dialog_title)
context.shareText(paymentRequestUri, title)
log.info("payment request shared via intent: {}", paymentRequestUri)
log.info("payment request shared via intent")
}
}
Loading
Loading