Skip to content

Commit

Permalink
Merge pull request #417 from sora-xor/sc-29
Browse files Browse the repository at this point in the history
Sc 29
  • Loading branch information
arvifox authored Jun 5, 2024
2 parents 7ea54a7 + 581717f commit c9901a2
Show file tree
Hide file tree
Showing 23 changed files with 172 additions and 317 deletions.
2 changes: 1 addition & 1 deletion android-foundation
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.androidfoundation.format.ImageValue
import jp.co.soramitsu.androidfoundation.format.TextValue
import jp.co.soramitsu.androidfoundation.format.retrievePainter
import jp.co.soramitsu.androidfoundation.format.retrieveString
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Image
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.retrievePainter
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.retrieveString
import jp.co.soramitsu.ui_core.resources.Dimens
import jp.co.soramitsu.ui_core.theme.customColors
import jp.co.soramitsu.ui_core.theme.customTypography

data class ListTileState(
val titleText: Text,
val image: Image,
val bodyText: Text
val titleText: TextValue,
val image: ImageValue,
val bodyText: TextValue,
)

@Composable
Expand Down Expand Up @@ -118,9 +118,9 @@ fun ListTile(
private fun PreviewListTile() {
ListTile(
state = ListTileState(
titleText = Text.SimpleText("Title"),
image = Image.ResImage(id = R.drawable.ic_0x0200000000000000000000000000000000000000000000000000000000000000),
bodyText = Text.SimpleText("Body text")
titleText = TextValue.SimpleText("Title"),
image = ImageValue.ResImage(id = R.drawable.ic_0x0200000000000000000000000000000000000000000000000000000000000000),
bodyText = TextValue.SimpleText("Body text")
),
onClick = { }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.LayoutDirection
import jp.co.soramitsu.androidfoundation.format.TextValue
import jp.co.soramitsu.androidfoundation.format.retrieveString
import jp.co.soramitsu.common.presentation.compose.extension.noRippleClickable
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.retrieveString
import jp.co.soramitsu.ui_core.resources.Dimens
import jp.co.soramitsu.ui_core.theme.customColors
import jp.co.soramitsu.ui_core.theme.customTypography
Expand All @@ -69,7 +69,7 @@ import kotlin.math.abs
@Composable
fun PagerTextIndicator(
modifier: Modifier,
indicatorsArray: List<Text>,
indicatorsArray: List<TextValue>,
currentPageRetriever: () -> Int,
slideOffsetRetriever: () -> Float,
onIndicatorClick: (Int) -> Unit
Expand Down Expand Up @@ -182,8 +182,8 @@ private fun PreviewSlidingPagerIndicator() {
.fillMaxWidth()
.wrapContentHeight(),
indicatorsArray = listOf(
Text.SimpleText("1234512345"),
Text.SimpleText("3"),
TextValue.SimpleText("1234512345"),
TextValue.SimpleText("3"),
),
currentPageRetriever = { ci.value },
slideOffsetRetriever = { 0f },
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ package jp.co.soramitsu.common.presentation.compose.uikit.tokens
enum class ScreenStatus {
LOADING,
ERROR,
READY_TO_RENDER
READY_TO_RENDER,
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import java.math.BigDecimal
import jp.co.soramitsu.androidfoundation.format.TextValue
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.presentation.compose.components.previewAssetAmountInputState
import jp.co.soramitsu.common.presentation.compose.uikit.organisms.PagerTextIndicator
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.ScreenStatus
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text
import jp.co.soramitsu.ui_core.resources.Dimens
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -104,9 +104,9 @@ fun QrCodeMainScreen(
.padding(horizontal = Dimens.x9),
indicatorsArray = qrCodeMainScreenPages.map {
when (it) {
QrCodeMainScreenPage.RECEIVE -> Text.StringRes(id = R.string.common_receive)
QrCodeMainScreenPage.RECEIVE -> TextValue.StringRes(id = R.string.common_receive)

QrCodeMainScreenPage.REQUEST -> Text.StringRes(id = R.string.common_request)
QrCodeMainScreenPage.REQUEST -> TextValue.StringRes(id = R.string.common_request)
}
},
currentPageRetriever = { pagerState.currentPage },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.androidfoundation.format.ImageValue
import jp.co.soramitsu.androidfoundation.format.TextValue
import jp.co.soramitsu.androidfoundation.format.retrievePainter
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.presentation.compose.uikit.molecules.ListTile
import jp.co.soramitsu.common.presentation.compose.uikit.molecules.ListTileState
import jp.co.soramitsu.common.presentation.compose.uikit.organisms.LoadableContentCard
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Image
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.ScreenStatus
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.Text
import jp.co.soramitsu.common.presentation.compose.uikit.tokens.retrievePainter
import jp.co.soramitsu.ui_core.component.button.BleachedButton
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand All @@ -75,50 +75,50 @@ data class ReceiveTokenByQrScreenState(
val untransformedUserAddress: String?,
) {

val qrCodeImage: Image
val qrCodeImage: ImageValue
get() {
if (untransformedQrBitmap == null)
return Image.ResImage(
return ImageValue.ResImage(
id = R.drawable.ic_empty_state
)

return Image.BitmapImage(
return ImageValue.BitmapImage(
bitmap = untransformedQrBitmap
)
}

val userAddressTitle: Text
val userAddressTitle: TextValue
get() {
if (untransformedUserName == null)
return Text.StringRes(
return TextValue.StringRes(
id = R.string.common_error_general_title
)

return Text.SimpleText(
return TextValue.SimpleText(
text = untransformedUserName
)
}

val userAddressAvatar: Image
val userAddressAvatar: ImageValue
get() {
if (untransformedAvatarDrawable == null)
return Image.ResImage(
return ImageValue.ResImage(
id = R.drawable.ic_empty_state
)

return Image.DrawableImage(
return ImageValue.DrawableImage(
drawable = untransformedAvatarDrawable
)
}

val userAddressBody: Text
val userAddressBody: TextValue
get() {
if (untransformedUserAddress == null)
return Text.StringRes(
return TextValue.StringRes(
id = R.string.common_error_general_title
)

return Text.SimpleText(
return TextValue.SimpleText(
text = untransformedUserAddress
)
}
Expand Down
Loading

0 comments on commit c9901a2

Please sign in to comment.