-
Notifications
You must be signed in to change notification settings - Fork 767
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
QR Code Login UI #7338
Merged
Merged
QR Code Login UI #7338
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
06c0d61
Create base classes.
6fbdd87
Create custom view for header section.
4fdb4e8
Create custom view for instructions section.
9859dab
Complete qr code login instructions screen.
5f6c8ee
Navigate to the instructions screen.
5dfaa25
Remove unused session parameter.
9b7f6c9
Navigate to qr code scanner activity.
945fa0a
Create qr code login status view layout.
a66b183
Add connection status to the view state.
a00afa7
Simulate qr login states.
1932eda
Fix instructions view visibility.
04fb316
Implement show qr code screen.
2527cab
Fix cancel actions.
2b452d6
Implement qr code login failed states.
236b303
Fix ui test case.
ad208a0
Refactor layout.
aacf2ba
Refactor layout.
5566300
Add qr code options to layout.
f272e56
Implement link a device flow.
d8ea9c8
Add flag for qr code login.
87956e9
Retry scanning if not a QR code
hughns 1235db7
Implementations of MSC3886 and MSC3903
hughns 4b14ee4
Partial implementation of QR login logic
hughns 1e1affb
Merge branch 'develop' into feature/ons/qr_code_login_ui
6e58f2f
Only do completeOnNewDevice if we received a confirmation code
hughns fb2776d
Cherry pick previous commits.
e554b43
Merge branch 'feature/ons/qr_code_login_ui' of https://github.com/vec…
hughns 90fa5d5
Revert "Only do completeOnNewDevice if we received a confirmation code"
hughns e305478
Revert "Partial implementation of QR login logic"
hughns 489dfd7
Revert "Implementations of MSC3886 and MSC3903"
hughns 9429a4f
Revert "Retry scanning if not a QR code"
hughns 343cf74
Add flag to allow QR login on all servers + split flag for showing in…
hughns 4c7c861
Fix logic for showing confirm button
hughns 5953346
Merge branch 'develop' into feature/ons/qr_code_login_ui
b04ad49
Add changelog.
e83bdc3
Use correct homeserver url to check qr code login support.
6c10a9b
Code review fixes.
8547fee
Enable qr code login by default.
91bb86d
Code review fixes.
d3a24fe
Lint fix.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Implement QR Code Login UI |
This file contains 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
11 changes: 11 additions & 0 deletions
11
library/ui-styles/src/main/res/values/stylable_qr_code_instructions_view.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<declare-styleable name="QrCodeLoginInstructionsView"> | ||
<attr name="qrCodeLoginInstruction1" format="string" /> | ||
<attr name="qrCodeLoginInstruction2" format="string" /> | ||
<attr name="qrCodeLoginInstruction3" format="string" /> | ||
<attr name="qrCodeLoginInstruction4" format="string" /> | ||
</declare-styleable> | ||
|
||
</resources> |
11 changes: 11 additions & 0 deletions
11
library/ui-styles/src/main/res/values/stylable_qr_code_login_header_view.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<declare-styleable name="QrCodeLoginHeaderView"> | ||
<attr name="qrCodeLoginHeaderTitle" format="string" /> | ||
<attr name="qrCodeLoginHeaderDescription" format="string" /> | ||
<attr name="qrCodeLoginHeaderImageResource" format="reference" /> | ||
<attr name="qrCodeLoginHeaderImageBackgroundTint" format="color" /> | ||
</declare-styleable> | ||
|
||
</resources> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
34 changes: 34 additions & 0 deletions
34
...d/src/main/java/org/matrix/android/sdk/internal/database/migration/MigrateSessionTo039.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2022 The Matrix.org Foundation C.I.C. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.matrix.android.sdk.internal.database.migration | ||
|
||
import io.realm.DynamicRealm | ||
import org.matrix.android.sdk.internal.database.model.HomeServerCapabilitiesEntityFields | ||
import org.matrix.android.sdk.internal.extensions.forceRefreshOfHomeServerCapabilities | ||
import org.matrix.android.sdk.internal.util.database.RealmMigrator | ||
|
||
internal class MigrateSessionTo039(realm: DynamicRealm) : RealmMigrator(realm, 39) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This migration is not called in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh nice catch. Thank you. |
||
|
||
override fun doMigrate(realm: DynamicRealm) { | ||
realm.schema.get("HomeServerCapabilitiesEntity") | ||
?.addField(HomeServerCapabilitiesEntityFields.CAN_LOGIN_WITH_QR_CODE, Boolean::class.java) | ||
?.transform { obj -> | ||
obj.set(HomeServerCapabilitiesEntityFields.CAN_LOGIN_WITH_QR_CODE, false) | ||
} | ||
?.forceRefreshOfHomeServerCapabilities() | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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 there is a network error the client will consider that the feature is not supported (which is maybe acceptable here).
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 think it is ok to silently hide it on network problems.