Posts

How To Make Android Toolbar Elevation Working On Pre-Lollipop Devices

Image
Step 1. Make a material toolbar.  (How To Make Material Design Actionbar/Toolbar In 7 Simple Steps) Step 2. Create a new drawable desource file  " shadow.xml". <?xml version="1.0" encoding="utf-8"?> <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">     <gradient         android:startColor="@android:color/transparent"         android:endColor="#40000000"         android:angle="90"/> </shape> Step 3. Open  " activity_main.xml" and  add these lines between "include" and "RelativeLayout" Tags. <FrameLayout         android:layout_width="fill_parent"         android:layout_height="4dp"         android:background="@drawable/shadow"         android:layout_below="@+id/toolbar"         android:visibility="invisible" /> Now y

How To Make Material Design Actionbar/Toolbar In 7 Simple Steps.

Image
Step 1. Open Android Studio and create a new project and select a blank activity. Step 2. Add Appcombat v7 Support library to your project or not if already. Step 3. Make new resources file "colors.xml", clear  it and add these to it. <?xml version="1.0" encoding="utf-8"?> <resources>     <color name="ColorPrimary">#FF5722</color>     <color name="ColorPrimaryDark">#E64A19</color> </resources> Step 4. Open "style.xml",  clear it and add these to it. <resources>     <item name="colorPrimary">@color/ColorPrimary</item>         <item name="colorPrimaryDark">@color/ColorPrimaryDark</item>     <!-- Base application theme. -->     <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">         <item name="colorPrimary">@color/ColorPrimary</item>