Instantly share code, notes, and snippets.
eduardoguilarducci
/ nav-drawer-add-menu-action-mainactivity.cs
Created
November 26, 2016 23:59
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
... | |
var navigationView = FindViewById<NavigationView>(Resource.Id.nav_view); | |
navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected; | |
} | |
void NavigationView_NavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs e) | |
{ | |
switch (e.MenuItem.ItemId) | |
{ | |
case (Resource.Id.nav_home): | |
Toast.MakeText(this, "selecionando menu Home", ToastLength.Short).Show(); |
eduardoguilarducci
/ nav-drawer-add-toggle-mainactivity.cs
Created
November 26, 2016 23:51
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
var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer); | |
drawerLayout.AddDrawerListener(drawerToggle); | |
drawerToggle.SyncState(); |
eduardoguilarducci
/ nav-drawer-strings.xml
Created
November 26, 2016 23:50
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
<string name="open_drawer">abrir</string> | |
<string name="close_drawer">fechar</string> |
eduardoguilarducci
/ nav-drawer-toolbar-mainactivity.cs
Last active
November 29, 2016 12:20
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
var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); | |
SetSupportActionBar(toolbar); |
eduardoguilarducci
/ nav-drawer-mainactivity.cs
Created
November 26, 2016 23:45
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
public class MainActivity : AppCompatActivity |
eduardoguilarducci
/ nav-drawer-mainactivity.cs
Created
November 26, 2016 23:45
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
public class MainActivity : AppCompatActivity |
eduardoguilarducci
/ nav-drawer-action-styles.xml
Created
November 26, 2016 23:08
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
<item name="windowNoTitle">true</item> | |
<item name="windowActionBar">false</item> |
eduardoguilarducci
/ nav-drawer-main_menu.axml
Created
November 26, 2016 22:47
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | |
<group android:checkableBehavior="single"> | |
<item | |
android:id="@+id/nav_home" | |
android:title="Home" /> | |
<item | |
android:id="@+id/nav_xamarin" | |
android:title="Xamarin" /> | |
<item |
eduardoguilarducci
/ nav-drawer-header.axml
Last active
November 26, 2016 22:43
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="178dp" | |
android:background="?attr/colorPrimary" | |
android:orientation="vertical" | |
android:weightSum="1"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="56dp" |
eduardoguilarducci
/ nav-drawer-main.axml
Created
November 26, 2016 22:36
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:id="@+id/drawer_layout" | |
android:fitsSystemWindows="true"> | |
<RelativeLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> |
NewerOlder