Created
December 27, 2015 00:07
-
-
Save Marchuck/17c1306003729225d9a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/drawer_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:elevation="7dp"> | |
<android.support.v7.widget.Toolbar | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize" | |
android:background="?attr/colorPrimary" /> | |
<RelativeLayout | |
android:id="@+id/content" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
</RelativeLayout> | |
<RelativeLayout | |
android:id="@+id/drawer_content" | |
android:layout_width="320dp" | |
android:layout_height="match_parent" | |
android:layout_gravity="left" | |
android:background="@android:color/holo_red_light" | |
android:scrollbars="vertical"> | |
<!-- all in drawer --> | |
<android.support.v7.widget.RecyclerView | |
android:id="@+id/recycler_view" | |
android:layout_width="300sp" | |
android:layout_height="match_parent" | |
android:padding="8sp" /> | |
</RelativeLayout> | |
</android.support.v4.widget.DrawerLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, android.R.string.ok, android.R.string.no) { | |
@Override | |
public void onDrawerOpened(View drawerView) { | |
super.onDrawerOpened(drawerView); | |
// drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN); | |
} | |
@Override | |
public void onDrawerClosed(View drawerView) { | |
super.onDrawerClosed(drawerView); | |
// drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); | |
} | |
}; // drawerLayout Toggle Object Made | |
drawerLayout.setDrawerListener(toggle); // drawerLayout Listener set to the drawerLayout toggle | |
toggle.syncState(); | |
drawerLayout.closeDrawer(Gravity.LEFT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment