mjwheatley / cordova-plugin-android-fingerprint-auth

A cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
Apache License 2.0
169 stars 131 forks source link

Feature Request: Custom Fingerprint Dialog #119

Closed dev-akash01 closed 6 years ago

dev-akash01 commented 6 years ago

Feature to replace the fingerprint native dialog with a custom dialog. If not, then at least option to hide the native dialog and show a custom dialog while activating the fingerprint scanner for authentication.

Use-Case: To match the app styling/theme and guidelines.

mjwheatley commented 6 years ago

I'm afraid I'm going to have to reject this feature request for a couple reasons.

  1. I believe that the dialog should appear as a system function similar to the system dialog that appears when requesting user permissions. It should be consistent across applications that use this plugin except for the features already implemented to change the language or set a custom message.
  2. I'm not sure it is possible to change the dialog styles during runtime. Typically you have to create a style.xml file and add it to your Android project and then compile the app. Since it would be quite custom I don't believe it could be part of the plugin. You should fork the repo and edit the code to use your custom theme. http://blog.supenta.com/2014/07/02/how-to-style-alertdialogs-like-a-pro/
dev-akash01 commented 6 years ago

Thank you for the quick response @mjwheatley. I agree with the points you mentioned. However, the feature asked for was an optional feature to replace or hide the native dialog so that if it cannot be changed at runtime then at least it can be hidden for a custom dialog/screen to be shown. Thank you for the detail description and link.

mjwheatley commented 6 years ago

It would not be possible to hide the dialog and still provide the functionality as the dialogue fragment contains the necessary event listeners.

To replace the dialogue your best bet would be to branch the plugin and style the dialogue as desired.