From fb6396a464847d5f79035f257c8465e5e3ddfe1c Mon Sep 17 00:00:00 2001 From: Jacob Date: Tue, 21 Jan 2025 14:44:44 +0000 Subject: [PATCH] Comment out mDL generation button (#93) --- .../walletsettings/WalletSettingsHomeView.kt | 127 +++++++++--------- 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/example/src/main/java/com/spruceid/mobilesdkexample/walletsettings/WalletSettingsHomeView.kt b/example/src/main/java/com/spruceid/mobilesdkexample/walletsettings/WalletSettingsHomeView.kt index 03dbd03..bc719c8 100644 --- a/example/src/main/java/com/spruceid/mobilesdkexample/walletsettings/WalletSettingsHomeView.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/walletsettings/WalletSettingsHomeView.kt @@ -178,70 +178,71 @@ fun WalletSettingsHomeBody( } } // Uncomment to add test mDL generation button to the settings page. - Box( - Modifier - .fillMaxWidth() - .clickable { - scope.launch { - val keyManager = KeyManager() - val keyAlias = "testMdl" - if (!keyManager.keyExists(keyAlias)) { - keyManager.generateSigningKey(keyAlias) - } - val mdl = generateTestMdl(KeyManager(), keyAlias) - val mdocPack = - try { - credentialPacksViewModel.credentialPacks.value.first { pack -> - pack.list().any { credential -> credential.asMsoMdoc() != null } - } - } catch (error: NoSuchElementException) { - CredentialPack() - } - mdocPack.addMdoc(mdl); - credentialPacksViewModel.saveCredentialPack(mdocPack) - } - }, - ) { - Column { - Row( - Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically, - ) { - Row( - verticalAlignment = Alignment.CenterVertically, - ) { - Image( - painter = painterResource(id = R.drawable.unknown), - contentDescription = stringResource(id = R.string.unknown_check), - modifier = Modifier.padding(end = 5.dp), - ) - Text( - text = "Generate mDL", - fontFamily = Inter, - fontWeight = FontWeight.Medium, - fontSize = 17.sp, - color = ColorStone950, - modifier = Modifier.padding(bottom = 5.dp, top = 5.dp), - ) - } +// Box( +// Modifier +// .fillMaxWidth() +// .clickable { +// scope.launch { +// val keyManager = KeyManager() +// val keyAlias = "testMdl" +// if (!keyManager.keyExists(keyAlias)) { +// keyManager.generateSigningKey(keyAlias) +// } +// val mdl = generateTestMdl(KeyManager(), keyAlias) +// val mdocPack = +// try { +// credentialPacksViewModel.credentialPacks.value.first { pack -> +// pack.list().any { credential -> credential.asMsoMdoc() != null } +// } +// } catch (error: NoSuchElementException) { +// CredentialPack() +// } +// mdocPack.addMdoc(mdl); +// credentialPacksViewModel.saveCredentialPack(mdocPack) +// } +// }, +// ) { +// Column { +// Row( +// Modifier.fillMaxWidth(), +// horizontalArrangement = Arrangement.SpaceBetween, +// verticalAlignment = Alignment.CenterVertically, +// ) { +// Row( +// verticalAlignment = Alignment.CenterVertically, +// ) { +// Image( +// painter = painterResource(id = R.drawable.unknown), +// contentDescription = stringResource(id = R.string.unknown_check), +// modifier = Modifier.padding(end = 5.dp), +// ) +// Text( +// text = "Generate mDL", +// fontFamily = Inter, +// fontWeight = FontWeight.Medium, +// fontSize = 17.sp, +// color = ColorStone950, +// modifier = Modifier.padding(bottom = 5.dp, top = 5.dp), +// ) +// } +// +// Image( +// painter = painterResource(id = R.drawable.chevron), +// contentDescription = stringResource(id = R.string.chevron), +// modifier = Modifier.scale(0.5f) +// ) +// } +// +// Text( +// text = "Generate a fresh test mDL issued by the SpruceID Test CA", +// fontFamily = Inter, +// fontWeight = FontWeight.Normal, +// fontSize = 15.sp, +// color = ColorStone600, +// ) +// } +// } - Image( - painter = painterResource(id = R.drawable.chevron), - contentDescription = stringResource(id = R.string.chevron), - modifier = Modifier.scale(0.5f) - ) - } - - Text( - text = "Generate a fresh test mDL issued by the SpruceID Test CA", - fontFamily = Inter, - fontWeight = FontWeight.Normal, - fontSize = 15.sp, - color = ColorStone600, - ) - } - } Spacer(Modifier.weight(1f)) Button( onClick = {