Exemple #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.account);

            myAdapter     = new MyAdapter(SupportFragmentManager);
            pager         = FindViewById <ViewPager>(Resource.Id.pager);
            tabStrip      = FindViewById <PagerSlidingTabStrip>(Resource.Id.tabs);
            pager.Adapter = myAdapter;
            tabStrip.SetViewPager(pager);
            tabStrip.ShouldExpand = true;
            tabStrip.SetTabTextColor(Resource.Color.lightGray);
            tabStrip.TabTextColorSelected = GetColorStateList(Resource.Color.white);
            tabStrip.SetFitsSystemWindows(true);

            tabStrip.TabPaddingLeftRight = 240;
            tabStrip.SetBackgroundColor(Android.Graphics.Color.ParseColor("#075E54"));
            // Create your application here
        }
Exemple #2
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Viaje);

            _btnRegresarInicio = FindViewById <Button>(Resource.Id.BtnRegresarInicio);
            _pager             = FindViewById <ViewPager>(Resource.Id.pager);
            _tabs = FindViewById <PagerSlidingTabStrip>(Resource.Id.tabs);

            _tabs.SetBackgroundColor(Colores.DarkPrimary);
            _tabs.SetTabTextColor(Colores.Icons);
            _btnRegresarInicio.Visibility = Android.Views.ViewStates.Gone;
            _btnRegresarInicio.SetBackgroundColor(Colores.LightPrimary);
            _btnRegresarInicio.SetTextColor(Colores.PrimaryText);

            var idViaje = Intent.GetIntExtra("IdViaje", -1);

            if (idViaje == -1)
            {
                AlertMessage.Show(this, "Ha ocurrido un error: No se seleccionó un viaje", ToastLength.Long);
                RegresarInicio();
                return;
            }

            await ObtenerDetalleViajeSeleccionado(idViaje);

            _adapter = new ViajeAdapter(SupportFragmentManager, _viaje);

            _pager.Adapter = _adapter;
            _tabs.SetViewPager(_pager);

            _btnRegresarInicio.Click += (sender, e) =>
            {
                RegresarInicio();
            };
        }