Esempio n. 1
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     SetContentView(Resource.Layout.Main);
     adapter       = new MyAdapter(SupportFragmentManager);
     pager         = FindViewById <ViewPager>(Resource.Id.pager);
     tabs          = FindViewById <PagerSlidingTabStrip>(Resource.Id.tabs);
     pager.Adapter = adapter;
     tabs.SetViewPager(pager);
     tabs.SetBackgroundColor(Android.Graphics.Color.Argb(255, 47, 59, 162));
 }
Esempio n. 2
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.pagerSlidingTabStripUi);
     // Create your application here
     _myAdapter     = new MyAdapter(SupportFragmentManager);
     _pager         = FindViewById <ViewPager>(Resource.Id.pager);
     _tabs          = FindViewById <PagerSlidingTabStrip>(Resource.Id.tabs);
     _pager.Adapter = _myAdapter;
     _tabs.SetViewPager(_pager);
     _tabs.SetBackgroundColor(Android.Graphics.Color.Argb(255, 0, 149, 164));
 }
Esempio n. 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            pager = FindViewById <Android.Support.V4.View.ViewPager>(Resource.Id.pager);
            tabs  = FindViewById <PagerSlidingTabStrip>(Resource.Id.tabs);

            adapter       = new MyAdapter(SupportFragmentManager);
            pager.Adapter = adapter;
            tabs.SetViewPager(pager);
            tabs.SetBackgroundColor(Android.Graphics.Color.Argb(255, 0, 149, 164));
        }
Esempio n. 4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            db = new DataBase();

            adapter = new MyAdapter(SupportFragmentManager);
            pager   = FindViewById <ViewPager>(Resource.Id.pager);
            PagerSlidingTabStrip tabs = (PagerSlidingTabStrip)FindViewById(Resource.Id.tabs);

            pager.Adapter = adapter;

            tabs.SetViewPager(pager);
            tabs.SetBackgroundColor(Android.Graphics.Color.Rgb(75, 121, 187));
        }
Esempio n. 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            viewPager = FindViewById <ViewPager>(Resource.Id.pager);
            tabStrip  = FindViewById <PagerSlidingTabStrip>(Resource.Id.tabs);

            adapter = new MyAdapter(SupportFragmentManager);


            viewPager.Adapter = adapter;
            //tabStrip.SetViewPager(viewPager);
            tabStrip.SetBackgroundColor(Android.Graphics.Color.Black);

            LottieAnimationView downloadAnimation = (LottieAnimationView)FindViewById(Resource.Id.animation_view);

            downloadAnimation.SetAnimation("download_icon.json");
            downloadAnimation.Click += delegate {
                downloadAnimation.PlayAnimation();

                #region comentarios
                //Timer t = new Timer();
                //t.Interval = 6000;
                //t.Enabled = true;

                //t.Elapsed += delegate {

                //    RunOnUiThread(() =>
                //    {
                //        if (!contador)
                //            downloadAnimation.PlayAnimation();
                //        else
                //            downloadAnimation.SetBackgroundResource(Resource.Drawable.descarga);
                //        contador = true;
                //    });

                //};

                //t.Start();

                //int milliseconds = 6000;
                //System.Threading.Thread.Sleep(milliseconds);
                #endregion ;
            };
            //downloadAnimation.Loop = true;
        }
Esempio n. 6
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
        }
Esempio n. 7
0
        private void ChangeColor(Color newColor)
        {
            tabs.SetBackgroundColor(newColor);

            // change ActionBar color just if an ActionBar is available
            Drawable      colorDrawable  = new ColorDrawable(newColor);
            Drawable      bottomDrawable = new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent));
            LayerDrawable ld             = new LayerDrawable(new Drawable[] { colorDrawable, bottomDrawable });

            if (oldBackground == null)
            {
                SupportActionBar.SetBackgroundDrawable(ld);
            }
            else
            {
                TransitionDrawable td = new TransitionDrawable(new Drawable[] { oldBackground, ld });
                SupportActionBar.SetBackgroundDrawable(td);
                td.StartTransition(200);
            }

            oldBackground = ld;
            currentColor  = newColor;
        }
Esempio n. 8
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();
            };
        }