Flat action bar with Theme.Material

2.6k views Asked by At

can someone help me with Material theming?

I want actionbar be flat. Here is code I try to use.

<style name="Theme.Kpi_Schedule.full" parent="android:Theme.Material.Light.DarkActionBar">
   <item name="android:windowContentOverlay">@null</item>
   <item name="android:colorPrimaryDark">#1E88E5</item>
   <item name="android:popupBackground">#fff</item>
   <item name="android:windowTranslucentNavigation">true</item>
   <item name="android:navigationBarColor">@android:color/transparent</item>
   <item name="android:actionBarStyle">@style/ActionBar.Solid.Kpi_Schedule.full</item>
</style>

<style name="ActionBar.Solid.Kpi_Schedule.full" parent="android:Widget.Material.ActionBar.Solid">
   <item name="android:windowActionBarOverlay">true</item>
   <item name="android:background">#03A9F4</item>
   <item name="android:displayOptions">homeAsUp</item>
</style>

Problem here

2

There are 2 answers

0
Anton A. On BEST ANSWER

I found an answer:

I had to add

<item name="android:elevation">0dp</item>

to my theme file.

2
Hirak Chhatbar On

Its not an action bar. Its a "Toolbar" Refer this link for more info http://android-developers.blogspot.in/2014/10/appcompat-v21-material-design-for-pre.html

If u want to stay with actionbar use this library. U can have that material design like animation and look : https://github.com/markushi/android-ui