From 5557124724811216ee0f0346cd15be9b2b0acd96 Mon Sep 17 00:00:00 2001 From: Rui Date: Sun, 3 Mar 2024 07:55:20 -0800 Subject: [PATCH 1/4] MOB-283 Repeatedly tapping on currently selected tab icon cause screen to flash --- .../dydx/trading/feature/shared/bottombar/DydxBottomBar.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt b/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt index d12b6f14..72eba895 100644 --- a/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt +++ b/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt @@ -157,7 +157,11 @@ object DydxBottomBar : DydxComponent { overflow = TextOverflow.Ellipsis, ) }, - onClick = { barItem.onTapAction?.invoke() }, + onClick = { + if (!barItem.selected) { + barItem.onTapAction?.invoke() + } + }, ) } From 259ec6f54a30bd8c0185a549af09c3c8e638a51b Mon Sep 17 00:00:00 2001 From: Rui Date: Sun, 3 Mar 2024 07:59:24 -0800 Subject: [PATCH 2/4] MOB-289 Background circle not showing on Light mode --- .../exchange/dydx/platformui/components/icons/PlatformIcons.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt b/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt index 8e2d9947..2808c94b 100644 --- a/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt +++ b/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt @@ -75,7 +75,7 @@ private fun iconModel(icon: Any?): Any? { @Composable fun PlatformRoundIcon( icon: Any?, - backgroundColor: ThemeColor.SemanticColor = ThemeColor.SemanticColor.layer_4, + backgroundColor: ThemeColor.SemanticColor = ThemeColor.SemanticColor.layer_5, borderColor: ThemeColor.SemanticColor = ThemeColor.SemanticColor.transparent, iconTint: ThemeColor.SemanticColor? = ThemeColor.SemanticColor.text_primary, size: Dp = 60.dp, From 7aa398e9d28b11c9fe0243dd3e9b4e37226f2cac Mon Sep 17 00:00:00 2001 From: Rui Date: Mon, 4 Mar 2024 09:07:57 -0800 Subject: [PATCH 3/4] Show faucet error --- .../faucet/DydxTransferFaucetViewModel.kt | 22 ++++++++++++++----- .../dydxstatemanager/AbacusStateManager.kt | 12 +++++----- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt b/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt index ddad69e7..6a256b45 100644 --- a/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt +++ b/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt @@ -23,12 +23,22 @@ class DydxTransferFaucetViewModel @Inject constructor( return DydxTransferFaucetView.ViewState( localizer = localizer, ctaButtonAction = { - abacusStateManager.faucet(100) - - platformInfo.show( - title = "Faucet Request Submitted", - message = "Your portofolio balance will be updated after a short while.", - ) + abacusStateManager.faucet(100) { + when (it) { + is AbacusStateManagerProtocol.SubmissionStatus.Success -> { + platformInfo.show( + title = "Faucet Request Submitted", + message = "Your portofolio balance will be updated after a short while.", + ) + } + is AbacusStateManagerProtocol.SubmissionStatus.Failed -> { + platformInfo.show( + title = "Faucet Request Failed", + message = it.error?.message ?: "Unknown error", + ) + } + } + } }, ) } diff --git a/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt b/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt index 11bbba2d..01e9f4eb 100644 --- a/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt +++ b/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt @@ -84,7 +84,7 @@ interface AbacusStateManagerProtocol { fun trade(input: String?, type: TradeInputField?) fun closePosition(input: String?, type: ClosePositionInputField) fun transfer(input: String?, type: TransferInputField?) - fun faucet(amount: Int) + fun faucet(amount: Int, statusCallback: (SubmissionStatus) -> Unit) fun setOrderbookMultiplier(multiplier: OrderbookGrouping) fun placeOrder(statusCallback: (SubmissionStatus) -> Unit) @@ -287,10 +287,12 @@ class AbacusStateManager @Inject constructor( asyncStateManager.transfer(input, type) } - override fun faucet(amount: Int) { - asyncStateManager.faucet(amount.toDouble()) { successful, _, _ -> - if (!successful) { - // Handle failure + override fun faucet(amount: Int, statusCallback: (AbacusStateManagerProtocol.SubmissionStatus) -> Unit) { + asyncStateManager.faucet(amount.toDouble()) { successful, error, _ -> + if (successful) { + statusCallback(AbacusStateManagerProtocol.SubmissionStatus.Success) + } else { + statusCallback(AbacusStateManagerProtocol.SubmissionStatus.Failed(error)) } } } From 1056fd5c46bc549dc81a6ee022efc53eb3ca5467 Mon Sep 17 00:00:00 2001 From: Rui Date: Mon, 4 Mar 2024 09:43:58 -0800 Subject: [PATCH 4/4] Bump Abacus --- v4/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v4/build.gradle b/v4/build.gradle index f9bce978..f79990c5 100644 --- a/v4/build.gradle +++ b/v4/build.gradle @@ -89,7 +89,7 @@ ext { compileSdkVersion = 34 // App dependencies - abacusVersion = '1.4.12' + abacusVersion = '1.4.13' carteraVersion = '0.1.12' kollectionsVersion = '2.0.16'