3

While implementing the new Android M permission model I noticed that the permissions dialog does not respect the theming of my styles.xml.

In my styles.xml I override the dialog and alertdialog style like this:

<item name="android:dialogTheme">@style/Theme.dialog</item>
<item name="android:alertDialogTheme">@style/Theme.dialog</item>

Is it possible to change the theming?

Or is it because this is a system dialog like in the device settings?

Floern
  • 33,559
  • 24
  • 104
  • 119
Thomas R.
  • 7,988
  • 3
  • 30
  • 39

1 Answers1

12

No, it's not possible. The permissions dialog is system dialog, hence you can't change its theme:

The M Developer Preview introduces a new app permissions model which streamlines the process for users to install and upgrade apps. If an app running on the M Preview supports the new permissions model, the user does not have to grant any permissions when they install or upgrade the app. Instead, the app requests permissions as it needs them, and the system shows a dialog to the user asking for the permission.

aga
  • 27,954
  • 13
  • 86
  • 121
  • Ok, that was my first assumption because it is triggered from the system. But I hoped that with M there is something to style the permission dialog. In the end this dialog should not often be presented to the user. – Thomas R. Aug 19 '15 at 14:01
  • My guess is they don't want you to be able to mess with it so as to avoid obfuscating it via styles (ie, black text on black background, etc.) – fattire Aug 24 '15 at 09:15
  • Can you change just the message to be more explainable? – SpyZip Oct 14 '15 at 12:53
  • 2
    @SpyZip nope, there is only one requestPermissions() method and it doesn't accept any arguments pointing to permissions dialog message/title/etc. You can show "permission rationale dialog" (https://developers.google.com/android/guides/permissions#show_the_permission_rationale) before "request permissions dialog" and add any message you like to it. – aga Oct 14 '15 at 13:24