BiometricPrompt with DayNight Theme
Asked Answered
H

1

6

DayNight Theme has four cases:

  1. Device - DARK mode, application - DARK mode
  2. Device - LIGHT mode, application - LIGHT mode
  3. Device - DARK mode, application - LIGHT mode
  4. Device - LIGHT mode, application - DARK mode

First and second cases are normal. Unfortunately at third and fourth cases are not as expected. BiometricPrompt Dialog getting the ui mode of device. I want to apply application UI mode for BiometricPrompt Dialog. You can see issue below:

Device - DARK mode, application - LIGHT mode Device - **DARK** mode, application - **LIGHT** mode

Device - LIGHT mode, application - DARK mode Device - **LIGHT** mode, application - **DARK** mode

Hetaera answered 12/6, 2020 at 14:10 Comment(4)
I would also argue that the text below the icon is hardly readable in dark mode (wtf google)Vollmer
@Hetaera Did you find any solution for this ?Boehmenist
@TippuFisalSheriff There is no any solution.Hetaera
Okay, I raised ticket in Google - Issue Tracker issuetracker.google.com/issues/235142345Boehmenist
D
0

Interesting question!

From your question it is clear that device and application roles are switched throughout all 4 scenarios (but only apparent when there is a difference in colors)

Some resources to check out and that form basis of my answer: https://developer.android.com/guide/topics/ui/look-and-feel/darktheme

https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:biometric/biometric/src/main/java/androidx/biometric/

Some background:

  1. The authentication layout is built with soft-coded colors (theme attributed) which allow for night-theme to function (as shown in your pictures)

  2. The layout is not set up to inherit from night-theme (the activity's job)

  3. The method for displaying authentication dialog uses fragment (not activity) which could factor into why it is not working properly under uiMode). An activity has to be set up in manifest to support uiMode. Not sure how this would work with fragment

  4. uiMode configuration change automatically rebuilds activity

My answer:

Because of the high priority of user authentication, the authentication dialog is being prioritized over the activity as the "device" while the activity behind the dialog is delegated the role of "application". It is unclear why or how this is happening. I would try switching the roles of device and application throughout your implementation of DayNight theme.

Disseisin answered 1/8, 2020 at 14:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.