It is self Q&A post I have transparent ActionBar which overlays layout. After migration to the latest support library I have been forced to get rid off the ActionBar in favor of the Toolbar. The old ways to make it transparent and overlay that layout doesn't work anymore.
<style name="CustomActionBarTheme" parent="@android:style/Theme.AppCompat"> <item name="android:windowActionBarOverlay">true</item> <item name="windowActionBarOverlay">true</item> <item name="android:actionBarStyle">@style/TransparentActionBar</item> </style> <style name="TransparentActionBar" parent="@android:style/Widget.Holo.Light.ActionBar"> <item name="android:background">@android:color/transparent</item> </style>
Switch to the “Windows 10 Settings” tab using the header menu of the application. Make sure to enable the “Customize Taskbar” option, then choose “Transparent.” Adjust the “Taskbar Opacity” value until you're satisfied with the results. Click on the OK button to finalize your changes.
Create your toolbar.xml file with background of AppBarLayout is @null
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.AppBarLayout android:id="@+id/general_appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@null" xmlns:android="http://schemas.android.com/apk/res/android"> <android.support.v7.widget.Toolbar android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="Login" android:textSize="20sp"/> </android.support.v7.widget.Toolbar> </android.support.design.widget.AppBarLayout>
and here is result:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With