Example #1
0
        /// <summary>
        /// Metodo cuando se seleciona una pestaƱa del bottomNavigationView
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BottomNavigation_NavigationItemSelected(object sender, BottomNavigationView.NavigationItemSelectedEventArgs e)
        {
            Fragment fragment = null;

            switch (e.Item.ItemId)
            {
            case Resource.Id.libros:
                fragment = new FragmentBookList();
                break;

            case Resource.Id.categorias:
                fragment = new FragmentCategoryList();
                break;

            case Resource.Id.nuevos:
                fragment = new FragmentNewBook();
                break;

            case Resource.Id.pendientes:
                fragment = new FragmentPendingCustomer();
                break;
            }

            if (fragment == null)
            {
                return;
            }


            CargarFragment(fragment);
        }
Example #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.operationscustomer);

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            SetActionBar(toolbar);

            bottomNavigation = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation);

            //Activando los iconos y textos al mismo tiempo
            SetShiftMode(bottomNavigation, false, false);

            bottomNavigation.NavigationItemSelected += BottomNavigation_NavigationItemSelected;

            shared = PreferenceManager.GetDefaultSharedPreferences(this);
            editor = shared.Edit();

            Fragment fragment = new FragmentBookList();

            CargarFragment(fragment);
        }