Exemplo n.º 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.pendientes:
                fragment = new FragmentPending();
                break;

            case Resource.Id.prestamos:
                fragment = new FragmentRental();
                break;

            case Resource.Id.devoluciones:
                fragment = new FragmentRentalReturn();
                break;

            case Resource.Id.estadisticas:
                fragment = new FragmentEstadisticas();
                break;
            }

            if (fragment == null)
            {
                return;
            }


            CargarFragment(fragment);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.operationsadmin);

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

            bottomNavigation = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation1);
            //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 FragmentPending();

            CargarFragment(fragment);
        }