Updated on 2026-08-14
This commit is contained in:
commit
309f1cda20
6 changed files with 29 additions and 5 deletions
|
|
@ -372,6 +372,8 @@ dependencies {
|
|||
implementation(deps.coil.svg)
|
||||
implementation(deps.amplitude)
|
||||
implementation(deps.appsflyer)
|
||||
implementation(deps.appsflyer.oaid)
|
||||
implementation("com.android.installreferrer:installreferrer:2.2")
|
||||
implementation(deps.spongecastle.core)
|
||||
implementation(deps.lottie)
|
||||
implementation(deps.compose.accompanist.appCompatTheme)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 78be297b0f09bc2be1e9b0fbab9384f17bf94c37
|
||||
Subproject commit 098662beb5b0123b11f5ee4873d4bd667ac93c73
|
||||
|
|
@ -36,6 +36,7 @@ import com.tangem.core.ui.extensions.resolveReference
|
|||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.test.SendScreenTestTags
|
||||
import com.tangem.core.ui.utils.GlobalMultipleClickPreventer
|
||||
import com.tangem.core.ui.utils.singleEvent
|
||||
|
||||
@Composable
|
||||
|
|
@ -112,10 +113,12 @@ fun NavigationPrimaryButton(primaryButton: NavigationButton?, modifier: Modifier
|
|||
text = button.textReference.resolveReference(),
|
||||
enabled = button.isEnabled,
|
||||
onClick = {
|
||||
if (button.isHapticClick) {
|
||||
hapticFeedback.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
GlobalMultipleClickPreventer.processEvent {
|
||||
if (button.isHapticClick) {
|
||||
hapticFeedback.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
}
|
||||
button.onClick()
|
||||
}
|
||||
button.onClick()
|
||||
},
|
||||
showProgress = button.shouldShowProgress,
|
||||
colors = color,
|
||||
|
|
|
|||
|
|
@ -15,6 +15,18 @@ interface MultipleClickPreventer {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A global instance of [MultipleClickPreventer]
|
||||
* Use for preventing multiple clicks in the entire app.
|
||||
* For example, when we must ensure correct data is passed while editing values and navigating to next screen.
|
||||
*
|
||||
* @example
|
||||
* GlobalMultipleClickPreventer.processEvent {
|
||||
* // Handle click event
|
||||
* }
|
||||
*/
|
||||
val GlobalMultipleClickPreventer = MultipleClickPreventer.get()
|
||||
|
||||
private class DefaultMultipleClickPreventer : MultipleClickPreventer {
|
||||
private val now: Long get() = SystemClock.elapsedRealtime()
|
||||
private var lastEventTimeMs: Long = 0
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.tangem.core.ui.components.inputrow.InputRowRecipient
|
|||
import com.tangem.core.ui.extensions.*
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.test.SendAddressScreenTestTags
|
||||
import com.tangem.core.ui.utils.GlobalMultipleClickPreventer
|
||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationRecipientListUM
|
||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationTextFieldUM
|
||||
import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM
|
||||
|
|
@ -138,7 +139,11 @@ private fun LazyListScope.addressItem(
|
|||
title = address.label,
|
||||
placeholder = address.placeholder,
|
||||
onValueChange = { onAddressChange(it, EnterAddressSource.InputField) },
|
||||
onPasteClick = { onAddressChange(it, EnterAddressSource.PasteButton) },
|
||||
onPasteClick = {
|
||||
GlobalMultipleClickPreventer.processEvent {
|
||||
onAddressChange(it, EnterAddressSource.PasteButton)
|
||||
}
|
||||
},
|
||||
onQrCodeClick = onQrCodeClick,
|
||||
isError = isError,
|
||||
isLoading = isValidating,
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ compose-lifecycle-runtime = "2.7.0"
|
|||
|
||||
# region Other libraries
|
||||
appsflyer = "6.17.3"
|
||||
appsflyer-oaid = "6.12.3"
|
||||
amplitude = "2.36.1"
|
||||
amplitude-experiment = "1.13.1"
|
||||
armadillo = "0.9.0"
|
||||
|
|
@ -237,6 +238,7 @@ test-orchestrator = { module = "androidx.test:orchestrator", version.ref = "orch
|
|||
|
||||
# region Other
|
||||
appsflyer = { module = "com.appsflyer:af-android-sdk", version.ref = "appsflyer" }
|
||||
appsflyer-oaid = { module = "com.appsflyer:oaid", version.ref = "appsflyer-oaid" }
|
||||
amplitude = { module = "com.amplitude:android-sdk", version.ref = "amplitude" }
|
||||
amplitude-experiment = { module = "com.amplitude:experiment-android-client", version.ref = "amplitude-experiment" }
|
||||
armadillo = { module = "at.favre.lib:armadillo", version.ref = "armadillo" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue