XML : Confusion about AlertDialog and DialogPreference themes

So basically I have 2 styles.xml files in my project: one for v21+ and the other one for all the rest. While testing appliance of styles on alert dialog and preference dialog(mainly colorAccent change) on a real lollipop device I've noticed that alert dialog is shown with changed style if I declare alertDialogTheme attribute in v21 styles.xml like that:

  <item name="alertDialogTheme">    

How ever, in this case dialog preference style isn't changed on a lollipop device.

And here's what I'm confused about; I found out that dialog preference style on lollipop device will be changed if I declare alertDialogTheme attribute in the another styles.xml(for older versions!) like that:

  <item name="android:alertDialogTheme">     

In both styles.xml alert dialog theme code is absolutely the same with colorAccent declared in it like that:

  <item name="colorAccent">    

So could somebody tell me why things are so messed up here and when exactly should I use android: namespace attribute?

No comments:

Post a Comment