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
Fix several UX issues in address element #5462
Conversation
171398c
to
05263ae
Compare
Diffuse output:
APK
DEX
|
05263ae
to
401309c
Compare
- Make sure there's an expand animation when opening the sheet - Make screens scrollable, which is necessary in landscape mode - Prevent search field from re-requesting focus after user hits enter - Adjust `Enter manually` font size - Prevent address sheet dismissal (only in auto-complete screen) and half-expanded state - Fix dismissal animation by overriding pending transitions
// this is a transparent Activity so we want to disable animations | ||
overridePendingTransition(0, 0) | ||
private fun setFadeAnimations() { | ||
overridePendingTransition(AnimationConstants.FADE_IN, AnimationConstants.FADE_OUT) |
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 figured we could use fade animations in all places where we were currently overriding pending transitions, as this results in a much smoother look. Any concerns about this?
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.
Does it change anything? This activity has no UI
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.
That one is indeed a bad example 🙈 There is a noticeable difference with the payment sheet though. I figured it wouldn’t hurt to apply the same everywhere to discourage using no animations.
401309c
to
8e18fb3
Compare
confirmStateChange = { | ||
val route = navController.currentDestination?.route | ||
route != AddressElementScreen.Autocomplete.route | ||
} |
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 find that the user shouldn’t be able to exit from the sheet while in the autocomplete screen. Any concerns around this?
public final class com/stripe/android/paymentsheet/addresselement/AddressUtilsKt { | ||
public static final fun levenshtein (Ljava/lang/CharSequence;Ljava/lang/CharSequence;)I | ||
} | ||
|
||
public final class com/stripe/android/paymentsheet/addresselement/AutocompleteScreenKt { | ||
public static final field TEST_TAG_ATTRIBUTION_DRAWABLE Ljava/lang/String; | ||
} |
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.
These two things were made public by accident, right?
@Composable | ||
internal fun ScrollableColumn( | ||
modifier: Modifier = Modifier, | ||
content: @Composable ColumnScope.() -> Unit | ||
) { | ||
Box( | ||
modifier = Modifier.verticalScroll(rememberScrollState()) | ||
) { | ||
Column( | ||
modifier = modifier, | ||
content = 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.
Similar to what we’re using in Link. Let me know if you prefer a different approach.
.padding( | ||
vertical = 8.dp, | ||
horizontal = 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.
Throughout this file, I made a few changes to where padding is applied. I did this to make sure that the click ripple effect looks correct, meaning that it spans the entire width and height of a row.
Summary
This pull request fixes a few UX issues in the address element screens:
ScrollableColumn
composable.Enter manually
font size.Motivation
Things that came up in the Address Element bug bash.
Testing
Screen recordings
Before
before.mp4
After
after.mp4
Changelog
Nothing to add.