NFC payment: New animation and polish motion (reduced-motion + faster timings)#164
Open
swedishfrenchpress wants to merge 15 commits intomainfrom
Open
NFC payment: New animation and polish motion (reduced-motion + faster timings)#164swedishfrenchpress wants to merge 15 commits intomainfrom
swedishfrenchpress wants to merge 15 commits intomainfrom
Conversation
Closed
…ly until the payment actually succeeds or fails.
Collaborator
|
@swedishfrenchpress It looks like |
Collaborator
Author
good catch. i verified this with my AI and just pushed a commit. |
Collaborator
Author
|
update on latest changes: Payment Animation Changes (Native Migration)What changed
Why native is better than the old WebView here
Notes
|
- Cancel NFC safety timeout in onCashuTokenReceived to prevent race conditions with slow network operations. - Rename NFC_ANIMATION_SAFETY_TIMEOUT_MS to NFC_READ_TIMEOUT_MS to better reflect its purpose.
- Add isProcessingNfcPayment flag to lock out subsequent NFC operations once a token is received. - Ignore onNfcReadingStarted if a payment is already processing, preventing the safety timeout from being re-armed during slow swap operations. - This fixes a race condition where NFC connection bounces could cause premature timeout failures during successful payments.
- Replace verbose error message on NFC failure screen with a simple 'Payment failed' title. - Prevents error messages from being truncated or overwhelming the user.
Collaborator
Author
|
@a1denvalu3 i think this is ready to do. i haven't pushed any changes. it's been to challenging to get the nfc processing screen to animate. i think for launch we can live with this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR ports the WebView-based NFC payment animation from
erik_nfc_animation_v4to the current branch and applies motion design best practices based on Emil Kowalski, Jakub Krehel, and accessibility guidelines.Changes
NFC Animation Migration
NfcPaymentAnimationViewwith WebView-based animation (nfc_animation.html)Motion Design Improvements
prefers-reduced-motionmedia query support (critical for users with vestibular disorders)scale(0)animations toscale(0.9)for gentler, more natural movementTiming Changes
New Files
app/src/main/assets/nfc_animation.html- WebView animationapp/src/main/res/anim/fade_in.xml- Activity fade transitionapp/src/main/res/anim/fade_out.xml- Activity fade transitionapp/src/main/res/drawable/bg_button_black_pill.xml- Close button backgroundapp/src/main/res/drawable-night/bg_button_black_pill.xml- Dark mode variantModified Files
PaymentRequestActivity.kt- WebView setup, animation callbacks, fullscreen handlingactivity_payment_request.xml- Replaced custom view with WebView containerstrings.xml- Added close button text