Updated on 2026-08-14

This commit is contained in:
Tangem 2023-01-18 21:59:04 +04:00
commit a9313be51d
38 changed files with 327 additions and 201 deletions

View file

@ -67,6 +67,7 @@ fun <T> OutlinedSpinner(
onValueChange = {},
label = { Text(label) },
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = rIsExpanded.value) },
colors = TangemTextFieldsDefault.defaultTextFieldColors,
)
if (isEnabled) {
@ -104,4 +105,4 @@ fun TestSpinnerPreview() {
onItemSelected = {},
)
}
}
}

View file

@ -6,6 +6,7 @@ import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
@ -15,6 +16,7 @@ import androidx.compose.material.LinearProgressIndicator
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.material.TextFieldColors
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@ -28,6 +30,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.tangem.common.module.ModuleError
import com.tangem.core.ui.res.TangemTheme
import com.tangem.domain.common.form.Field
import com.tangem.tap.common.CompositionLogger
import com.tangem.tap.common.compose.extensions.stringResourceDefault
@ -91,6 +94,8 @@ private fun OutlinedProgressTextField(
debounce: Long = 400,
visualTransformation: VisualTransformation = VisualTransformation.None,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
colors: TextFieldColors = TangemTextFieldsDefault.defaultTextFieldColors,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
trailingIcon: @Composable (() -> Unit)? = null,
onTextChanged: (String) -> Unit,
) {
@ -160,10 +165,22 @@ private fun OutlinedProgressTextField(
textDebouncer.emmit(it)
},
keyboardOptions = keyboardOptions,
label = { Text(label) },
label = {
Text(
text = label,
style = TangemTheme.typography.caption,
color = colors.labelColor(
enabled = isEnabled,
error = error != null,
interactionSource = interactionSource,
).value,
)
},
placeholder = {
Text(
text = placeholder,
style = TangemTheme.typography.body1,
color = colors.placeholderColor(enabled = isEnabled).value,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
@ -173,6 +190,8 @@ private fun OutlinedProgressTextField(
enabled = isEnabled,
isError = error != null,
visualTransformation = visualTransformation,
colors = colors,
interactionSource = interactionSource,
)
AnimatedVisibility(
modifier = modifier
@ -180,7 +199,11 @@ private fun OutlinedProgressTextField(
.align(Alignment.BottomCenter)
.padding(start = 6.dp, top = 0.dp, end = 6.dp, bottom = 6.dp),
visible = isLoading,
) { LinearProgressIndicator() }
) {
LinearProgressIndicator(
color = TangemTheme.colors.icon.primary1,
)
}
}
}

View file

@ -0,0 +1,156 @@
package com.tangem.tap.common.compose
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.interaction.InteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
import androidx.compose.material.TextFieldColors
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.State
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.ui.graphics.Color
import com.tangem.core.ui.res.TangemTheme
// Copy from com.tangem.core.ui.components
// TODO: Delete this after fields has been moved to core-ui module
internal object TangemTextFieldsDefault {
val defaultTextFieldColors: TangemTextFieldColors
@Composable @Stable get() = TangemTextFieldColors(
textColor = TangemTheme.colors.text.primary1,
disabledTextColor = TangemTheme.colors.text.disabled,
backgroundColor = Color.Transparent,
cursorColor = TangemTheme.colors.icon.primary1,
errorCursorColor = TangemTheme.colors.icon.warning,
focusedIndicatorColor = TangemTheme.colors.icon.primary1,
unfocusedIndicatorColor = TangemTheme.colors.stroke.primary,
disabledIndicatorColor = TangemTheme.colors.stroke.primary,
errorIndicatorColor = TangemTheme.colors.icon.warning,
leadingIconColor = TangemTheme.colors.icon.informative,
disabledLeadingIconColor = Color.Transparent,
errorLeadingIconColor = TangemTheme.colors.icon.warning,
trailingIconColor = TangemTheme.colors.icon.informative,
disabledTrailingIconColor = Color.Transparent,
errorTrailingIconColor = TangemTheme.colors.icon.warning,
focusedLabelColor = TangemTheme.colors.text.primary1,
unfocusedLabelColor = TangemTheme.colors.text.secondary,
disabledLabelColor = TangemTheme.colors.text.disabled,
errorLabelColor = TangemTheme.colors.icon.warning,
placeholderColor = TangemTheme.colors.text.secondary,
disabledPlaceholderColor = TangemTheme.colors.text.disabled,
captionColor = TangemTheme.colors.text.tertiary,
disabledCaptionColor = TangemTheme.colors.text.disabled,
errorCaptionColor = TangemTheme.colors.icon.warning,
)
}
@Immutable
internal data class TangemTextFieldColors(
private val textColor: Color,
private val disabledTextColor: Color,
private val cursorColor: Color,
private val errorCursorColor: Color,
private val focusedIndicatorColor: Color,
private val unfocusedIndicatorColor: Color,
private val errorIndicatorColor: Color,
private val disabledIndicatorColor: Color,
private val leadingIconColor: Color,
private val disabledLeadingIconColor: Color,
private val errorLeadingIconColor: Color,
private val trailingIconColor: Color,
private val disabledTrailingIconColor: Color,
private val errorTrailingIconColor: Color,
private val backgroundColor: Color,
private val focusedLabelColor: Color,
private val unfocusedLabelColor: Color,
private val disabledLabelColor: Color,
private val errorLabelColor: Color,
private val placeholderColor: Color,
private val disabledPlaceholderColor: Color,
private val captionColor: Color,
private val disabledCaptionColor: Color,
private val errorCaptionColor: Color,
) : TextFieldColors {
@Composable
override fun leadingIconColor(enabled: Boolean, isError: Boolean): State<Color> {
return rememberUpdatedState(
when {
!enabled -> disabledLeadingIconColor
isError -> errorLeadingIconColor
else -> leadingIconColor
},
)
}
@Composable
override fun trailingIconColor(enabled: Boolean, isError: Boolean): State<Color> {
return rememberUpdatedState(
when {
!enabled -> disabledTrailingIconColor
isError -> errorTrailingIconColor
else -> trailingIconColor
},
)
}
@Composable
override fun indicatorColor(
enabled: Boolean,
isError: Boolean,
interactionSource: InteractionSource,
): State<Color> {
val focused by interactionSource.collectIsFocusedAsState()
val targetValue = when {
!enabled -> disabledIndicatorColor
isError -> errorIndicatorColor
focused -> focusedIndicatorColor
else -> unfocusedIndicatorColor
}
return if (enabled) {
animateColorAsState(targetValue, tween(durationMillis = 120))
} else {
rememberUpdatedState(targetValue)
}
}
@Composable
override fun backgroundColor(enabled: Boolean): State<Color> {
return rememberUpdatedState(backgroundColor)
}
@Composable
override fun placeholderColor(enabled: Boolean): State<Color> {
return rememberUpdatedState(if (enabled) placeholderColor else disabledPlaceholderColor)
}
@Composable
override fun labelColor(
enabled: Boolean,
error: Boolean,
interactionSource: InteractionSource,
): State<Color> {
val focused by interactionSource.collectIsFocusedAsState()
val targetValue = when {
!enabled -> disabledLabelColor
error -> errorLabelColor
focused -> focusedLabelColor
else -> unfocusedLabelColor
}
return rememberUpdatedState(targetValue)
}
@Composable
override fun textColor(enabled: Boolean): State<Color> {
return rememberUpdatedState(if (enabled) textColor else disabledTextColor)
}
@Composable
override fun cursorColor(isError: Boolean): State<Color> {
return rememberUpdatedState(if (isError) errorCursorColor else cursorColor)
}
}

View file

@ -10,10 +10,10 @@ import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ComposeView
import com.google.accompanist.appcompattheme.AppCompatTheme
import com.tangem.core.analytics.Analytics
import com.tangem.core.ui.res.TangemTheme
import com.tangem.domain.features.addCustomToken.redux.AddCustomTokenState
import com.tangem.domain.redux.domainStore
import com.tangem.core.analytics.Analytics
import com.tangem.tap.common.analytics.events.ManageTokens
import com.tangem.tap.common.compose.ClosePopupTrigger
import com.tangem.tap.features.BaseStoreFragment
@ -57,7 +57,7 @@ class AddCustomTokenFragment : BaseStoreFragment(R.layout.view_compose_fragment)
val closePopupTrigger = initClosingPopupTriggerEvent()
view.findViewById<ComposeView>(R.id.view_compose)?.setContent {
AppCompatTheme(requireContext()) {
TangemTheme {
Box(
modifier = Modifier
.fillMaxSize(),

View file

@ -6,23 +6,16 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.BottomSheetScaffold
import androidx.compose.material.BottomSheetScaffoldState
import androidx.compose.material.BottomSheetState
import androidx.compose.material.BottomSheetValue
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ExtendedFloatingActionButton
import androidx.compose.material.FabPosition
import androidx.compose.material.FloatingActionButtonDefaults
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.rememberBottomSheetScaffoldState
import androidx.compose.material.rememberScaffoldState
import androidx.compose.runtime.Composable
@ -33,12 +26,14 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.tangem.core.ui.components.PrimaryButtonIconLeft
import com.tangem.core.ui.components.keyboardAsState
import com.tangem.core.ui.res.TangemTheme
import com.tangem.domain.AddCustomTokenError
import com.tangem.domain.common.form.DataField
import com.tangem.domain.common.form.FieldId
@ -56,7 +51,6 @@ import com.tangem.domain.redux.domainStore
import com.tangem.tap.common.compose.AddCustomTokenWarning
import com.tangem.tap.common.compose.ClosePopupTrigger
import com.tangem.tap.common.compose.ComposeDialogManager
import com.tangem.tap.common.compose.ToggledRippleTheme
import com.tangem.tap.domain.moduleMessage.ModuleMessageConverter
import com.tangem.tap.features.tokens.addCustomToken.compose.test.TestCase
import com.tangem.tap.features.tokens.addCustomToken.compose.test.TestCasesList
@ -127,8 +121,12 @@ private fun ScreenContent(
}
},
floatingActionButtonPosition = FabPosition.Center,
) {
Box(Modifier.fillMaxSize()) {
) { paddings ->
Box(
modifier = Modifier
.padding(paddings)
.fillMaxSize(),
) {
LazyColumn(
contentPadding = PaddingValues(bottom = 90.dp),
) {
@ -200,41 +198,15 @@ fun Warnings(warnings: List<AddCustomTokenError.Warning>) {
@Composable
private fun AddButton(state: MutableState<AddCustomTokenState>) {
AddCustomTokenFab(
PrimaryButtonIconLeft(
modifier = Modifier
.widthIn(210.dp, 280.dp),
isEnabled = state.value.screenState.addButton.isEnabled,
) { domainStore.dispatch(AddCustomTokenAction.OnAddCustomTokenClicked) }
}
@Suppress("MagicNumber")
@Composable
private fun AddCustomTokenFab(modifier: Modifier = Modifier, isEnabled: Boolean = true, onClick: () -> Unit) {
val contentColor = Color.White
val backgroundColor = if (isEnabled) Color(0xFF1ACE80) else Color(0xFFB9E6D3)
val elevation = if (!isEnabled) {
FloatingActionButtonDefaults.elevation(0.dp, 0.dp)
} else {
FloatingActionButtonDefaults.elevation()
}
ToggledRippleTheme(isEnabled) {
ExtendedFloatingActionButton(
modifier = modifier,
icon = {
Icon(
imageVector = Icons.Filled.Add,
tint = contentColor,
contentDescription = "Add",
)
},
text = { Text(text = stringResource(id = R.string.common_add)) },
onClick = { if (isEnabled) onClick() },
backgroundColor = backgroundColor,
contentColor = contentColor,
elevation = elevation,
)
}
.padding(horizontal = TangemTheme.dimens.spacing16)
.fillMaxWidth(),
text = stringResource(id = R.string.common_add),
icon = painterResource(id = R.drawable.ic_plus_24),
enabled = state.value.screenState.addButton.isEnabled,
onClick = { domainStore.dispatch(AddCustomTokenAction.OnAddCustomTokenClicked) },
)
}
data class ScreenFieldData(

View file

@ -11,9 +11,9 @@ import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.transition.TransitionInflater
import by.kirich1409.viewbindingdelegate.viewBinding
import com.google.accompanist.appcompattheme.AppCompatTheme
import com.tangem.blockchain.common.Blockchain
import com.tangem.core.analytics.Analytics
import com.tangem.core.ui.res.TangemTheme
import com.tangem.tap.common.analytics.events.ManageTokens
import com.tangem.tap.common.extensions.copyToClipboard
import com.tangem.tap.common.extensions.dispatchNotification
@ -73,7 +73,7 @@ class AddTokensFragment : BaseFragment(R.layout.fragment_add_tokens), StoreSubsc
}
cvCurrencies.setContent {
AppCompatTheme {
TangemTheme {
CurrenciesScreen(
tokensState = tokensState,
onSaveChanges = onSaveChanges,

View file

@ -9,12 +9,11 @@ import androidx.compose.animation.fadeOut
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.ExtendedFloatingActionButton
import androidx.compose.material.FabPosition
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue
@ -30,8 +29,10 @@ import androidx.compose.ui.unit.dp
import com.tangem.blockchain.common.Blockchain
import com.tangem.core.analytics.Analytics
import com.tangem.core.ui.components.Keyboard
import com.tangem.core.ui.components.PrimaryButton
import com.tangem.core.ui.components.SystemBarsEffect
import com.tangem.core.ui.components.keyboardAsState
import com.tangem.core.ui.res.TangemTheme
import com.tangem.domain.common.TapWorkarounds.useOldStyleDerivation
import com.tangem.domain.common.extensions.fromNetworkId
import com.tangem.tap.common.analytics.events.AnalyticsParam
@ -231,15 +232,12 @@ fun SaveChangesButton(keyboardState: Keyboard, onSaveChanges: () -> Unit) {
0
}
ExtendedFloatingActionButton(
text = {
Text(
text = stringResource(id = R.string.common_save_changes),
)
},
PrimaryButton(
modifier = Modifier
.padding(bottom = padding.dp)
.padding(horizontal = TangemTheme.dimens.spacing16)
.fillMaxWidth(),
text = stringResource(id = R.string.common_save_changes),
onClick = onSaveChanges,
backgroundColor = colorResource(id = R.color.accent),
contentColor = Color.White,
modifier = Modifier.padding(bottom = padding.dp),
)
}

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:color="#66FFFFFF"
android:textColor="#66FFFFFF"/>
<item android:color="#FFFFFF"/>
</selector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/button_disabled" android:state_enabled="false" />
<item android:color="@color/button_primary" />
</selector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/button_disabled" android:state_enabled="false" />
<item android:color="@color/button_secondary" />
</selector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/text_disabled" android:state_enabled="false" android:textColor="@color/text_disabled" />
<item android:color="@color/text_primary_2" android:textColor="@color/text_primary_2" />
</selector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/text_disabled" android:state_enabled="false" android:textColor="@color/text_disabled" />
<item android:color="@color/text_primary_1" android:textColor="@color/text_primary_1" />
</selector>

View file

@ -74,7 +74,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_main_action"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
tools:text="@string/welcome_unlock_card" />
<ProgressBar
@ -91,7 +91,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_alternative_action"
style="@style/TapButtonText"
style="@style/TapTextButton"
android:layout_marginBottom="26dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -99,4 +99,4 @@
tools:text="Atlernative action" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -48,7 +48,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_open_support_chat"
style="@style/OnboardingButton.Alternative"
style="@style/TapSecondaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="92dp"
@ -68,7 +68,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_kyc_action"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_height="wrap_content"
android:text="@string/onboarding_button_kyc_waiting" />
@ -84,4 +84,4 @@
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -81,7 +81,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_yes"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -97,7 +97,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_no"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"

View file

@ -78,7 +78,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_confirm"
style="@style/TapBlackButton"
style="@style/TapPrimaryIconButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
@ -93,4 +93,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -91,7 +91,7 @@
<Button
android:id="@+id/btn_repeat"
style="@style/OnboardingButton.Alternative"
style="@style/TapSecondaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
@ -104,7 +104,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_accept"
style="@style/TapButton"
style="@style/TapPrimaryButton"
android:layout_width="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
@ -134,4 +134,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -112,7 +112,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btnSend"
style="@style/TapButtonWithIcon"
style="@style/TapPrimaryIconButton"
android:layout_width="match_parent"
android:fontFamily="@font/saira_semi_condensed_regular"
android:text="@string/send_title"
@ -135,4 +135,4 @@
</ScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -339,7 +339,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_main_action"
style="@style/TapBlackButton"
style="@style/TapPrimaryButton"
android:layout_width="match_parent"
android:layout_height="48sp"
android:layout_marginStart="14dp"
@ -373,4 +373,4 @@
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -217,21 +217,16 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_add_token"
style="@style/BaseTapButton"
style="@style/TapPrimaryButton"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:elevation="4dp"
android:text="@string/main_manage_tokens"
android:textSize="16sp"
android:visibility="gone"
app:cornerRadius="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier_wallets"
app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="16dp" />
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -85,7 +85,7 @@
android:elevation="0dp"
android:text="@string/common_add"
android:textAllCaps="false"
android:textColor="@color/btn_tap_text_color"
android:textColor="@color/selector_btn_text_primary"
app:cornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -98,4 +98,4 @@
app:barrierDirection="start"
app:constraint_referenced_ids="btn_add_token" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -116,7 +116,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_access_code_create"
style="@style/TapButton"
style="@style/TapPrimaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/access_code_btn_continue_margin_start"
@ -129,4 +129,4 @@
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -47,7 +47,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_access_code_submit"
style="@style/TapButton"
style="@style/TapPrimaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/access_code_btn_continue_margin_start"
@ -59,4 +59,4 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -7,7 +7,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_add_card"
style="@style/OnboardingButton.Alternative"
style="@style/TapSecondaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="92dp"
@ -18,7 +18,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_continue"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent"
@ -26,4 +26,4 @@
app:layout_constraintStart_toStartOf="parent"
tools:text="Main Action" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -7,7 +7,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_wallet_main_action"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_width="204dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/home_bottom_fl_scan_card_container_margin_bottom"
@ -18,7 +18,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_wallet_alternative_action"
style="@style/OnboardingButton.Borderless"
style="@style/TapTextButton"
android:layout_width="204dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/home_bottom_btn_alternative_action_margin_bottom"
@ -27,4 +27,4 @@
app:layout_constraintStart_toStartOf="parent"
tools:text="Alternative action" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -74,7 +74,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_main_action"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
tools:text="@string/welcome_unlock_card" />
<ProgressBar
@ -91,12 +91,12 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_alternative_action"
style="@style/TapButtonText"
style="@style/TapTextButton"
android:layout_marginBottom="@dimen/home_bottom_btn_alternative_action_margin_bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="Atlernative action" />
tools:text="Alternative action" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -56,7 +56,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_connect"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_height="wrap_content"
android:text="@string/onboarding_button_register_wallet"
app:icon="@drawable/ic_tangem_24"
@ -75,4 +75,4 @@
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -48,7 +48,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_open_support_chat"
style="@style/OnboardingButton.Alternative"
style="@style/TapSecondaryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="92dp"
@ -68,7 +68,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_kyc_action"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_height="wrap_content"
android:text="@string/onboarding_button_kyc_waiting" />
@ -84,4 +84,4 @@
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -56,7 +56,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_verify"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_height="wrap_content"
android:text="@string/onboarding_button_kyc_start" />
@ -73,4 +73,4 @@
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -53,7 +53,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_set_pin"
style="@style/OnboardingButton"
style="@style/TapPrimaryButton"
android:layout_height="wrap_content"
android:text="@string/onboarding_button_pin" />
@ -69,4 +69,4 @@
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -15,7 +15,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_confirm_long"
style="@style/TapButtonWithIcon"
style="@style/TapPrimaryIconButton"
android:layout_width="0dp"
android:text="@string/wallet_button_send"
app:icon="@drawable/ic_send"

View file

@ -7,8 +7,8 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_trade"
style="@style/TapButtonWithIcon"
android:layout_width="0dp"
style="@style/TapPrimaryIconButton"
android:layout_width="0dp"
android:text="@string/wallet_button_trade"
app:icon="@drawable/ic_arrows_up_down"
app:layout_constraintBottom_toBottomOf="parent"
@ -21,9 +21,9 @@
app:layout_constraintVertical_bias="1" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_confirm"
style="@style/TapButtonWithIcon"
android:layout_width="0dp"
android:id="@+id/btn_confirm"
style="@style/TapPrimaryIconButton"
android:layout_width="0dp"
android:layout_marginStart="8dp"
android:text="@string/wallet_button_send"
app:icon="@drawable/ic_send"

View file

@ -7,7 +7,7 @@
<Button
android:id="@+id/btn_2_cards"
style="@style/TapButton"
style="@style/TapPrimaryButton"
android:text="2 cards"
app:layout_constraintEnd_toStartOf="@+id/btn_3_cards"
app:layout_constraintHorizontal_bias="0.5"
@ -19,7 +19,7 @@
<Button
android:id="@+id/btn_3_cards"
style="@style/TapButton"
style="@style/TapPrimaryButton"
android:text="3 cards"
android:layout_margin="16dp"
app:layout_constraintEnd_toEndOf="parent"
@ -62,7 +62,7 @@
<Button
android:id="@+id/pay_gpay"
style="@style/TapButton"
style="@style/TapPrimaryButton"
android:text="GPay"
app:layout_constraintEnd_toStartOf="@+id/pay_web"
app:layout_constraintHorizontal_bias="0.5"
@ -74,7 +74,7 @@
<Button
android:id="@+id/pay_web"
style="@style/TapButton"
style="@style/TapPrimaryButton"
android:text="Pay online"
android:layout_margin="16dp"
app:layout_constraintEnd_toEndOf="parent"
@ -84,4 +84,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -16,9 +16,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_trade"
style="@style/TapButtonWithIcon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TapPrimaryIconButton"
android:text="@string/wallet_button_trade"
android:visibility="gone"
app:icon="@drawable/ic_arrows_up_down"
@ -26,18 +24,14 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_buy"
style="@style/TapButtonWithIcon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TapPrimaryIconButton"
android:text="@string/wallet_button_buy"
android:visibility="gone"
app:icon="@drawable/ic_arrow_up" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_sell"
style="@style/TapButtonWithIcon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TapPrimaryIconButton"
android:text="@string/wallet_button_sell"
android:visibility="gone"
app:icon="@drawable/ic_arrow_down" />
@ -47,7 +41,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_send"
style="@style/TapButtonWithIcon"
style="@style/TapPrimaryIconButton"
android:layout_width="0dp"
android:layout_weight="1"
android:text="@string/wallet_button_send"

View file

@ -31,6 +31,7 @@
<dimen name="btn_corner_radius">4dp</dimen>
<dimen name="btn_corner_radius_medium">8dp</dimen>
<dimen name="btn_corner_radius_large">12dp</dimen>
<dimen name="btn_rounded_size">44dp</dimen>
<dimen name="text_size_amount_to_send">32sp</dimen>

View file

@ -41,69 +41,43 @@
<item name="colorPrimary">@color/accent</item>
</style>
<style name="BaseTapButton">
<style name="BaseTapButton" parent="Widget.Material3.Button">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:minWidth">204dp</item>
<item name="android:minHeight">48dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
<item name="android:textColor">@color/btn_tap_text_color</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">normal</item>
<item name="android:fontFamily">@font/roboto_medium</item>
<item name="android:letterSpacing">0</item>
<item name="android:backgroundTint">@color/selector_btn_green</item>
<item name="lineHeight">24sp</item>
<item name="cornerRadius">@dimen/btn_corner_radius_large</item>
</style>
<style name="TapPrimaryButton" parent="BaseTapButton">
<item name="android:backgroundTint">@color/selector_btn_primary</item>
<item name="android:textColor">@color/selector_btn_text_primary</item>
</style>
<style name="TapSecondaryButton" parent="BaseTapButton">
<item name="android:backgroundTint">@color/selector_btn_secondary</item>
<item name="android:textColor">@color/selector_btn_text_secondary</item>
</style>
<style name="TapTextButton" parent="BaseTapButton">
<item name="android:minHeight">40dp</item>
<item name="cornerRadius">@dimen/btn_corner_radius</item>
<item name="android:backgroundTint">@android:color/transparent</item>
<item name="android:textColor">@color/selector_btn_text_secondary</item>
</style>
<style name="TapButton" parent="BaseTapButton">
<item name="android:layout_width">93dp</item>
<item name="android:minHeight">52dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">15sp</item>
<item name="android:textStyle">bold</item>
<item name="android:fontFamily">@font/saira_semi_condensed_regular</item>
<item name="elevation">3dp</item>
</style>
<style name="OnboardingButton" parent="BaseTapButton">
<item name="android:minWidth">204dp</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">48dp</item>
<item name="android:textSize">16sp</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="elevation">2dp</item>
</style>
<style name="OnboardingButton.Alternative">
<item name="android:backgroundTint">@color/gray_button</item>
<item name="android:textColor">@color/selector_btn_gray_text_color</item>
<item name="elevation">0dp</item>
</style>
<style name="OnboardingButton.Borderless" parent="@style/Widget.AppCompat.Button.Borderless">
<item name="textAllCaps">false</item>
<item name="android:backgroundTint">@color/gray_button</item>
<item name="android:textColor">@color/tapButtonColorBlack</item>
<item name="elevation">0dp</item>
</style>
<style name="TapButtonText" parent="@style/Widget.MaterialComponents.Button.TextButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:minWidth">204dp</item>
<item name="android:layout_height">58dp</item>
<item name="android:textSize">16sp</item>
<item name="android:letterSpacing">0</item>
<item name="android:textAllCaps">false</item>
<item name="android:textColor">#060606</item>
<item name="cornerRadius">@dimen/btn_corner_radius</item>
</style>
<style name="TapButtonWithIcon" parent="TapButton">
<style name="TapPrimaryIconButton" parent="TapPrimaryButton">
<item name="android:gravity">start|center_vertical</item>
<item name="iconTint">@color/btn_tap_text_color</item>
<item name="iconTint">@color/selector_btn_text_primary</item>
<item name="iconGravity">end</item>
<item name="android:layout_width">200dp</item>
</style>
<style name="TapBlackButton" parent="TapButtonWithIcon">
<item name="android:backgroundTint">@color/selector_btn_black</item>
</style>
<style name="TapChip" parent="@style/Widget.MaterialComponents.Chip.Choice">

View file

@ -35,7 +35,6 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import com.tangem.core.ui.R
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
/**
* [Show in Figma](https://www.figma.com/file/14ISV23YB1yVW1uNVwqrKv/Android?node-id=97%3A103&t=TmfD6UBHPg9uYfev-4)
@ -305,7 +304,7 @@ private fun ButtonContent(
}
Text(
text = text,
style = TangemTypography.button,
style = TangemTheme.typography.button,
color = colors.contentColor(enabled = enabled).value,
)
if (buttonIcon is TangemButtonIcon.Right) {

View file

@ -106,7 +106,7 @@ private fun TangemTextField(
.height(IntrinsicSize.Min)
.heightIn(size.toHeightDp()),
value = value,
textStyle = TangemTypography.body1,
textStyle = TangemTheme.typography.body1,
onValueChange = onValueChange,
singleLine = singleLine,
enabled = enabled,
@ -121,7 +121,7 @@ private fun TangemTextField(
if (!label.isNullOrEmpty()) {
Text(
text = label,
style = TangemTypography.caption,
style = TangemTheme.typography.caption,
color = colors.labelColor(
enabled = enabled,
error = isError,
@ -134,7 +134,7 @@ private fun TangemTextField(
if (!placeholder.isNullOrEmpty()) {
Text(
text = placeholder,
style = TangemTypography.body1,
style = TangemTheme.typography.body1,
color = colors.placeholderColor(enabled = enabled).value,
)
}