What is the difference between windowActionBar and android: windowActionBar

when i set the style in this:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> 

the action bar disappears.

however, when I install it in this:

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> </style> 

the action bar is still here.

who cares?

+5
source share
2 answers

windowActionBar is an attribute provided in the AppCompat library where android:windowActionBar provided in the material theme.

The action panel leaves when you install the code below, only because you use the AppCompat library and refer to the attribute provided in this library itself:

 <item name="windowActionBar">false</item> 

At other points, it is similar to the colorPrimary and android:colorPrimary and all other similar attributes.

For instance:

We used a material theme and referenced the android:colorPrimary , as shown below:

 <style name="AppTheme" parent="android:Theme.Material.Light"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> .... .... </style> 

but now we use the AppCompat library with the colorPrimary attribute to ensure compatibility with lower versions.

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> ... ... </style> 
+11
source

android:windowActionBar denotes a property only for candy and above. Where as windowActionBar stands for all versions and is retrieved from the support library.

+8
source

Source: https://habr.com/ru/post/1246230/


All Articles