Skip to content

Commit bedec9d

Browse files
authored
Merge pull request #923 from soramitsu/staging
staging
2 parents c41fb2a + 7bfd112 commit bedec9d

File tree

58 files changed

+639
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+639
-306
lines changed

app/src/main/java/jp/co/soramitsu/app/root/navigation/Navigator.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ import jp.co.soramitsu.wallet.impl.presentation.balance.detail.BalanceDetailFrag
115115
import jp.co.soramitsu.wallet.impl.presentation.balance.detail.frozen.FrozenAssetPayload
116116
import jp.co.soramitsu.wallet.impl.presentation.balance.detail.frozen.FrozenTokensFragment
117117
import jp.co.soramitsu.wallet.impl.presentation.balance.optionswallet.OptionsWalletFragment
118+
import jp.co.soramitsu.wallet.impl.presentation.balance.walletselector.light.WalletSelectionMode
118119
import jp.co.soramitsu.wallet.impl.presentation.balance.walletselector.light.WalletSelectorFragment
119120
import jp.co.soramitsu.wallet.impl.presentation.beacon.main.BeaconFragment
120121
import jp.co.soramitsu.wallet.impl.presentation.beacon.main.DAppMetadataModel
@@ -367,8 +368,15 @@ class Navigator :
367368
navController?.navigate(R.id.walletSelectorFragment, WalletSelectorFragment.buildArguments(tag))
368369
}
369370

370-
override fun openWalletSelectorForResult(): Flow<Long> {
371-
val bundle = WalletSelectorFragment.buildArguments(tag = "")
371+
override fun openWalletSelectorForResult(
372+
selectedWalletId: Long?,
373+
walletSelectionMode: WalletSelectionMode
374+
): Flow<Long> {
375+
val bundle = WalletSelectorFragment.buildArguments(
376+
tag = "",
377+
selectedWalletId = selectedWalletId,
378+
walletSelectionMode = walletSelectionMode
379+
)
372380
return openWithResult(
373381
destinationId = R.id.walletSelectorFragment,
374382
bundle = bundle,
@@ -700,13 +708,13 @@ class Navigator :
700708
override fun openSelectChainForXcm(
701709
selectedChainId: ChainId?,
702710
xcmChainType: XcmChainType,
703-
selectedOriginalChainId: String?,
711+
selectedOriginChainId: String?,
704712
xcmAssetSymbol: String?
705713
) {
706714
val bundle = ChainSelectFragment.getBundleForXcmChains(
707715
selectedChainId = selectedChainId,
708716
xcmChainType = xcmChainType,
709-
xcmSelectedOriginalChainId = selectedOriginalChainId,
717+
xcmSelectedOriginChainId = selectedOriginChainId,
710718
xcmAssetSymbol = xcmAssetSymbol
711719
)
712720
navController?.navigate(R.id.chainSelectFragment, bundle)

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apply from: './scripts/secrets.gradle'
33
buildscript {
44
ext {
55
// App version
6-
versionName = '2.2.3'
7-
versionCode = 92
6+
versionName = '2.2.4'
7+
versionCode = 93
88

99
// SDK and tools
1010
compileSdkVersion = 33
@@ -84,7 +84,7 @@ buildscript {
8484
minifyRelease = true
8585
beaconVersion = "3.2.4"
8686

87-
sharedFeaturesVersion = "0.0.24"
87+
sharedFeaturesVersion = "0.0.26_snapshot2"
8888

8989
coilDep = "io.coil-kt:coil:$coilVersion"
9090
coilSvg = "io.coil-kt:coil-svg:$coilVersion"

common/src/main/java/jp/co/soramitsu/common/compose/component/ActionBar.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ fun ActionBar(
5151
) {
5252
Row(Modifier.padding(vertical = 4.dp)) {
5353
state.actionItems.forEachIndexed { index, actionItem ->
54-
val itemClickHandler = remember { { onItemClick(actionItem, state.chainId, state.chainAssetId) } }
54+
val itemClickHandler = remember(actionItem, state.chainId, state.chainAssetId) {
55+
{ onItemClick(actionItem, state.chainId, state.chainAssetId) }
56+
}
5557
val icon = painterResource(id = actionItem.iconId)
5658
val title = stringResource(id = actionItem.titleId)
5759
val actionViewState = remember {

common/src/main/java/jp/co/soramitsu/common/compose/component/AssetListItem.kt

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.height
1212
import androidx.compose.foundation.layout.padding
1313
import androidx.compose.foundation.layout.size
1414
import androidx.compose.foundation.layout.width
15+
import androidx.compose.material.Card
1516
import androidx.compose.material.Divider
1617
import androidx.compose.material.Icon
1718
import androidx.compose.material.MaterialTheme
@@ -26,16 +27,19 @@ import androidx.compose.ui.graphics.Color
2627
import androidx.compose.ui.platform.LocalContext
2728
import androidx.compose.ui.platform.testTag
2829
import androidx.compose.ui.res.painterResource
30+
import androidx.compose.ui.res.stringResource
2931
import androidx.compose.ui.tooling.preview.Preview
3032
import androidx.compose.ui.unit.dp
3133
import coil.compose.AsyncImage
3234
import com.valentinilk.shimmer.shimmer
3335
import jp.co.soramitsu.common.R
3436
import jp.co.soramitsu.common.compose.theme.FearlessTheme
3537
import jp.co.soramitsu.common.compose.theme.alertYellow
38+
import jp.co.soramitsu.common.compose.theme.bold
3639
import jp.co.soramitsu.common.compose.theme.customColors
3740
import jp.co.soramitsu.common.compose.theme.customTypography
3841
import jp.co.soramitsu.common.compose.theme.white16
42+
import jp.co.soramitsu.common.compose.theme.white64
3943
import jp.co.soramitsu.common.compose.viewstate.AssetListItemShimmerViewState
4044
import jp.co.soramitsu.common.compose.viewstate.AssetListItemViewState
4145

@@ -88,13 +92,19 @@ fun AssetListItem(
8892
.padding(vertical = 8.dp)
8993
.align(CenterVertically)
9094
) {
91-
Text(
92-
text = state.assetName.uppercase(),
93-
style = MaterialTheme.customTypography.capsTitle2,
94-
modifier = Modifier
95-
.alpha(0.64f)
96-
.testTag("AssetListItem_${state.assetSymbol}_chain_name")
97-
)
95+
Row {
96+
Text(
97+
text = state.assetName.uppercase(),
98+
style = MaterialTheme.customTypography.capsTitle2,
99+
modifier = Modifier
100+
.alpha(0.64f)
101+
.testTag("AssetListItem_${state.assetSymbol}_chain_name")
102+
)
103+
if (state.isTestnet) {
104+
MarginHorizontal(margin = 4.dp)
105+
TestnetBadge()
106+
}
107+
}
98108
Text(
99109
text = state.displayName.uppercase(),
100110
style = MaterialTheme.customTypography.header3,
@@ -184,6 +194,31 @@ fun AssetListItem(
184194
}
185195
}
186196

197+
@Composable
198+
fun TestnetBadge() {
199+
Card(backgroundColor = white16) {
200+
Row(
201+
modifier = Modifier
202+
.padding(bottom = 2.dp, start = 2.dp, end = 4.dp),
203+
verticalAlignment = CenterVertically
204+
) {
205+
Icon(
206+
modifier = Modifier
207+
.width(16.dp)
208+
.padding(top = 1.dp),
209+
painter = painterResource(R.drawable.ic_token_testnet),
210+
tint = white64,
211+
contentDescription = null
212+
)
213+
MarginHorizontal(margin = 4.dp)
214+
Text(
215+
text = stringResource(id = R.string.label_testnet).uppercase(),
216+
style = MaterialTheme.customTypography.body3.bold().copy(color = white64)
217+
)
218+
}
219+
}
220+
}
221+
187222
@Composable
188223
fun AssetListItemShimmer(
189224
state: AssetListItemShimmerViewState,
@@ -324,13 +359,14 @@ private fun PreviewAssetListItem() {
324359
hasAccount = true,
325360
priceId = null,
326361
hasNetworkIssue = false,
327-
ecosystem = "Polkadot"
362+
ecosystem = "Polkadot",
363+
isTestnet = false
328364
)
329365
FearlessTheme {
330366
Box(modifier = Modifier.background(Color.Black)) {
331367
Column {
332368
AssetListItem(state) {}
333-
AssetListItem(state.copy(hasAccount = false)) {}
369+
AssetListItem(state.copy(hasAccount = false, isTestnet = true)) {}
334370
AssetListItemShimmer(
335371
state = AssetListItemShimmerViewState(assetIconUrl, assetChainUrlsMap.values.toList())
336372
)

common/src/main/java/jp/co/soramitsu/common/compose/component/AssetSelector.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ fun AssetSelector(
103103
fun Badge(text: String, modifier: Modifier = Modifier) {
104104
Row(modifier = modifier.background(color = white16, shape = RoundedCornerShape(size = 3.dp))) {
105105
MarginHorizontal(margin = 6.dp)
106-
Text(
107-
text = text.uppercase(),
108-
style = MaterialTheme.customTypography.capsTitle2
109-
)
106+
H6(text = text)
110107
MarginHorizontal(margin = 6.dp)
111108
}
112109
}
@@ -132,7 +129,7 @@ fun Badge(
132129
modifier = Modifier.size(16.dp)
133130
)
134131
MarginHorizontal(margin = 4.dp)
135-
CapsTitle(text = stringResource(id = labelResId))
132+
H6(text = stringResource(id = labelResId))
136133
}
137134
}
138135

@@ -158,7 +155,7 @@ fun Badge(
158155
)
159156
}
160157
MarginHorizontal(margin = 4.dp)
161-
CapsTitle(text = stringResource(id = labelResId))
158+
H6(text = stringResource(id = labelResId))
162159
}
163160
}
164161

common/src/main/java/jp/co/soramitsu/common/compose/component/FullScreenLoading.kt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,14 @@ fun FullScreenLoading(
6363
.border(4.dp, white08, shape = CircleShape)
6464
.background(transparent, shape = CircleShape)
6565
)
66-
Box(
66+
CircularProgressIndicator(
6767
modifier = Modifier
6868
.fillMaxSize()
69-
.blur(1.dp)
7069
.padding(8.dp)
71-
) {
72-
CircularProgressIndicator(
73-
modifier = Modifier
74-
.fillMaxSize()
75-
.align(Alignment.Center),
76-
color = colorAccentDark,
77-
strokeWidth = 4.dp
78-
)
79-
}
70+
.align(Alignment.Center),
71+
color = colorAccentDark,
72+
strokeWidth = 4.dp
73+
)
8074
Image(
8175
res = R.drawable.ic_fearless_logo,
8276
tint = colorAccentDark,

common/src/main/java/jp/co/soramitsu/common/compose/component/SwipeBox.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ private fun AssetItemSwipeBoxPreview() {
186186
hasAccount = true,
187187
priceId = null,
188188
hasNetworkIssue = false,
189-
ecosystem = "Polkadot"
189+
ecosystem = "Polkadot",
190+
isTestnet = false
190191
)
191192

192193
Column(modifier = Modifier.padding(horizontal = 16.dp)) {

common/src/main/java/jp/co/soramitsu/common/compose/viewstate/AssetListItemViewState.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ data class AssetListItemViewState(
1818
val hasAccount: Boolean,
1919
val priceId: String?,
2020
val hasNetworkIssue: Boolean,
21-
val ecosystem: String?
21+
val ecosystem: String?,
22+
val isTestnet: Boolean
2223
) {
2324
val key = listOf(ecosystem, chainAssetId, chainId, isHidden).joinToString()
2425
}

common/src/main/java/jp/co/soramitsu/common/di/modules/CommonModule.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import jp.co.soramitsu.common.validation.ValidationExecutor
4040
import jp.co.soramitsu.common.vibration.DeviceVibrator
4141
import jp.co.soramitsu.core.extrinsic.ExtrinsicBuilderFactory
4242
import jp.co.soramitsu.core.extrinsic.ExtrinsicService
43-
import jp.co.soramitsu.core.extrinsic.KeyPairProvider
43+
import jp.co.soramitsu.core.extrinsic.keypair_provider.KeypairProvider
4444
import jp.co.soramitsu.core.rpc.RpcCalls
4545
import jp.co.soramitsu.shared_utils.encrypt.Signer
4646
import jp.co.soramitsu.shared_utils.icon.IconGenerator
@@ -74,12 +74,12 @@ class CommonModule {
7474
@Provides
7575
fun provideExtrinsicService(
7676
rpcCalls: RpcCalls,
77-
keyPairProvider: KeyPairProvider,
77+
keypairProvider: KeypairProvider,
7878
extrinsicBuilderFactory: ExtrinsicBuilderFactory
7979
): ExtrinsicService {
8080
return ExtrinsicService(
8181
rpcCalls = rpcCalls,
82-
keyPairProvider = keyPairProvider,
82+
keypairProvider = keypairProvider,
8383
extrinsicBuilderFactory = extrinsicBuilderFactory
8484
)
8585
}

common/src/main/res/drawable/ic_token_testnet.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
android:viewportWidth="16"
55
android:viewportHeight="11">
66
<path
7-
android:fillAlpha="0.64"
87
android:fillColor="#ffffff"
98
android:fillType="evenOdd"
109
android:pathData="M13.0009,5.4985L10.5314,3.0289L11.592,1.9683L15.1221,5.4985L11.592,9.0286L10.5314,7.968L13.0009,5.4985Z" />
1110
<path
12-
android:fillAlpha="0.64"
1311
android:fillColor="#ffffff"
1412
android:fillType="evenOdd"
1513
android:pathData="M3.0037,5.4984L5.4733,7.968L4.4127,9.0286L0.8825,5.4984L4.4127,1.9683L5.4733,3.0289L3.0037,5.4984Z" />
1614
<path
17-
android:fillAlpha="0.64"
1815
android:fillColor="#ffffff"
1916
android:pathData="M9.0266,0.24l1.5662,0.57l-3.6221,9.9517l-1.5662,-0.57z" />
2017
</vector>

0 commit comments

Comments
 (0)