This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[local_auth] Add Android theme compatibility documentation #6875
Merged
stuartmorgan-g
merged 13 commits into
flutter-team-archive:main
from
Abel1027:doc/theme_app_compat
Feb 21, 2023
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
eb0e98b
[DOC][Android] - Add Android theme compatibility documentation
Abel1027 a39808b
[VERSION] - Upgrade version to 2.1.4
Abel1027 144d4b1
[local_auth] Suggest set up Android LaunchTheme theme in styles.xml
Abel1027 043b928
[DOC][local_auth] Update Android compatibility suggestion
Abel1027 1b1ab97
[DOC][local_auth] Update android theme suggestion with DayNight option
Abel1027 f444f14
[local_auth] Merge origin changes
Abel1027 890e7c7
[DOC][local_auth] Remove typo
Abel1027 51bfbca
Merge origin changes
Abel1027 0d70eb5
[local_auth] Add Android theme description to changelog
Abel1027 d507452
[local_auth] Solve conflicts on next version changelog
Abel1027 7964add
[local_auth] Set last version (2.1.3)
Abel1027 3feee16
[local_auth] Upgrade version to 2.1.4
Abel1027 443aa37
[DOC][local_auth] Amend android theme compatibility suggestion
Abel1027 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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,6 +252,44 @@ types (such as face scanning) and you want to support SDKs lower than Q, | |
| _do not_ call `getAvailableBiometrics`. Simply call `authenticate` with `biometricOnly: true`. | ||
| This will return an error if there was no hardware available. | ||
|
|
||
| #### Android theme | ||
|
|
||
| You need to update the `LaunchTheme` parent style with a valid `Theme.AppCompat` | ||
|
Contributor
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 shouldn't be phrased to assume it's not already set this way, as it could be. How about: "Your
Contributor
Author
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. Ok, it looks great to me |
||
| theme to be compatible with **Android version 8 and below**, otherwise the app | ||
| crashes for those versions. For example, use `Theme.AppCompat.DayNight` to | ||
| enable light/dark modes for the biometric dialog. To do that go to | ||
| `android/app/src/main/res/values/styles.xml` and look for the style with name | ||
| `LaunchTheme` (Notice that `LaunchTheme` must be referenced in the | ||
| `AndroidManifest.xml` file to apply the changes made in `styles.xml`). | ||
| Then change the parent for that style as follows: | ||
|
|
||
| ```xml | ||
| ... | ||
| <resources> | ||
| <style name="LaunchTheme" parent="Theme.AppCompat.DayNight"> | ||
| ... | ||
| </style> | ||
| ... | ||
| </resources> | ||
| ... | ||
| ``` | ||
|
|
||
| If you don't have a `styles.xml` file for your Android project you can set up the Android theme directly in `android/app/src/main/AndroidManifest.xml`: | ||
|
|
||
| ```xml | ||
| ... | ||
| <application | ||
| ... | ||
| <activity | ||
| ... | ||
| android:theme="@style/Theme.AppCompat.DayNight" | ||
| ... | ||
| > | ||
| </activity> | ||
| </application> | ||
| ... | ||
| ``` | ||
|
|
||
|
camsim99 marked this conversation as resolved.
|
||
| ## Sticky Auth | ||
|
|
||
| You can set the `stickyAuth` option on the plugin to true so that plugin does not | ||
|
|
||
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.
This needs a version change.