*Permissions wizard

Since 2.2.225 version we don't need access to phone's local storage and implemented more comfortable way to customize our Permissions wizard.

Overview

Wizard is user-friendly activity with step-by-step description of each required permissions and Proceed button to request them. For example, wizard will look like this on Android 10:

To start wizard from your activity or fragment use code below:

startActivityForResult(
       PermissionsWizardActivity
               .getStartWizardIntent(
                       context = this,
                       enableAggressivePermissionsWizard  = false,
                       enableAggressivePermissionsWizardPage  = false
               ),
       PermissionsWizardActivity.WIZARD_PERMISSIONS_CODE
)

Where enableAggressivePermissionsWizard flag you set to true when wizard will be finished if all required permissions granted (user can’t cancel it with back button), and false if wizard can be finished with not all granted permissions or cancelled with back button.

Where enableAggressivePermissionsWizardPage flag you set to true when wizard will slide to next page if requested permissions granted on current page, and false if wizard can slide with not granted permissions.

See table below to see how it works:

enabled Aggressive Permissions Wizard

enabled Aggressive Permissions WizardPage

cancelable wizard

can deny requested pemission and slide to next step

can finish wizard without all granted perms

true

true

no

no

no

true

false

no

yes

no

false

true

yes

no

no

false

false

yes

yes

yes

And after that you can get the result in onActvityResult method by this way:

Customizing

The permission wizard can be different. But generally there could be 8 screens:

Location permission screen

Location restrictions on Android were chaged twice in 10 and 11 versions.

If you want to customize description of this screen you should override resources:

values/strings.xml

values-v29/strings.xml

values-v30/strings.xml

Background location permission screen

Since Android 11 Google introduced new privacy feature releated to location permission granting. Now if application needs access to users location in the background it should first grant access to foreground location and only after that it can ask permission to access locaition in the background.

values/strings.xml

Activity recognition permission screen (since Android 10)

values/strings.xml

values-v29/strings.xml

Device location permission screen (when location services are switched off on the device)

values/strings.xml

Battery optimization permission screen

values/strings.xml

Custom power management tools disabling screen (custom feature for smartphones manufacturers like Samsung, Xiaomi, Huawei etc.)

values/strings.xml

Autostart enabling screen (custom feature for smartphones manufacturers like Xiaomi, Huawei etc.)

values/strings.xml

Notifications showing permissions screen (custom feature for smartphones manufacturers)

values/strings.xml

Additional resources

values/strings.xml

Common text customizations

All resources which are used are supporting Html-markup styling. But also you can set custom font and font the text (or to the part of the text) via annotations

Customizing font:

  1. Specify your font in resources (check documentation)

  2. Specify annotation for the text with name font

Sample:

Add custom support library font

digital_font.xml

Add the <annotation> tag, and define the key-value pair. In this case, the key is font, and the value is the font-resource name

Customizing size of the text

  1. Add dimen resource of the

  2. Specify annotation for the text with name textSize

Sample

Dimen-resource:

Add the <annotation> tag, and define the key-value pair. In this case, the key is textSize, and the value is the dimen-resource name

Customizing image-resources

If you dont want to use our bottom dialog view you can replace it with your own drawable-resource:

Specify drawable resource with the name:

Customizing colors

values\colors.xml

Customizing dimens

values\dimens.xml values-xhdpi\dimens.xml values-xxhdpi\dimens.xml

Last updated

Was this helpful?