本文整理汇总了C#中DrawerLayout.AddDrawerListener方法的典型用法代码示例。如果您正苦于以下问题:C# DrawerLayout.AddDrawerListener方法的具体用法?C# DrawerLayout.AddDrawerListener怎么用?C# DrawerLayout.AddDrawerListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawerLayout
的用法示例。
在下文中一共展示了DrawerLayout.AddDrawerListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
setup();
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
drawerList = FindViewById<RecyclerView>(Resource.Id.left_drawer);
drawerLayout.SetDrawerShadow(Resource.Drawable.drawer_shadow, GravityCompat.Start);
drawerList.SetLayoutManager(new LinearLayoutManager(this));
adapter = new MenuAdapter();
drawerList.SetAdapter(adapter);
// enable ActionBar app icon to behave as action to toggle nav drawer
this.ActionBar.SetDisplayHomeAsUpEnabled(true);
this.ActionBar.SetHomeButtonEnabled(true);
this.ActionBar.Title = "Test";
drawerToggle = new MainDrawerToggle(this, drawerLayout,
Resource.Drawable.ic_drawer,
Resource.String.drawer_open,
Resource.String.drawer_close);
drawerLayout.AddDrawerListener(drawerToggle);
drawerLayout.CloseDrawer(drawerList);
vm.NavigatedTo(null);
}
示例2: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
drawerLayout = FindViewById<DrawerLayout>(Resource.Id.myDrawer);
notebooks = FindViewById<ListView>(Resource.Id.notebooks);
leftSideMenu = FindViewById<LinearLayout>(Resource.Id.leftSideMenu);
addNoteButton = FindViewById<Button>(Resource.Id.addButton);
notes = FindViewById<ListView>(Resource.Id.notes);
menuButton = FindViewById<Button>(Resource.Id.menuButton);
syncButton = FindViewById<Button>(Resource.Id.syncButton);
addNotebookButton = FindViewById<Button>(Resource.Id.addNotebookButton);
drawerToggle = new SideMenuDrawerToggle(this, drawerLayout, Resource.String.open_drawer, Resource.String.close_drawer);//Resource.Drawable.Icon, -- removed
drawerLayout.AddDrawerListener(drawerToggle);
drawerLayout.CloseDrawer(leftSideMenu);
notebooksAdapter = new NotebooksAdapter(this);
notebooks.Adapter = notebooksAdapter;
chosenNotebookId = Guid.Parse(notebooksAdapter.GetItemAtPosition(0).Id);
notesAdapter = new NotesAdapter(this, chosenNotebookId);
notes.Adapter = notesAdapter;
addNoteButton.Click += AddNoteButton_Click;
menuButton.Click += MenuButton_Click;
syncButton.Click += SyncButton_Click;
addNotebookButton.Click += AddNotebookButton_Click;
notebooks.ItemClick += Notebooks_ItemClick; ;
notes.ItemClick += Notes_ItemClick;
}