Esempio n. 1
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            try
            {
                switch (item.ItemId)
                {
                case Resource.Id.menu_myaccount_myebooks:
                    var myebooksfragment = new MyEbooksFragment();
                    var ft       = ChildFragmentManager.BeginTransaction();
                    var fragment = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_myaccountframelayout);
                    if (fragment != null)
                    {
                        ft.Remove(fragment);
                    }
                    ft.Replace(Resource.Id.dry_myaccountframelayout, myebooksfragment);
                    ft.Commit();
                    return(true);

                case Resource.Id.menu_myaccount_myevals:
                    var ebookcategsfragment = new MyEvalsFragment();
                    var ft1       = ChildFragmentManager.BeginTransaction();
                    var fragment1 = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_myaccountframelayout);
                    if (fragment1 != null)
                    {
                        ft1.Remove(fragment1);
                    }
                    ft1.Replace(Resource.Id.dry_myaccountframelayout, ebookcategsfragment);
                    ft1.Commit();
                    return(true);

                case Resource.Id.menu_myaccount_mymessages:
                    var ebooksubjectsfragment = new MyMessagesFragment();
                    var ft2       = ChildFragmentManager.BeginTransaction();
                    var fragment2 = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_myaccountframelayout);
                    if (fragment2 != null)
                    {
                        ft2.Remove(fragment2);
                    }
                    ft2.Replace(Resource.Id.dry_myaccountframelayout, ebooksubjectsfragment);
                    ft2.Commit();
                    return(true);

                case Resource.Id.menu_myaccount_mysubscriptions:
                    var mysubscriptionsfragment = new MySubscriptionsFragment();
                    var ft3       = ChildFragmentManager.BeginTransaction();
                    var fragment3 = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_myaccountframelayout);
                    if (fragment3 != null)
                    {
                        ft3.Remove(fragment3);
                    }
                    ft3.Replace(Resource.Id.dry_myaccountframelayout, mysubscriptionsfragment);
                    ft3.Commit();
                    return(true);
                }
            }
            catch (Exception ex)
            {
            }
            return(base.OnOptionsItemSelected(item));
        }
Esempio n. 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View   view   = inflater.Inflate(Resource.Layout.Fragment3, container, false);
            Button button = view.FindViewById <Button>(Resource.Id.btnFragment4);

            mFragment4Container = view.FindViewById <FrameLayout>(Resource.Id.fragment4Container);

            var trans = ChildFragmentManager.BeginTransaction();

            trans.Add(mFragment4Container.Id, new Fragment6(), "Fragment 6");
            trans.Commit();

            button.Click += (object sender, EventArgs e) =>
            {
                if (mFragment4Container.TranslationY + 2 >= mFragment4Container.Height)
                {
                    var interpolator = new Android.Views.Animations.OvershootInterpolator(5);
                    mFragment4Container.Animate().SetInterpolator(interpolator)
                    .TranslationYBy(-200)
                    .SetDuration(500);
                }
            };

            mFragment4Container.SetOnTouchListener(this);
            return(view);
        }
Esempio n. 3
0
        private void processmsg_EvaluationDetail(msg_EvaluationDetail msg)
        {
            try
            {
                if (this.Activity == null || this.Activity.IsFinishing)
                {
                    return;
                }
                var viewfragment = new EvaluationDetailFragment(msg);
                var ft           = ChildFragmentManager.BeginTransaction();
                ft.Replace(Resource.Id.dry_evalframelayout, viewfragment);
                ft.Commit();

                //var evalsfragment = new EvaluationDetailFragment(msg.evaluation_dto);
                //var ft = ChildFragmentManager.BeginTransaction();
                //var fragment = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_evaldetailframe);
                //if (fragment != null)
                //    ft.Remove(fragment);
                //ft.Replace(Resource.Id.dry_evaldetailframe, evalsfragment);
                //ft.Commit();
            }
            catch (Exception ex)
            {
            }
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View v = inflater.Inflate(Resource.Layout.fragment_agencydetail, container, false);

            TextView Name        = v.FindViewById <TextView>(Resource.Id.Aname);
            TextView Phonenumber = v.FindViewById <TextView>(Resource.Id.APhonenumber);
            TextView AEmail      = v.FindViewById <TextView>(Resource.Id.Aemail);
            TextView Alocation   = v.FindViewById <TextView>(Resource.Id.Alocation);

            Name.Text        = agencies[0].agencyname;
            Phonenumber.Text = agencies[0].agencyphonenumber;
            AEmail.Text      = agencies[0].agencyemail;
            Alocation.Text   = agencies[0].agencylocation;


            var mapFrag = MapFragment.NewInstance();

            ChildFragmentManager.BeginTransaction()
            .Add(Resource.Id.mapAFrgContainer, mapFrag, "map")
            .Commit();

            mapFrag.GetMapAsync(this);


            Button btnShare = v.FindViewById <Button>(Resource.Id.btnAShare);
            Button btnSMS   = v.FindViewById <Button>(Resource.Id.btnASMS);
            Button btnShow  = v.FindViewById <Button>(Resource.Id.btnAShow);

            btnShare.Click += BtnShare_Click;
            btnSMS.Click   += BtnSMS_Click;
            btnShow.Click  += BtnShow_Click;

            return(v);
        }
Esempio n. 5
0
        private void SetActiveStep()
        {
            ActiveStep.LoadData(() =>
            {
                ProgressBar.Max      = StepCount;
                ProgressBar.Progress = ActiveStepId;

                if (ActiveStepId == 1)
                {
                    BtnBack.Enabled = false;
                }
                else
                {
                    BtnBack.Enabled = true;
                }

                if (ActiveStepId == StepCount)
                {
                    BtnNext.Text = "Concluir";
                }
                else
                {
                    BtnNext.Text = "Próximo";
                }

                var tx = ChildFragmentManager.BeginTransaction();
                tx.Replace(ContainerId, ActiveStep);
                tx.AddToBackStack(null);
                tx.Commit();

                SetStepTitle();
            });
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.FeaturedHomePage, container, false);

            //ChildFragmentManager.BeginTransaction().Replace(Resource.Id.featuredlayout, featured as Android.Support.V4.App.Fragment).Commit();
            ChildFragmentManager.BeginTransaction().Replace(Resource.Id.featuredlayout, nearby as Android.Support.V4.App.Fragment).Commit();

            //view.FindViewById<Button>(Resource.Id.seeallshoots).Clic += HomePageList_Click;

            view.FindViewById <Button>(Resource.Id.seenearbybtn).Click += HomePageList_Click;

            //view.FindViewById<Button>(Resource.Id.seeallfeaturedbtn).Click += HomePageList_Click2;

            view.FindViewById <EditText>(Resource.Id.code).TextChanged += HomePageList_TextChanged;

            if (!WhiteLabelConfig.ALLOW_CODE_JOIN)
            {
                view.FindViewById(Resource.Id.joincodeheader).Visibility = ViewStates.Gone;
                view.FindViewById(Resource.Id.joincodebody).Visibility   = ViewStates.Gone;
            }

            view.FindViewById <SwipeRefreshLayout>(Resource.Id.swiperefresh).Refresh += HomePageList_Refresh;

            return(view);
        }
Esempio n. 7
0
 private void processmsg_TakeEvaluation(msg_TakeEvaluation msg)
 {
     try
     {
         if (this.Activity == null || this.Activity.IsFinishing)
         {
             return;
         }
         //var viewfragment = new TakeEvaluationFragment(msg);
         //var ft = ChildFragmentManager.BeginTransaction();
         //ft.Replace(Resource.Id.dry_evalframelayout, viewfragment);
         //ft.Commit();
         var evalsfragment = new TakeEvaluationFragment(msg);
         var ft            = ChildFragmentManager.BeginTransaction();
         var fragment      = this.ChildFragmentManager.FindFragmentById(Resource.Id.dry_evalframelayout);
         if (fragment != null)
         {
             ft.Remove(fragment);
         }
         ft.Replace(Resource.Id.dry_evalframelayout, evalsfragment);
         ft.Commit();
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 8
0
        private void SettingsBtn_Click(object sender, EventArgs e)
        {
            var ft = ChildFragmentManager.BeginTransaction();

            ft.Add(new SettingsFragment(), "settings");
            ft.CommitAllowingStateLoss();
        }
 // Fragments can host other fragments. When you add a fragment using this method
 // it does not go onto the Back Stack, which is what you usually want for fragments in a tabbed
 // layout. See http://developer.android.com/training/implementing-navigation/temporal.html
 //
 protected void ShowNestedFragment(int viewId, Fragment fragment)
 {
     ChildFragmentManager
     .BeginTransaction()
     .Replace(viewId, fragment)
     .Commit();
 }
Esempio n. 10
0
        private FragmentTransaction ShowDetails()
        {
            FragmentTransaction ft = ChildFragmentManager.BeginTransaction();
            WithdrawFragment    earnDetFragment = new WithdrawFragment();

            ft.Add(earnDetFragment, "earning_details");
            return(ft);
        }
Esempio n. 11
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            //bind Exercies list (nested fragment)
            var exerciseList = LogListFragment.Instance(lm.LogsHistory);
            var trans        = ChildFragmentManager.BeginTransaction();

            trans.Add(Resource.Id.linearLayoutExercises, exerciseList).Commit();
        }
Esempio n. 12
0
 public void ReproducirLista(List <Cancion> lista, int indice = 0)
 {
     Canciones      = lista;
     IndiceActual   = indice;
     ListasFragment = new ListasFragment(lista, this, Usuario, CambiarContenido);
     ChildFragmentManager.BeginTransaction().Replace(Resource.Id.listViewCancionesEnReproduccion, ListasFragment).Commit();
     Reproducir(Canciones[IndiceActual]);
 }
Esempio n. 13
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            Fragment = new SupportMapFragment();
            Fragment.GetMapAsync(this);
            var trans = ChildFragmentManager.BeginTransaction();

            trans.Add(Resource.Id.map_container, Fragment).Commit();
            return(base.OnCreateView(inflater, container, savedInstanceState));
        }
Esempio n. 14
0
        void Init()
        {
            _viewPagerFragment = new ViewPagerFragment();

            ChildFragmentManager
            .BeginTransaction()
            .Replace(Resource.Id.container, _viewPagerFragment)
            .Commit();
        }
 private void DisplayPic(int rotation)
 {
     picDisplayFragment            = new PicDisplayFragment(bitmap, rotation);
     picDisplayFragment.Cancelable = true;
     AndroidX.Fragment.App.FragmentTransaction ft = ChildFragmentManager.BeginTransaction();
     ft.Add(picDisplayFragment, "pic_display");
     ft.CommitAllowingStateLoss();
     picDisplayFragment.SavePic   += PicDisplayFragment_SavePic;
     picDisplayFragment.RetakePic += PicDisplayFragment_RetakePic;
 }
Esempio n. 16
0
        void CreateMap()
        {
            _myMapFrag = SupportMapFragment.NewInstance();
            //FragmentTransaction tx = FragmentManager.BeginTransaction();

            var tx = ChildFragmentManager.BeginTransaction();

            tx.Add(Resource.Id.frameMap, _myMapFrag);
            tx.Commit();
        }
        private void FabPictureOptions_Click(object sender, EventArgs e)
        {
            var picturefragment = new ProfileChooserFragment();

            picturefragment.OnCropComplete += Picturefragment_OnCropComplete;
            var ft = ChildFragmentManager.BeginTransaction();

            ft.Add(picturefragment, "Take_picture");
            ft.CommitAllowingStateLoss();
        }
        protected void ShowAlertDialogFragment(string aMessage, string aTitle, int aIcon)
        {
            if (ChildFragmentManager.IsDestroyed)
            {
                Log.Error(TAG, "Activity has been already destroyed");
                return;
            }
            AlertDialogFragment frag = AlertDialogFragment.NewInstance(aMessage, aTitle, aIcon);

            ChildFragmentManager.BeginTransaction().Add(frag, NOTIFICATION_FRAGMENT_TAG + frag.GetHashCode()).Commit();
        }
Esempio n. 19
0
 public override void OnActivityCreated(Bundle savedInstanceState)
 {
     base.OnActivityCreated(savedInstanceState);
     kpMapFragment = FragmentManager.FindFragmentById(Resource.Id.mapscard);
     if (kpMapFragment == null)
     {
         kpMapFragment = MapFragment.NewInstance();
         ChildFragmentManager.BeginTransaction().Replace(Resource.Id.mapscard, kpMapFragment).Commit();
     }
     setUpGoogleMap();
 }
Esempio n. 20
0
        public void SetFragment(Fragment fragment, int placeholder, string tag)
        {
            var fragmentTx = ChildFragmentManager.BeginTransaction();

            if (fragment.IsAdded)
            {
                fragmentTx.Remove(fragment);
            }
            fragmentTx.Add(placeholder, fragment, tag);
            fragmentTx.Commit();
        }
Esempio n. 21
0
        public void ChildFragReplace(SupportFragment frag, string tag)
        {
            if (frag.IsVisible)
            {
                return;
            }

            var trans = ChildFragmentManager.BeginTransaction();

            trans.Replace(FragContainer.Id, frag);
            trans.Commit();
        }
Esempio n. 22
0
 public override void OnResume()
 {
     base.OnResume();
     kpMapFragment = null;
     kpMapFragment = FragmentManager.FindFragmentById(Resource.Id.mapscard);
     if (kpMapFragment == null)
     {
         kpMapFragment = MapFragment.NewInstance();
         ChildFragmentManager.BeginTransaction().Replace(Resource.Id.mapscard, kpMapFragment).Commit();
     }
     setUpGoogleMap();
 }
Esempio n. 23
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var match_parent = ViewGroup.LayoutParams.MatchParent;

            pad = DpInt(4);

            rootLayout             = new LinearLayout(Context);
            rootLayout.Orientation = Orientation.Vertical;
            rootLayout.SetPadding(pad, 0, pad, 0);

            var itemsOuter = new ScrollView(Context);

            itemsOuter.LayoutParameters = new LinearLayout.LayoutParams(match_parent, 0, 1);

            itemsLayout             = new LinearLayout(Context);
            itemsLayout.Orientation = Orientation.Vertical;
            itemsLayout.SetPadding(0, pad, 0, pad);

            itemsOuter.AddView(itemsLayout);
            rootLayout.AddView(itemsOuter);

            CreateDataItems();

            TextView logTitleView = CreateDataTitleView("Log");

            rootLayout.AddView(logTitleView);
            var frame = new FrameLayout(Context);

            frame.Id = 233;
            frame.LayoutParameters = new LinearLayout.LayoutParams(match_parent, 0, 1);
            rootLayout.AddView(frame);
            var logView = new FragmentLogs()
            {
                InHome = true
            };

            logView.InfoStrChanged += (str) => {
                if (str == null)
                {
                    logTitleView.Text = "Log";
                }
                else
                {
                    logTitleView.Text = "Log " + str;
                }
            };
            ChildFragmentManager.BeginTransaction()
            .Replace(frame.Id, logView)
            .Commit();

            return(rootLayout);
        }
Esempio n. 24
0
        public void ReplaceFragment(BaseFragment fragment, bool addToBackstack)
        {
            var transaction = ChildFragmentManager.BeginTransaction();

            transaction.Replace(Resource.Id.child_fragment_container, fragment);
            Fragment = fragment;
            if (addToBackstack)
            {
                transaction.AddToBackStack(null);
            }

            transaction.CommitAllowingStateLoss();
        }
        public void PresentFragment(NavigationChildFragment fragment)
        {
            var fragmentTransaction = ChildFragmentManager.BeginTransaction();

            fragmentTransaction.Replace(Resource.Id.navigation_content_frame, fragment);
            fragmentTransaction.SetTransition(SupportFragmentTransaction.TransitFragmentFade);

            if (ChildFragmentManager.Fragments.Any())
            {
                fragmentTransaction.AddToBackStack(null);
            }

            fragmentTransaction.Commit();
        }
Esempio n. 26
0
        void OnJobSelected(object sender, EventArgs e)
        {
            var jobDetailFragment = new JobDetailFragment(_viewModel.SelectedJob.Link)
            {
                EnterTransition = new Fade(),
                ExitTransition  = new Fade()
            };

            ChildFragmentManager
            .BeginTransaction()
            .Replace(Resource.Id.container, jobDetailFragment)
            .AddToBackStack(null)
            .Commit();
        }
        protected virtual void RemoveSearchContentFragment()
        {
            var viewType = Mvx.Resolve <IViewLookupService>().Resolve <IContentSearchInternalViewModel>();

            var fragmentName = Java.Lang.Class.FromType(viewType).Name;

            var fragmentTransaction = ChildFragmentManager.BeginTransaction();

            fragmentTransaction.DisallowAddToBackStack();

            PopChildFragment(ChildFragmentManager, fragmentTransaction, fragmentName);

            fragmentTransaction.CommitNow();
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View v = inflater.Inflate(Resource.Layout.fragment_housedetail, container, false);

            TextView Heading        = v.FindViewById <TextView>(Resource.Id.HtvHeading);
            TextView Numberofroom   = v.FindViewById <TextView>(Resource.Id.HtvNumberofroom);
            TextView Numberoftoilet = v.FindViewById <TextView>(Resource.Id.HtvNumberoftoilet);
            TextView Rentfee        = v.FindViewById <TextView>(Resource.Id.HtvRentfee);
            TextView nAgency        = v.FindViewById <TextView>(Resource.Id.HtvAgency);
            TextView ALocation      = v.FindViewById <TextView>(Resource.Id.HtvLocation);
            TextView Description    = v.FindViewById <TextView>(Resource.Id.HtvDescription);


            Heading.Text        = "House name : " + hList[hid - 1].heading;
            Numberofroom.Text   = hList[hid - 1].numberofroom;
            Numberoftoilet.Text = hList[hid - 1].numberoftoilet;
            Rentfee.Text        = hList[hid - 1].rentfee;
            nAgency.Text        = "Agency name : " + agencies[0].agencyname;
            ALocation.Text      = hList[hid - 1].location;
            Description.Text    = "Description " + hList[hid - 1].description;



            ImageView imgMapFrag = v.FindViewById <ImageView>(Resource.Id.imgHMapFrag);

            imgMapFrag.SetImageResource(id);

            FrameLayout mapFragContainer = v.FindViewById <FrameLayout>(Resource.Id.mapFrgContainer);

            var mapFrag = MapFragment.NewInstance();

            ChildFragmentManager.BeginTransaction()
            .Add(Resource.Id.mapFrgContainer, mapFrag, "map")
            .Commit();

            mapFrag.GetMapAsync(this);



            Button btnShare = v.FindViewById <Button>(Resource.Id.btnShare);
            Button btnSMS   = v.FindViewById <Button>(Resource.Id.btnSMS);

            btnShare.Click += BtnShare_Click;
            btnSMS.Click   += BtnSMS_Click;


            return(v);
        }
Esempio n. 29
0
        public void InsertFragmentIntoContainer(BaseFragment fragment, int container)
        {
            var exFragment = ChildFragmentManager.FindFragmentById(container);
            FragmentTransaction childFragTrans = ChildFragmentManager.BeginTransaction();

            if (exFragment == null)
            {
                childFragTrans.Add(container, fragment);
            }
            else
            {
                childFragTrans.Replace(container, fragment);
            }
            childFragTrans.CommitAllowingStateLoss();
        }
Esempio n. 30
0
        void ShowFragment(Fragment fragment, int id)
        {
            var fragmentTransaction = ChildFragmentManager.BeginTransaction();
            var showFragment        = ChildFragmentManager.FindFragmentById(id);

            if (showFragment == null)
            {
                fragmentTransaction.Add(id, fragment);
            }
            else
            {
                fragmentTransaction.Remove(showFragment).Add(id, fragment);
            }
            fragmentTransaction.Commit();
        }