Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-24 13:17:15 +03:00
parent b66f9fc50b
commit 0aa76e2aaa
8 changed files with 84 additions and 43 deletions

View file

@ -6,7 +6,7 @@ import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment.Companion.CenterEnd
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.Modifier
@ -23,6 +23,7 @@ import com.tangem.core.ui.components.inputrow.inner.PasteButton
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.resolveReference
import com.tangem.core.ui.res.TangemTheme
import kotlinx.coroutines.delay
/**
* [Input Row Recipient](https://www.figma.com/file/14ISV23YB1yVW1uNVwqrKv/Android?type=design&node-id=2100-826&mode=design&t=IQ5lBJEkFGU4WSvi-4)
@ -115,8 +116,18 @@ fun InputRowRecipient(
@Composable
private fun RowScope.InputIcon(isLoading: Boolean, value: String) {
var isLoadingProxy by remember { mutableStateOf(isLoading) }
// Do not show the progress indicator, which will disappear quickly
LaunchedEffect(key1 = isLoading) {
if (isLoading) {
delay(timeMillis = 500)
}
isLoadingProxy = isLoading
}
AnimatedContent(
targetState = isLoading,
targetState = isLoadingProxy,
label = "Indicator Show Change",
modifier = Modifier
.align(CenterVertically)