Skip to content
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

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Add new 'wallet' module. #448

merged 1 commit into from
Jan 19, 2024

Conversation

davidz25
Copy link
Contributor

No description provided.

if (application.addSelfsignedMdl()) {
navigation.popBackStack()
} else {
Toast.makeText(applicationContext,
Copy link
Contributor

@dritan-x dritan-x Jan 18, 2024

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

Copy link
Contributor Author

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))
Copy link
Contributor

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

Copy link
Contributor Author

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 {
Copy link
Contributor

@dritan-x dritan-x Jan 18, 2024

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..)

Copy link
Contributor Author

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,
Copy link
Contributor

@dritan-x dritan-x Jan 18, 2024

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, exactly!

Copy link
Contributor

@dritan-x dritan-x left a 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

@davidz25 davidz25 force-pushed the new-wallet-app branch 2 times, most recently from 2d4a4af to 4545525 Compare January 18, 2024 19:16
Copy link
Contributor

@suzannajiwani suzannajiwani left a 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the copyright here

Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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") },
Copy link
Contributor

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"

Copy link
Contributor Author

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.

Comment on lines +266 to +271
Image(
bitmap = credentialBitmap.asImageBitmap(),
contentDescription = "Artwork for $credentialName",
modifier = Modifier.clickable(onClick = {
navigation.navigate("CredentialInfo/$credentialId")
})
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright

@davidz25 davidz25 force-pushed the new-wallet-app branch 3 times, most recently from 924c9ed to 3919847 Compare January 19, 2024 00:05
Test: All unit tests pass
Test: Manually tested all apps

Signed-off-by: David Zeuthen <[email protected]>
@davidz25 davidz25 merged commit 33408e2 into main Jan 19, 2024
5 checks passed
@davidz25 davidz25 deleted the new-wallet-app branch January 19, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants