Esempio n. 1
0
        private void SetUpMenu()
        {
            // attach to current activity;
            resideMenu = new ResideMenu(this);

            resideMenu.SetBackground(Resource.Drawable.menu_background);
            resideMenu.AttachToActivity(this);
            resideMenu.SetScaleValue(0.6f);

            // create menu items;
            itemHome     = new ResideMenuItem(this, Resource.Drawable.icon_home,     "Home");
            itemProfile  = new ResideMenuItem(this, Resource.Drawable.icon_profile,  "Profile");
            itemCalendar = new ResideMenuItem(this, Resource.Drawable.icon_calendar, "Calendar");
            itemSettings = new ResideMenuItem(this, Resource.Drawable.icon_settings, "Settings");

            resideMenu.AddMenuItem(itemHome, ResideMenu.DirectionLeft);
            resideMenu.AddMenuItem(itemProfile, ResideMenu.DirectionRight);
            resideMenu.AddMenuItem(itemCalendar, ResideMenu.DirectionRight);
            resideMenu.AddMenuItem(itemSettings, ResideMenu.DirectionRight);

            // You can disable a direction by setting ->
            resideMenu.SetSwipeDirectionDisable(ResideMenu.DirectionRight);

            FindViewById<Button> (Resource.Id.title_bar_left_menu).Click += (object sender, EventArgs e) => resideMenu.OpenMenu (ResideMenu.DirectionLeft);
            FindViewById<Button> (Resource.Id.title_bar_right_menu).Click += (object sender, EventArgs e) => resideMenu.OpenMenu (ResideMenu.DirectionRight);
        }
Esempio n. 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            parentView = inflater.Inflate (Resource.Layout.home, container, false);

            var parentActivity = (MainActivity)this.Activity;

            resideMenu = parentActivity.GetResideMenu ();

            parentView.FindViewById<Button>(Resource.Id.btn_open_menu).Click += (object sender, EventArgs e) => resideMenu.OpenMenu(ResideMenu.DirectionLeft) ;

            FrameLayout ignoredView = parentView.FindViewById<FrameLayout> (Resource.Id.ignored_view);
            resideMenu.AddIgnoredView (ignoredView);

            return parentView;
        }
Esempio n. 3
0
        private void SetUpMenu()
        {
            // attach to current activity;
            resideMenu = new ResideMenu(this);

            resideMenu.SetBackground(Resource.Drawable.menu_background);
            resideMenu.AttachToActivity(this);
            resideMenu.SetScaleValue(0.6f);

            // create menu items;
            itemHome     = new ResideMenuItem(this, Resource.Drawable.icon_home, "Home");
            itemProfile  = new ResideMenuItem(this, Resource.Drawable.icon_profile, "Profile");
            itemCalendar = new ResideMenuItem(this, Resource.Drawable.icon_calendar, "Calendar");
            itemSettings = new ResideMenuItem(this, Resource.Drawable.icon_settings, "Settings");

            resideMenu.AddMenuItem(itemHome, ResideMenu.DirectionLeft);
            resideMenu.AddMenuItem(itemProfile, ResideMenu.DirectionRight);
            resideMenu.AddMenuItem(itemCalendar, ResideMenu.DirectionRight);
            resideMenu.AddMenuItem(itemSettings, ResideMenu.DirectionRight);

            // You can disable a direction by setting ->
            resideMenu.SetSwipeDirectionDisable(ResideMenu.DirectionRight);

            FindViewById <Button> (Resource.Id.title_bar_left_menu).Click  += (object sender, EventArgs e) => resideMenu.OpenMenu(ResideMenu.DirectionLeft);
            FindViewById <Button> (Resource.Id.title_bar_right_menu).Click += (object sender, EventArgs e) => resideMenu.OpenMenu(ResideMenu.DirectionRight);
        }
Esempio n. 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            parentView = inflater.Inflate(Resource.Layout.home, container, false);

            var parentActivity = (MainActivity)this.Activity;

            resideMenu = parentActivity.GetResideMenu();

            parentView.FindViewById <Button>(Resource.Id.btn_open_menu).Click += (object sender, EventArgs e) => resideMenu.OpenMenu(ResideMenu.DirectionLeft);

            FrameLayout ignoredView = parentView.FindViewById <FrameLayout> (Resource.Id.ignored_view);

            resideMenu.AddIgnoredView(ignoredView);

            return(parentView);
        }