Add initial UI for NFC scanning#13299
Conversation
39f4dde to
c0cc127
Compare
| yBias = normalizedYBias, | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
Normalizes the tap zone based on the screen orientation, important because the biases received assume portrait mode only. Normalizing these values based on the exact orientation allows for accurately showing where the NFC coil is located.
| NfcCoilLayout(tapZone, deviceRotation) | ||
| CloseButtonLayout(tapZone, deviceRotation, onClose) | ||
| } | ||
| } |
There was a problem hiding this comment.
A lot of logic for handling device orientation. We can no longer just build features like this for portrait mode anymore and lock activities in that orientation for larger devices (width greater than 600dp). Android 16 initially disabled this behavior for larger devices (more than 600dp) by default with a developer opt-out. Android 17 is doing away the developer opt-in, completely removing the ability to lock orientation.
While this does mean that most devices can still be locked on orientation, foldable devices like the Google Pixel Pro Fold would not respect the lock.
There was a problem hiding this comment.
Terminal had to do the same thing recently.
c0cc127 to
ec7eab1
Compare
ec7eab1 to
465b19c
Compare
465b19c to
57964ff
Compare
amk-stripe
left a comment
There was a problem hiding this comment.
Can you add some more tests? E.g. do we have test coverage for DeviceRotation and for the changes made to NfcScanningActivity?
| } | ||
| } | ||
|
|
||
| internal fun Context.getDeviceRotation(): DeviceRotation { |
There was a problem hiding this comment.
should we annotate this as @VisibleForTesting?
Summary
Add initial UI for NFC scanning that renders the NFC coil and the cancel button on the screen based on the NFC antenna location, taking into account the device rotation.
Motivation
Setup UI for NFC Scanning
Testing