Conversation
- Force portrait orientation on the login flow. - Create `NumberedList` UI components. - Improve camera permission dialog. - Improve how the QR code preview is rendered. - Freeze the last frame of the preview when a QR code is read. - Update `FlowStepPage` contents to fit the new designs. - Update strings in UI.
This needs `jme/qr-login-for-testing-with-clients` branch in the rust-sdk project
…lient and other SDK services
Rename `QrCodeLoginPresenter` to `QrCodeLoginManager`, since it's not really a presenter.
ganfra
left a comment
There was a problem hiding this comment.
Good work!
Have not tested yet, but I'll.
Some small remarks/questions.
There was a problem hiding this comment.
Button is close to the CameraView?
There was a problem hiding this comment.
6ff42bc, I thought it was going to be harder to fix.
| @@ -75,6 +77,7 @@ class NotLoggedInFlowNode @AssistedInject constructor( | |||
| @Parcelize | |||
| data class LoginFlow( | |||
There was a problem hiding this comment.
Should not be an enum? I don't think we can have both to true, right?
|
|
||
| @SingleIn(QrCodeLoginScope::class) | ||
| @MergeSubcomponent(QrCodeLoginScope::class) | ||
| interface QrCodeLoginComponent : NodeFactoriesBindings { |
There was a problem hiding this comment.
Do we really need a separate component and scope for this? This is just to keep the StateFlow<QrCodeLoginStep>?
There was a problem hiding this comment.
The problem here is QrCodeLoginManager had to be shared by several components (QrCodeLofingFlowNode, QrCodeScanPresenter) and for that I needed a singleton if I'm not mistaken. But having a singleton can be troublesome if you aren't super careful with cleaning up its state once you're done working with it, so I created a new component to hold it that will be created when the QR code flow starts and discarded once it's finished.
This should ensure the object is shared but can't be leaked in any way, although it's more complex than I intended it to be.
| import io.element.android.libraries.architecture.inputs | ||
| import io.element.android.libraries.di.AppScope | ||
|
|
||
| @ContributesNode(AppScope::class) |
| import io.element.android.libraries.core.meta.BuildMeta | ||
| import io.element.android.libraries.di.AppScope | ||
|
|
||
| @ContributesNode(AppScope::class) |
| import io.element.android.anvilannotations.ContributesNode | ||
| import io.element.android.libraries.di.AppScope | ||
|
|
||
| @ContributesNode(AppScope::class) |
| FeatureFlags.MarkAsUnread -> true | ||
| FeatureFlags.RoomDirectorySearch -> false | ||
| FeatureFlags.ShowBlockedUsersDetails -> false | ||
| FeatureFlags.QrCodeLogin -> OnBoardingConfig.CAN_LOGIN_WITH_QR_CODE |
There was a problem hiding this comment.
I'd prefer the value to be directly here...
There was a problem hiding this comment.
We're probably going to remove the feature flag soon-ish and go back to the build config constant, so I made this compromise because I didn't want to remove the constant just to add it back later or have 1 value that actually does something (FF here) and another that does nothing at the same time.
68efc1f to
6b5e558
Compare
bmarty
left a comment
There was a problem hiding this comment.
I guess it's fine since the feature is still disabled (CAN_LOGIN_WITH_QR_CODE = false)
|
|
I've tested the latest build against synapse-oidc.lab.element.dev with no issues found. |




Type of change
Content
:libraries:matrixmodules to map data from/to the Rust SDK and perform a QR code login.OnboardingConfigto:appconfig.Zxinglibrary withZxing-CPPwhich was re-built in native code and is faster and more accurate (Zxing, or at least the version we had to use was outdated and didn't work well with some generated QRs).Motivation and context
Closes #2632.
Screenshots / GIFs
Lots in the PR.
Tests
Tested devices
Checklist