Sunday, March 4, 2018

Android - Style drawer toggle


values/style.xml

<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <!-- The drawing color for the bars -->
    <item name="color">@android:color/white</item>
    <!-- Whether bars should rotate or not during transition -->
    <item name="spinBars">true</item>
    <!-- The total size of the drawable -->
    <item name="drawableSize">12sp</item>
    <!-- The max gap between the bars when they are parallel to each other -->
    <item name="gapBetweenBars">4sp</item>
    <!-- The thickness (stroke size) for the bar paint -->
    <item name="thickness">2sp</item>
</style>

<style name="CustomTheme" parent="Theme.AppCompat.NoActionBar">
    <!-- Add following -->
    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>

AndroidManifest.xml

<application
    android:theme="@style/CustomTheme">
</application>

No comments: