Skip to content

Commit

Permalink
Merge pull request #41 from Toporin/update/ui-reset-and-unseal-issues
Browse files Browse the repository at this point in the history
update: fixed ui for reset and unseal screens
  • Loading branch information
Toporin authored Jul 5, 2024
2 parents 9893f1f + 1ae4ed7 commit 2905817
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 36 deletions.
21 changes: 6 additions & 15 deletions app/src/main/java/org/satochip/satodimeapp/ui/ResetWarningView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ import org.satochip.satodimeapp.ui.components.BottomButton
import org.satochip.satodimeapp.ui.components.EmptyVaultCard
import org.satochip.satodimeapp.ui.components.NfcDialog
import org.satochip.satodimeapp.ui.components.RedGradientBackground
import org.satochip.satodimeapp.ui.components.TopLeftBackButton
import org.satochip.satodimeapp.ui.components.VaultCard
import org.satochip.satodimeapp.ui.components.shared.HeaderRow
import org.satochip.satodimeapp.ui.theme.LightGray
import org.satochip.satodimeapp.ui.theme.SatodimeTheme
import org.satochip.satodimeapp.util.SatodimeScreen
Expand All @@ -61,28 +61,19 @@ fun ResetWarningView(navController: NavController, sharedViewModel: SharedViewMo
val isReadyToNavigate = remember{ mutableStateOf(false) }// for auto navigation to next view

val vaults = sharedViewModel.cardVaults
// val vaultsSize = vaults?.size ?: 0
// if(selectedVault > vaultsSize || vaults?.get(selectedVault - 1) == null) {
// SatoLog.e(TAG, "ResetWarningView VAULT IS NULL!!")
// }

RedGradientBackground()
TopLeftBackButton(navController)
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.fillMaxSize()
.padding(10.dp)
) {
Text(
modifier = Modifier
.padding(20.dp),
textAlign = TextAlign.Center,
fontSize = 20.sp,
fontWeight = FontWeight.Medium,
style = MaterialTheme.typography.body1,
color = MaterialTheme.colors.secondary,
text = stringResource(R.string.warning)
HeaderRow(
onClick = {
navController.navigateUp()
},
titleText = R.string.warning
)
Text(
modifier = Modifier
Expand Down
50 changes: 30 additions & 20 deletions app/src/main/java/org/satochip/satodimeapp/ui/UnsealCongratsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import android.widget.Toast
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults
Expand Down Expand Up @@ -101,27 +103,35 @@ fun UnsealCongratsView(navController: NavController, sharedViewModel: SharedView
)

//Spacer(Modifier.weight(1f))
LazyColumn(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally
) {
item {
BottomButton(
onClick = {
navController.navigate(SatodimeScreen.ShowPrivateKey.name + "/$selectedVault") {
popUpTo(0)
}
},
width = 200.dp,
text = stringResource(R.string.showThePrivateKey)
)
}

BottomButton(
onClick = {
navController.navigate(SatodimeScreen.ShowPrivateKey.name + "/$selectedVault") {
popUpTo(0)
}
},
width = 200.dp,
text = stringResource(R.string.showThePrivateKey)
)

// BACK TO VAULT BUTTON
BottomButton(
onClick = {
navController.navigate(SatodimeScreen.Vaults.name) {
popUpTo(0)
}
},
width = 240.dp,
text = stringResource(R.string.backToMyVaults)
)
item {
// BACK TO VAULT BUTTON
BottomButton(
onClick = {
navController.navigate(SatodimeScreen.Vaults.name) {
popUpTo(0)
}
},
width = 240.dp,
text = stringResource(R.string.backToMyVaults)
)
}
}

}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To facilitate maintenance, keep same key name whenever possible
<string name="welcome">Welcome</string>
<string name="satodimeLetsYou">Satodime lets you easily create vaults to store your cryptocurrencies. It supports the most innovative crypto-assets.</string>
<string name="allOurProducts">All our products</string>
<string name="vaultSuccessfullyUnseal">Vault successfully unseal</string>
<string name="vaultSuccessfullyUnseal">Vault successfully unsealed</string>
<string name="vaultSuccessfullyReset">Vault successfully RESET.</string>
<string name="youCanNowCreateAndSeal">You can now CREATE and SEAL a new vault.</string>
<!-- <string name="vault_cap">Vault</string>-->
Expand Down

0 comments on commit 2905817

Please sign in to comment.