-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new 'wallet' module. #448
Conversation
eff4c02
to
f9de9c7
Compare
wallet/src/main/java/com/android/identity_credential/wallet/MainActivity.kt
Show resolved
Hide resolved
if (application.addSelfsignedMdl()) { | ||
navigation.popBackStack() | ||
} else { | ||
Toast.makeText(applicationContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatives to add in next iteration:
- snackbar that dismisses itself after 5? or 10? seconds to user has a chance to see this message
- popup modal/dialog with acknowledgement from user in the event they don't see the toast or snackbar on the bottom, tapping on "OK" dismisses it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't worry about this. This code here is very temporary and will go away once we stand up a proper IssuingAuthority
interface with a dedicated IssuingAuthoritySelfSignedMdl
implementation (as well as other implementations).
drawerState = drawerState, | ||
drawerContent = { | ||
ModalDrawerSheet { | ||
Text("Wallet", modifier = Modifier.padding(16.dp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the next iteration, we should probably put all the text strings in xml for translation/localization so this POC can be shown in various countries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. We also need to figure out how much of this is dynamic configuration downloaded from a "Wallet Server" and how much is using the usual i18n/l10n infrastructure. Cc @GarethCOliver
import kotlin.math.ceil | ||
|
||
class WalletApplication : Application() { | ||
companion object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the next iteration, we can define an object WalletConsts
(or some other meaningful name) in its own file that is accessible globally rather than adding a companion object
to the Application
class (which is reserved for application-specific logic - such as instantiation of singletons, context propagation, etc..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is something we need to design properly, the ddoc already has a section for it!
credentialStore = CredentialStore(storageEngine, secureAreaRepository) | ||
} | ||
|
||
private fun createArtwork(color1: Int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the next iteration, we can decouple these and all provision-related code into a provisioning-specific file/class for better modularity and encapsulation of related business logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, exactly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first version base foundation LGTM! I'm happy to make all proposed changes in the next iteration
2d4a4af
to
4545525
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the copyrights, just a few nits - otherwise, I'm a big fan of the overall look + flow
@@ -0,0 +1,477 @@ | |||
@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the copyright here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually noticing now that the appholder/appverifier MainActivity classes also don't have the copyright - should we add to these types of files or leave off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure what to put in the copyright header (or if it's even advisable to have one) so I suggest we leave that out for now until I consult with OWF.
|
||
setContent { | ||
IdentityCredentialTheme { | ||
// A surface container using the 'background' color from the theme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like an extraneous comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was autogenerated!
Divider() | ||
NavigationDrawerItem( | ||
icon = { Icon(imageVector = Icons.Filled.Add, contentDescription = null) }, | ||
label = { Text(text = "Add to Wallet") }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo would be more clear if it said something along the lines of "Add new Credential to Wallet"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is displayed in the UI in a pretty narrow drawer so I'd like to keep it short.
Image( | ||
bitmap = credentialBitmap.asImageBitmap(), | ||
contentDescription = "Artwork for $credentialName", | ||
modifier = Modifier.clickable(onClick = { | ||
navigation.navigate("CredentialInfo/$credentialId") | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the card image looks really slick on-screen! I also like the HorizontalPager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, yea, I think we actually want to spend some time on getting some nice generic artwork and writing code to overlay parts of the holder's name.
@@ -0,0 +1,284 @@ | |||
package com.android.identity_credential.wallet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyright
924c9ed
to
3919847
Compare
Test: All unit tests pass Test: Manually tested all apps Signed-off-by: David Zeuthen <[email protected]>
3919847
to
efa73cc
Compare
No description provided.