Updated on 2026-08-14

This commit is contained in:
Tangem 2022-11-23 13:49:15 +03:00
parent 4a89075d5a
commit e17ff1b4c2
19 changed files with 391 additions and 177 deletions

View file

@ -1,5 +1,6 @@
package com.tangem.core.ui.components.appbar
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
@ -18,22 +19,6 @@ import androidx.compose.ui.tooling.preview.Preview
import com.tangem.core.ui.R
import com.tangem.core.ui.res.TangemTheme
@Preview(widthDp = 360, heightDp = 56, showBackground = true)
@Composable
fun PreviewAppBarWithBackButtonInLightTheme() {
TangemTheme(isDark = false) {
AppBarWithBackButton(text = "Title", onBackClick = {})
}
}
@Preview(widthDp = 360, heightDp = 56, showBackground = true)
@Composable
fun PreviewAppBarWithBackButtonInDarkTheme() {
TangemTheme(isDark = true) {
AppBarWithBackButton(text = "Title", onBackClick = {})
}
}
/**
* App bar with back button and optional title
*
@ -47,8 +32,9 @@ fun PreviewAppBarWithBackButtonInDarkTheme() {
fun AppBarWithBackButton(text: String? = null, onBackClick: () -> Unit) {
Row(
modifier = Modifier
.padding(all = dimensionResource(R.dimen.spacing16))
.fillMaxWidth(),
.background(MaterialTheme.colors.primary)
.fillMaxWidth()
.padding(all = dimensionResource(R.dimen.spacing16)),
horizontalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.spacing16)),
verticalAlignment = Alignment.CenterVertically,
) {
@ -69,4 +55,20 @@ fun AppBarWithBackButton(text: String? = null, onBackClick: () -> Unit) {
)
}
}
}
@Preview(widthDp = 360, heightDp = 56, showBackground = true)
@Composable
fun PreviewAppBarWithBackButtonInLightTheme() {
TangemTheme(isDark = false) {
AppBarWithBackButton(text = "Title", onBackClick = {})
}
}
@Preview(widthDp = 360, heightDp = 56, showBackground = true)
@Composable
fun PreviewAppBarWithBackButtonInDarkTheme() {
TangemTheme(isDark = true) {
AppBarWithBackButton(text = "Title", onBackClick = {})
}
}

View file

@ -2,4 +2,5 @@
<resources>
<string name="common_share">Поделиться</string>
<string name="common_copy">Копировать</string>
<string name="common_terms_and_conditions">условия участия</string>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="warning_button_ok">Хорошо, понял!</string>
</resources>

View file

@ -13,7 +13,9 @@
<!-- endregion Elevation -->
<!-- region Radius -->
<dimen name="radius2">2dp</dimen>
<dimen name="radius6">6dp</dimen>
<dimen name="radius8">8dp</dimen>
<dimen name="radius12">12dp</dimen>
<dimen name="radius16">16dp</dimen>
<!-- endregion Radius -->
@ -43,12 +45,14 @@
<dimen name="spacing8">8dp</dimen>
<dimen name="spacing10">10dp</dimen>
<dimen name="spacing12">12dp</dimen>
<dimen name="spacing14">14dp</dimen>
<dimen name="spacing16">16dp</dimen>
<dimen name="spacing24">24dp</dimen>
<dimen name="spacing32">32dp</dimen>
<dimen name="spacing44">44dp</dimen>
<dimen name="spacing50">50dp</dimen>
<dimen name="spacing54">54dp</dimen>
<dimen name="radius2">2dp</dimen>
<dimen name="spacing56">56dp</dimen>
<dimen name="spacing92">92dp</dimen>
<!-- endregion Spacing -->
</resources>

View file

@ -2,4 +2,5 @@
<resources>
<string name="common_share" translatable="false">Share</string>
<string name="common_copy" translatable="false">Copy</string>
<string name="common_terms_and_conditions">terms and conditions</string>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="warning_button_ok">Ok, Got it!</string>
</resources>