-
Notifications
You must be signed in to change notification settings - Fork 6
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
[ABW-1672] Add info popup #1169
Conversation
app/src/main/java/com/babylon/wallet/android/presentation/dialogs/info/InfoDialog.kt
Show resolved
Hide resolved
onDismiss = onDismiss | ||
) { | ||
InfoDialogContent( | ||
scrollState = ScrollState(initial = 0), |
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.
Maybe rememberScrollState
? I think this will also fix the issue of the scroll being reset (scrolled up) after clicking a URL and getting back to the app (or after pausing and resuming the app while the info pop up is displayed)
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 did this on purpose for the glossary items. For example, when you click on XRD
it will scroll to the top so you can see the content from the beginning.
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.
Makes sense, then to improve this and also fix the issue I described maybe it's worth using rememberScrollState
and scrolling to the top based on a boolean (using LaunchedEffect) only when tapping on a glossary item and not a URL.
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.
did ti with a slightly different way
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.
Even better!
app/src/main/java/com/babylon/wallet/android/presentation/dialogs/info/InfoDialog.kt
Outdated
Show resolved
Hide resolved
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 info links seem to have the wrong blue color. See an example here.
@@ -0,0 +1,34 @@ | |||
package com.babylon.wallet.android.presentation.dialogs.info | |||
|
|||
// the enums are defined the same way they are written in Strings ("glossaryAnchor" tags) |
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.
Why did we need to define them that way? Does this have to do with serialization?
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.
we are planning to define them in Sargon, and plus to easily get the valueOf
based on the glossary anchor value.
val context = LocalContext.current | ||
|
||
val customHeading2: MarkdownComponent = { | ||
val content = it.content |
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 am a bit confused by it
. Where does this come from?
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 comes from the composable
typealias MarkdownComponent = @Composable ColumnScope.(MarkdownComponentModel) -> Unit
it
is the MarkdownComponentModel
.
I updated this part
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.
Looks good!
app/src/main/java/com/babylon/wallet/android/presentation/dialogs/info/InfoDialog.kt
Outdated
Show resolved
Hide resolved
@@ -132,7 +132,7 @@ private fun InfoDialogContent( | |||
Column( | |||
modifier = modifier | |||
.background(RadixTheme.colors.defaultBackground) | |||
.fillMaxHeight(0.5f) | |||
.fillMaxHeight(0.9f) |
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.
Now it looks way better!
@@ -153,6 +156,10 @@ private fun InfoDialogContent( | |||
override fun openUri(uri: String) { | |||
if (uri.contains(GLOSSARY_ANCHOR)) { | |||
onGlossaryItemClick(uri.drop(GLOSSARY_ANCHOR.length)) | |||
coroutineScope.launch { | |||
// dialog updated with new glossary item therefore scroll to top | |||
scrollState.animateScrollTo(0) |
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.
👍
d9f1ebd
to
977fc05
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.
If it's not a very difficult addition, it would be nice to display the title at the top of the info sheet when scrolling up and it's not visible anymore as part of the sheet content. This behavior is present on iOS and it looks good.
8c33a55
to
835fbb1
Compare
in TransactionReviewScreen
bbb9b7e
to
5b97361
Compare
Quality Gate failedFailed conditions |
Description
This PR adds info buttons and info dialogs. It also:
WarningText
InfoButton
InfoDialog
composable screen that can be triggers from several places in the wallet (similar to asset dialogs)How to test
glossaryAnchor
s that update the content of the info dialog: See the videoVideo
Screen_Recording_20240901_172302_Radix.Wallet.Dev.mp4
PR submission checklist