示例#1
0
        private void ListItemClicked(int position)
        {
            if (lastSelectedSection == position)
            {
                return;
            }

            lastSelectedSection = position;

            Fragment fragment = null;

            switch (position)
            {
            case 0:
                fragment = Fragment1.NewInstance();
                break;

            case 1:
                fragment = Fragment2.NewInstance();
                break;
            }


            FragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();

            drawerListView.SetItemChecked(position, true);
            ActionBar.Title = currentSectionTitle = sections[position];
            drawerLayout.CloseDrawer(drawerListView);
        }
示例#2
0
        void LoadFragment(int id)
        {
            Android.Support.V4.App.Fragment fragment = null;
            switch (id)
            {
            case Resource.Id.menu_home:
                fragment = Fragment1.NewInstance();
                break;

            case Resource.Id.menu_audio:
                fragment = Fragment2.NewInstance();
                break;

            case Resource.Id.menu_video:
                fragment = Fragment3.NewInstance();
                break;

            case Resource.Id.menu_video2:
                fragment = Fragment4.NewInstance();
                break;
            }
            if (fragment == null)
            {
                return;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
        }
示例#3
0
        private void ListItemClicked(int position)
        {
            //this way we don't load twice, but you might want to modify this a bit.
            if (position == oldPosition)
            {
                return;
            }

            oldPosition = position;

            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = Fragment1.NewInstance();
                break;

            case 1:
                fragment = Fragment2.NewInstance();
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
        }
示例#4
0
        void LoadFragment(int id)
        {
            Android.Support.V4.App.Fragment fragment = null;
            var serializedStuff  = JsonConvert.SerializeObject(Friendslist);
            var serializedStuff2 = JsonConvert.SerializeObject(list);
            var bundle           = new Bundle();

            bundle.PutString("friend", serializedStuff);
            bundle.PutString("list", serializedStuff2);
            switch (id)
            {
            case Resource.Id.menu_home:
                fragment = Fragment1.NewInstance(bundle);
                break;

            case Resource.Id.menu_audio:
                fragment = Fragment2.NewInstance();
                break;

            case Resource.Id.menu_video:
                fragment = Fragment3.NewInstance(bundle);
                break;
            }
            if (fragment == null)
            {
                return;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment).CommitNowAllowingStateLoss();
        }
示例#5
0
        private void ListItemClicked(int position)
        {
            //this way we don't load twice, but you might want to modify this a bit.
            if (position == oldPosition)
            {
                return;
            }

            oldPosition = position;

            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = Fragment1.NewInstance();
                break;

            case 1:
                fragment = Fragment2.NewInstance();
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();

            this.drawerListView.SetItemChecked(position, true);
            SupportActionBar.Title = this.title = adapter.GetTitle(position);
            this.drawerLayout.CloseDrawers();
        }
示例#6
0
        void LoadFragment(int id)
        {
            Android.Support.V4.App.Fragment fragment = null;
            switch (id)
            {
            case Resource.Id.Gezondheid:
                fragment = Fragment1.NewInstance();
                break;

            case Resource.Id.Style:
                fragment = Fragment2.NewInstance();
                break;

            case Resource.Id.Minigames:
                fragment = Fragment3.NewInstance();
                break;
            }
            if (fragment == null)
            {
                return;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
        }
示例#7
0
        void LoadFragment(int id)
        {
            Android.Support.V4.App.Fragment fragment = null;
            System.String fragmentTag = "";

            switch (id)
            {
            case Resource.Id.menu_home:
                fragment    = Fragment1.NewInstance();
                fragmentTag = "FRAGMENT1";
                break;

            case Resource.Id.menu_audio:
                fragment    = Fragment2.NewInstance();
                fragmentTag = "FRAGMENT2";
                break;

            case Resource.Id.menu_video:
                fragment    = Fragment3.NewInstance();
                fragmentTag = "FRAGMENT3";
                break;
            }
            if (fragment == null)
            {
                return;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment, fragmentTag)
            .Commit();
        }
示例#8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Forms.Init(this, savedInstanceState);
            Instance = this;

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            ViewPager _viewPager = FindViewById <ViewPager>(Resource.Id.viewPager);

            //_viewPager.PageSelected += ViewPager_PageSelected;

            _fragments = new Android.Support.V4.App.Fragment[] {
                Fragment0.NewInstance("Genres", "tab_genres"),
                Fragment1.NewInstance("Genres", "tab_genres"),
                //TheFragment.NewInstance("Titles", "tab_titles"),
                //TheFragment.NewInstance("Stream", "tab_stream"),
                //TheFragment.NewInstance("Showtimes", "tab_showtimes")
            };

            _viewPager.Adapter = new ViewPagerAdapter(SupportFragmentManager, _fragments);
        }
示例#9
0
            public override Android.Support.V4.App.Fragment GetItem(int position)
            {
                switch (position)
                {
                case 0:
                    return(Fragment1.NewInstance());

                case 1:
                    return(Fragment2.NewInstance());
                }
                return(null);
            }
示例#10
0
        private void ListItemClicked(int position)
        {
            //this way we don't load twice, but you might want to modify this a bit.
            if (position == oldPosition)
            {
                return;
            }

            oldPosition = position;

            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = Fragment1.NewInstance();
                break;

            case 1:
                //fragment = Fragment2.NewInstance();
                fragment = new LearningHomeFragment();
                break;

            case 2:
                //fragment = Fragment2.NewInstance();
                fragment = new EvaluationHomeFragment();
                break;

            case 3:
                //fragment = Fragment2.NewInstance();
                fragment = new ExpertsHomeFragment();
                break;

            case 4:
                //fragment = Fragment2.NewInstance();
                fragment = new CounsellingHomeFragment();
                break;

            case 5:
                //fragment = Fragment2.NewInstance();
                fragment = new MyAccountHomeFragment();
                break;

            case 6:
                fragment = new LoginFragment();
                //StartActivity(typeof(LoginActivity));
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment).AddToBackStack(null)
            .Commit();
        }
示例#11
0
        private void ListItemClicked(int position)
        {
            //this way we don't load twice, but you might want to modify this a bit.
            if (position == oldPosition)
            {
                return;
            }

            oldPosition = position;

            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = Fragment1.NewInstance();
                break;

            case 1:
                fragment = Fragment2.NewInstance();
                break;

            case 2:
                fragment = BookingStatusListFragment.NewInstance();
                break;

            case 7:
                Auth.GoogleSignInApi.SignOut(googleApiClient).SetResultCallback(new SignOutResultCallback {
                    Activity = this
                });
                LoginActivity.mgoogleApiClient.Disconnect();



                StartActivity(typeof(LoginActivity));
                Finish();
                break;
            }
            if (position != 7 && fragment != null)
            {
                SupportFragmentManager.BeginTransaction()
                .Replace(Resource.Id.content_frame, fragment)
                .Commit();
            }
        }
示例#12
0
        void LoadFragment(int id)
        {
            Fragment fragment = null;

            switch (id)
            {
            case Resource.Id.action_add:
                fragment = Fragment1.NewInstance();
                break;

            case Resource.Id.action_edit:
                fragment = Fragment2.NewInstance();
                break;

            case Resource.Id.action_remove:
                fragment = Fragment3.NewInstance();
                break;

            case Resource.Id.action_select:
                fragment = Fragment4.NewInstance();
                break;

            case Resource.Id.action_batata:
                fragment = Fragment5.NewInstance();
                break;
            }
            if (fragment == null)
            {
                return;
            }
            else
            {
                FragmentManager.BeginTransaction()
                .Replace(Resource.Id.content_frame, fragment)
                .AddToBackStack(fragment.Tag)
                .Commit();
            }
        }
示例#13
0
        private void ListItemClicked(int position)
        {
            //this way we don't load twice, but you might want to modify this a bit.
            if (position == oldPosition)
            {
                return;
            }

            oldPosition = position;

            Android.Support.V4.App.Fragment fragment = null;

            switch (position)
            {
            case 0:
                //Se resetea el fragmento del mapa
                resetearMapa();
                fragment = FragmentLogin.NewInstance();
                //SupportFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit();
                break;

            case 1:
                //Se resetea el fragmento del mapa
                resetearMapa();
                fragment = Fragment1.NewInstance();
                //SupportFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit();
                break;

            case 2:
                //Se resetea el fragmento del mapa
                resetearMapa();
                fragment = FragmentMap.NewInstance();
                //SupportFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit();
                break;

            case 3:
                //Se resetea el fragmento del mapa
                resetearMapa();
                fragment = Impresion.NewInstance(codigoNotificacion, notificado);
                //SupportFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit();
                break;

            case 4:
                //Se resetea el fragmento del mapa
                resetearMapa();
                fragment = RolNocturno.NewInstance();
                // SupportFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit();
                break;

            case 5:
                //Es el de prueba
                fragment = Fragment2.NewInstance("12345");
                break;

            default:
                Console.WriteLine("Elemento seleccionado " + position.ToString());
                break;
            }

            SupportFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit();
        }