Skip to content

Instantly share code, notes, and snippets.

@root-ansh
Created July 1, 2018 22:16
Show Gist options
  • Save root-ansh/a609d4ca4c541839f27171a958439bc3 to your computer and use it in GitHub Desktop.
Save root-ansh/a609d4ca4c541839f27171a958439bc3 to your computer and use it in GitHub Desktop.
Custom drawer 1.5
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
...
>
<com.google.android.material.appbar.AppBarLayout
...
>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" <-- Adding wrap content to our height and making -->
android:minHeight="90dp" <-- the min height set to a static value increases our app bar's height making it a beautiful status bar's background without being overlapping the icons -->
android:paddingTop="20dp" <-- However the toolbar icons and title seems to be at the centre of this expanded toolbar,therefor a simple padding top did the trick -->
... />
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment