protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); FloatingActionButton fab = FindViewById<FloatingActionButton>(Resource.Id.fab); View sheetView = FindViewById(Resource.Id.fab_sheet); View overlay = FindViewById(Resource.Id.overlay); int sheetColor = Resources.GetColor(Resource.Color.background_card); int fabColor = Resources.GetColor(Resource.Color.theme_accent); // Initialize material sheet FAB var materialSheetFab = new MaterialSheetFab(fab, sheetView, overlay, sheetColor, fabColor); }
private void SetupFab() { Fab fab = (Fab)FindViewById(Resource.Id.fab); View sheetView = FindViewById(Resource.Id.fab_sheet); View overlay = FindViewById(Resource.Id.overlay); int sheetColor = Resources.GetColor(Resource.Color.background_card); int fabColor = Resources.GetColor(Resource.Color.theme_accent); // Create material sheet FAB materialSheetFab = new MaterialSheetFab(fab, sheetView, overlay, sheetColor, fabColor); // Set material sheet event listener materialSheetFab.SetEventListener(new FabListener(this)); // Set material sheet item click listeners FindViewById(Resource.Id.fab_sheet_item_recording).SetOnClickListener(this); FindViewById(Resource.Id.fab_sheet_item_reminder).SetOnClickListener(this); FindViewById(Resource.Id.fab_sheet_item_photo).SetOnClickListener(this); FindViewById(Resource.Id.fab_sheet_item_note).SetOnClickListener(this); }