Instantly share code, notes, and snippets.
eduardoguilarducci
/ nav-drawer-mainactivity.cs
Created
November 26, 2016 23:45
This file contains hidden or 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 hidden or 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-toolbar-mainactivity.cs
Last active
November 29, 2016 12:20
This file contains hidden or 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-strings.xml
Created
November 26, 2016 23:50
This file contains hidden or 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-add-toggle-mainactivity.cs
Created
November 26, 2016 23:51
This file contains hidden or 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-add-menu-action-mainactivity.cs
Created
November 26, 2016 23:59
This file contains hidden or 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(); |
OlderNewer