Ejemplo n.º 1
0
        public virtual void ShowAllowingStateLoss(FragmentManager manager, string tag)
        {
            FragmentTransaction ft = manager.BeginTransaction();

            ft.Add(this, tag);
            ft.CommitAllowingStateLoss();
        }
Ejemplo n.º 2
0
            public void OnItemClick(AdapterView parent, View view, int position, long id)
            {
                if (SystemClock.ElapsedRealtime() - mLastClickTime < 1000)
                {
                    return;
                }
                mLastClickTime = SystemClock.ElapsedRealtime();

                if (notification[position].Type == "FR")
                {
                    Intent intent = new Intent(activity, typeof(FriendRequestActivity));
                    activity.StartActivity(intent);
                }
                else
                if (notification[position].Type == "ER")
                {
                    var fragment = new EventRequestFragment();
                    Android.Support.V4.App.FragmentManager FragmentManager = activity.SupportFragmentManager;
                    MainActivity.myBundle.PutLong("EventID", notification[position].EventID);
                    FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment, "eventRequest").AddToBackStack("eventRequest").Commit();
                }
                else
                if (notification[position].Type == "FA")
                {
                    var    item         = notification[position];
                    Intent mainActivity = new Intent(activity, typeof(MainActivity));
                    mainActivity.PutExtra("FromPeople", item.SenderID);
                    activity.StartActivity(mainActivity);
                }
                else
                if (notification[position].Type == "WE")
                {
                    new getWeClipInfo(activity, notification[position].WeClipID).Execute();
                }
            }
Ejemplo n.º 3
0
        private void BtnEventSearch_Click(object sender, EventArgs e)
        {
            var eventSearch = new EventSearchFragmentFromHome();

            Android.Support.V4.App.FragmentManager eventFragmentManager = Activity.SupportFragmentManager;
            eventFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, eventSearch, "eventSearch").AddToBackStack("eventSearch").Commit();
        }
Ejemplo n.º 4
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            MyView myholder = holder as MyView;

            myholder.Task.Text          = Mitems[position].task_name;
            myholder.Create_by.Text     = Mitems[position].task_created_by;
            myholder.Deadline_date.Text = Mitems[position].deadlineDate.ToString();
            // myholder.time_left.Text = Mitems[position].mark_to;
            var local = new LocalOnClickListener();

            myholder.Linear.SetOnClickListener(local);
            local.HandleOnClick = () =>
            {
                string id = Mitems[position].task_id;

                ComplainceFrag nextFrag = new ComplainceFrag();
                Android.Support.V4.App.FragmentTransaction ft = fragment.BeginTransaction();
                //ft.Replace(Resource.Id.container, nextFrag, "ComplainceFragment");
                ft.Hide(fragment.FindFragmentByTag("MainFrag"));
                ft.Add(Resource.Id.container, nextFrag, "ComplainceFragment");
                ft.AddToBackStack("TaskInboxFrag");
                ft.SetTransition(FragmentTransaction.TransitFragmentOpen);
                ft.Commit();
                // fragment.BeginTransaction().Replace(Resource.Id.container, nextFrag).Commit();
                Bundle bundle = new Bundle();
                bundle.PutString("task_id", id);
                nextFrag.Arguments = bundle;
            };


            myholder.time_left.Text = date_difference(DateTime.Now, Mitems[position].deadlineDate);
        }
Ejemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            //java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=17271, uid=10085 requires android.permission.READ_EXTERNAL_STORAGE
            //6.0及以上需要动态申请权限
            if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.M)
            {
                //RequestWriteSettings();
                bool isGrant = ActivityCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) == Permission.Granted;
                if (isGrant == false)
                {
                    ActivityCompat.RequestPermissions(this, new string[] { Manifest.Permission.ReadExternalStorage }, PERMISSION_ReadExternalStorage);
                }
                else
                {
                    Songleton.Instance.AllSongs = MusicRetrieval.LoadSongs(this);
                    if (savedInstanceState == null)
                    {
                        SongListFragment songListFragment = new SongListFragment();
                        //MusicControlFragment musicControlFragment = new MusicControlFragment ();
                        MusicControls musicControls = new MusicControls();
                        //var trans = FragmentManager.BeginTransaction ();以下两条语句极度重要,解决大问题!
                        Android.Support.V4.App.FragmentManager     fragmentManager = SupportFragmentManager;
                        Android.Support.V4.App.FragmentTransaction trans           = fragmentManager.BeginTransaction();
                        trans.Add(Resource.Id.fragment_container, songListFragment, "songListFragment");
                        trans.Add(Resource.Id.music_controls_container, musicControls, "musicControls");
                        trans.Commit();
                    }
                    //在程序中获取string.xml中字符串和数值
                    Toast.MakeText(this, this.Resources.GetString(Resource.String.scan_songs) + Songleton.Instance.AllSongs.Count.ToString(), ToastLength.Short).Show();
                }
            }
        }
Ejemplo n.º 6
0
        private void ShowJoystick(bool animated)
        {
            _joystickFragment.Activate();
            _joystickVisibile = true;

            if (animated)
            {
                // We show the joystick with an animation
                _tabLayout.Animate().Alpha(0).SetDuration(200).SetListener(null).Start();
                _viewPager.Animate().Alpha(0).SetDuration(200).SetListener(null).Start();

                FragmentManager.BeginTransaction()
                .SetCustomAnimations(Resource.Animation.FadeIn, Resource.Animation.FadeOut)
                .Show(_joystickFragment)
                .Commit();
            }
            else
            {
                _tabLayout.Alpha = 0;
                _viewPager.Alpha = 0;

                FragmentManager.BeginTransaction()
                .Show(_joystickFragment)
                .Commit();
            }
        }
Ejemplo n.º 7
0
        private void HideJoystick(bool animated)
        {
            _joystickVisibile = false;

            if (animated)
            {
                // We hide the joystick with an animation
                _tabLayout.Visibility = ViewStates.Visible;
                _tabLayout.Animate()
                .Alpha(1)
                .SetDuration(200)
                .Start();

                _viewPager.Visibility = ViewStates.Visible;
                _viewPager.Animate()
                .Alpha(1)
                .SetDuration(200)
                .Start();

                FragmentManager.BeginTransaction()
                .SetCustomAnimations(Resource.Animation.FadeIn, Resource.Animation.FadeOut)
                .Hide(_joystickFragment)
                .Commit();
            }
            else
            {
                _tabLayout.Visibility = ViewStates.Visible;
                _viewPager.Visibility = ViewStates.Visible;

                FragmentManager.BeginTransaction()
                .Hide(_joystickFragment)
                .Commit();
            }
        }
Ejemplo n.º 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            base.OnCreate(savedInstanceState);
            //clsock.Connect();
            SetContentView(Resource.Layout.activity_main);

            //Android.Support.V7.Widget.Toolbar toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            //SetSupportActionBar(toolbar);



            Android.Support.V4.App.FragmentManager fm       = SupportFragmentManager;
            Android.Support.V4.App.Fragment        fragment = fm.FindFragmentById(Resource.Id.main_act_fragment);

            if (fragment == null)
            {
                fragment = new MainActivityFragmentHolder();
                fm.BeginTransaction()
                .Add(Resource.Id.main_act_fragment, fragment)
                .Commit();
            }



            if (savedInstanceState == null ||
                !savedInstanceState.ContainsKey("message") || !savedInstanceState.ContainsKey("reply"))
            {
                return;
            }
            //textbox_send.Text = savedInstanceState.GetString("message");
            //textbox_server.Text = savedInstanceState.GetString("server");
            //textbox_receive.Text = savedInstanceState.GetString("reply");
        }
Ejemplo n.º 9
0
        public override View OnCreateView(LayoutInflater inflater,
                                          ViewGroup container,
                                          Bundle savedInstanceState)
        {
            var  ignored = base.OnCreateView(inflater, container, savedInstanceState);
            View self    = inflater.Inflate(Resource.Layout.fragment1, null);

            ListView report_sel = self.FindViewById <ListView>(Resource.Id.report_sel_listview);

            // Array con los reportes. Simplemente debe de crearse una instancia
            // de cada reporde dentro de este array.
            // La logica del frame y la interna de cada reporte sera la que actualize
            // el frame segun corresponda
            Report[] reports = new Report[] {
                new NotificacionesPorNotificadorReport(),
                new NotificacionesEnviadasReport(),
                new NotificacionesDevueltas(),
                new NotificacionesRealizadasConDuracion(),
                new NotificacionesRealizadasSegunResultado(),
                new NotificacionesAsignadasPendientesPorJornada(),
            };

            report_sel.Adapter = new ArrayAdapter(
                report_sel.Context,
                Android.Resource.Layout.SimpleListItem1,
                reports);

            report_sel.ItemClick += (sender, e) => {
                Fragment frag = reports[e.Position].getInputReportFragment();
                FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, frag).Commit();
            };

            return(self);
        }
        public override void OpenActivityOrFragment(Android.Content.Intent intent)
        {
            var pm = PackageManager;
            var resolveInfoList = pm.QueryIntentActivities(intent, PackageInfoFlags.MatchDefaultOnly);

            foreach (var resolveInfo in resolveInfoList)
            {
                FragmentReplaceInfo fri = OnSubstituteFragmentForActivityLaunch(resolveInfo.ActivityInfo.Name);
                if (fri != null)
                {
                    Bundle          arguments = IntentToFragmentArguments(intent);
                    FragmentManager fm        = SupportFragmentManager;

                    try {
                        Fragment fragment = (Fragment)fri.GetFragmentClass().NewInstance();
                        fragment.Arguments = arguments;

                        FragmentTransaction ft = fm.BeginTransaction();
                        ft.Replace(fri.GetContainerId(), fragment, fri.GetFragmentTag());
                        OnBeforeCommitReplaceFragment(fm, ft, fragment);
                        ft.Commit();
                    } catch (Exception e) {
                        new Exception("Error creating new fragment." + e.Message);
                    }
                    return;
                }
            }
            base.OpenActivityOrFragment(intent);
        }
Ejemplo n.º 11
0
        private void SetUpDrawerContent(NavigationView navigationView)
        {
            navigationView.NavigationItemSelected += (object sender, NavigationView.NavigationItemSelectedEventArgs e) =>
            {
                e.MenuItem.SetChecked(true);
                mDrawerLayout.CloseDrawers();
                var item  = e.MenuItem.ToString();
                var trans = SupportFragmentManager.BeginTransaction();
                switch (item)
                {
                case "Citas":
                    trans.Add(Resource.Id.viewpager, new Fragment2(), "Citas");
                    trans.Commit();
                    break;

                case "Salir":

                    session = GetSharedPreferences("SessionLogin", FileCreationMode.Private);
                    ISharedPreferencesEditor sessionEditor = session.Edit();
                    sessionEditor.Remove("SessionName");
                    sessionEditor.Remove("SessionId");
                    sessionEditor.Remove("SessionUserName");
                    sessionEditor.Remove("SessionCorreo");
                    sessionEditor.Commit();
                    Finish();
                    break;
                }

                Toast.MakeText(this, item, ToastLength.Long).Show();
            };
        }
Ejemplo n.º 12
0
        public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)
        {
            if (requestCode == PERMISSION_ReadExternalStorage)
            {
                if (grantResults[0] == Permission.Granted)
                {
                    Songleton.Instance.AllSongs = MusicRetrieval.LoadSongs(this);
                    SongListFragment songListFragment = new SongListFragment();
                    //MusicControlFragment musicControlFragment = new MusicControlFragment ();
                    MusicControls musicControls = new MusicControls();
                    //var trans = FragmentManager.BeginTransaction ();以下两条语句极度重要,解决大问题!
                    Android.Support.V4.App.FragmentManager     fragmentManager = SupportFragmentManager;
                    Android.Support.V4.App.FragmentTransaction trans           = fragmentManager.BeginTransaction();
                    trans.Add(Resource.Id.fragment_container, songListFragment, "songListFragment");
                    trans.Add(Resource.Id.music_controls_container, musicControls, "musicControls");
                    trans.Commit();

                    if (Build.VERSION.SdkInt != Android.OS.BuildVersionCodes.NMr1)
                    {
                        Toast.MakeText(this, "读取数据权限已申请", ToastLength.Short).Show();
                    }
                }
                else
                {
                    if (Build.VERSION.SdkInt != Android.OS.BuildVersionCodes.NMr1)
                    {
                        Toast.MakeText(this, "申请读取数据权限被拒", ToastLength.Short).Show();
                    }
                }
            }
        }
Ejemplo n.º 13
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                mDrawerLayout.OpenDrawer((int)GravityFlags.Left);
                return(true);

            case Resource.Id.toolbarMenu_pricingType:
                //show dialog here
                SupportFragmentTransaction transaction       = SupportFragmentManager.BeginTransaction();
                PricingTypeDialogFragment  pricingTypeDialog = new PricingTypeDialogFragment();
                //pass current selected price type t
                var args = new Bundle();
                args.PutString("currentPricingType", mCurrentSelectedPriceType);
                pricingTypeDialog.Arguments = args;

                pricingTypeDialog.Show(transaction, "pricingTypeDialogFragment");
                return(true);

            case Resource.Id.toolbarMenu_customer:
                Android.Widget.Toast.MakeText(this, "Clicked Customer Icon!", Android.Widget.ToastLength.Long).Show();
                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }
Ejemplo n.º 14
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var            grid     = convertView;
            LayoutInflater inflater = (LayoutInflater)mContext.GetSystemService(Context.LayoutInflaterService);

            OutboxViewHolder3 holder;

            if (grid == null)
            {
                holder = new OutboxViewHolder3();
                grid   = inflater.Inflate(Resource.Layout.Attachment_layout, null);
                var view = grid.FindViewById <ImageView>(Resource.Id.imageview_attach);
                grid.Tag = new OutboxViewHolder3()
                {
                    View = view
                };
            }

            holder = (OutboxViewHolder3)grid.Tag;


            holder.View.SetImageResource(Resource.Drawable.audiofile);
            holder.View.Click += (o, e) =>
            {
                FragmentTransaction transcation   = fragment.BeginTransaction();
                DialogClassFragment audiodownload = new DialogClassFragment();
                //  audiodownload.SetStyle(Convert.ToInt32(Android.App.DialogFragmentStyle.Normal), Resource.Style.FullScreenDialogStyle);


                audiodownload.Show(transcation, "Dialog Fragment");
                Bundle bundle = new Bundle();
                bundle.PutString("Path", myList[position].Path);
                audiodownload.Arguments = bundle;
            };

            //View view1 = LayoutInflater.Inflate(Resource.Layout.audio_player, null);
            //Android.App.AlertDialog builder = new Android.App.AlertDialog.Builder(mContext).Create();
            //builder.SetView(view1);
            //builder.Window.SetLayout(600, 600);
            //builder.SetCanceledOnTouchOutside(false);


            //AudioFragment1 audiofragment = new AudioFragment1();
            //// audiofragment.Download_Click();

            //FragmentTransaction ft = fragment.BeginTransaction();
            //ft.Replace(Resource.Id.container, audiofragment).Commit();

            //ft.AddToBackStack(null);
            //Bundle bundle = new Bundle();
            //bundle.PutString("Path", myList[position].Path);
            //audiofragment.Arguments = bundle;
            ////  var path = myList[position].Path;
            ////  StartPlayer(path);



            return(grid);
        }
 public void OnClick(View v)
 {
     Android.Support.V4.App.Fragment        editProfile     = new EventFragment();
     Android.Support.V4.App.FragmentManager fragmentManager = context.SupportFragmentManager;
     MainActivity.myBundle.PutLong("EventID", eventID);
     fragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, editProfile).AddToBackStack("eventFromProfile").Commit();
     llEventName.SetOnClickListener(null);
 }
Ejemplo n.º 16
0
 public void RemoveFragment(Context context, Fragment newFragment, string TAG)
 {
     Android.Support.V4.App.FragmentManager     fragmentManager = ((FragmentActivity)context).SupportFragmentManager;
     Android.Support.V4.App.FragmentTransaction ft = fragmentManager.BeginTransaction();
     ft.Remove(newFragment);
     ft.AddToBackStack(TAG);
     ft.Commit();
 }
Ejemplo n.º 17
0
 public void ReplaceFragment(Context context, Android.Support.V4.App.Fragment newFragment)
 {
     Android.Support.V4.App.FragmentManager     fragmentManager = ((FragmentActivity)context).SupportFragmentManager;
     Android.Support.V4.App.FragmentTransaction ft = fragmentManager.BeginTransaction();
     ft.Replace(Resource.Id.home_frame_layout, newFragment);
     ft.AddToBackStack(null);
     ft.Commit();
 }
Ejemplo n.º 18
0
        public static HolderFragment <T> CreateHolderFragment(FragmentManager fragmentManager)
        {
            var holder = new HolderFragment <T>();

            fragmentManager.BeginTransaction()
            .Add(holder, "android.arch.lifecycle.state.StateProviderHolderFragment")
            .CommitAllowingStateLoss();
            return(holder);
        }
            public void OnClick(View v)
            {
                var fragment = new EventFragment();

                Android.Support.V4.App.FragmentManager eventFragmentManager = context.SupportFragmentManager;
                MainActivity.myBundle.PutLong("EventID", eventID);
                eventFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment, "event").AddToBackStack("event").Commit();
                ivEventPhoto.SetOnClickListener(null);
            }
Ejemplo n.º 20
0
 public static void NavigateTo(int containerViewId, V4App.Fragment fragment, V4App.FragmentManager fragmentManager)
 {
     if (fragment != null)
     {
         V4App.FragmentTransaction ft = fragmentManager.BeginTransaction();
         ft.Replace(Resource.Id.content_frame, fragment);
         ft.Commit();
     }
 }
Ejemplo n.º 21
0
        static ViewModelStoreFragment Create(FragmentManager ft)
        {
            var holder = new ViewModelStoreFragment();

            ft.BeginTransaction()
            .Add(holder, HOLDER_TAG)
            .CommitAllowingStateLoss();
            return(holder);
        }
Ejemplo n.º 22
0
        private void SetTabSections(int index)
        {
            ResetView();
            var trasaction = fragmentManager.BeginTransaction();

            //隐藏掉所有的fragment
            HideFragments(trasaction);
            switch (index)
            {
            case 0:
                ll_tab_bottom_server.SetBackgroundResource(Resource.Color.griditems_bg);
                btn_tab_bottom_server.SetImageResource(Resource.Drawable.ic_menu_health_selected);
                tv_tab_bottom_server.SetTextColor(Resources.GetColor(Resource.Color.blue));
                if (_serverFrag == null)
                {
                    _serverFrag = new MainTabServerFragment();
                    trasaction.Add(Resource.Id.id_mainContent, _serverFrag);
                }
                else
                {
                    trasaction.Show(_serverFrag);
                }
                break;

            case 1:
                ll_tab_bottom_finance.SetBackgroundResource(Resource.Color.griditems_bg);
                btn_tab_bottom_finance.SetImageResource(Resource.Drawable.ic_menu_alarm_selected);
                tv_tab_bottom_finance.SetTextColor(Resources.GetColor(Resource.Color.blue));
                if (_financeFrag == null)
                {
                    _financeFrag = new MainTabFinanceFragment();
                    trasaction.Add(Resource.Id.id_mainContent, _financeFrag);
                }
                else
                {
                    trasaction.Show(_financeFrag);
                }
                break;

            case 2:
                ll_tab_bottom_my.SetBackgroundResource(Resource.Color.griditems_bg);
                btn_tab_bottom_my.SetImageResource(Resource.Drawable.ic_menu_mine_selected);
                tv_tab_bottom_my.SetTextColor(Resources.GetColor(Resource.Color.blue));
                if (_myFrag == null)
                {
                    _myFrag = new MainTabMyFragment();
                    trasaction.Add(Resource.Id.id_mainContent, _myFrag);
                }
                else
                {
                    trasaction.Show(_myFrag);
                }
                break;
            }
            trasaction.Commit();
        }
Ejemplo n.º 23
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                mDrawerLayout.OpenDrawer((int)GravityFlags.Left);
                return(true);

            case Resource.Id.toolbarMenu_pricingType:
                if (!mDialogShown)     //avoid double click
                {
                    mDialogShown = true;
                    //show dialog here
                    SupportFragmentTransaction transaction       = SupportFragmentManager.BeginTransaction();
                    PricingTypeDialogFragment  pricingTypeDialog = new PricingTypeDialogFragment();
                    //pass current selected price type t
                    var args = new Bundle();
                    args.PutString("currentPricingType", mCurrentSelectedPriceType);
                    args.PutString("callerActivity", "MainActivity");
                    pricingTypeDialog.Arguments = args;
                    pricingTypeDialog.Show(transaction, "pricingTypeDialogFragment");
                }
                return(true);

            case Resource.Id.toolbarMenu_customer:
                if (!mDialogShown)
                {
                    mDialogShown = true;
                    Intent intent = new Intent(this, typeof(CheckoutSelectCustomerActivity));
                    intent.PutExtra("isCustomer", mCurrentSelectedPriceType == "RUNR" ? false : true);
                    StartActivityForResult(intent, 1);
                }
                return(true);

            case Resource.Id.menuItem_AddNewCustomer:
                if (!mDialogShown)    //customers fragment
                {
                    mDialogShown = true;
                    Intent intent = new Intent(this, typeof(CustomersFragmentAddCustomerActivity));
                    StartActivityForResult(intent, 33);
                }
                return(true);

            case Resource.Id.menuItem_AddNewRunner:
                if (!mDialogShown)    //customers fragment
                {
                    mDialogShown = true;
                    Intent intent = new Intent(this, typeof(RunnersFragmentAddRunnerActivity));
                    StartActivityForResult(intent, 40);
                }
                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }
Ejemplo n.º 24
0
        private void SignInDialog_mOnSignInComplete(object sender, OnSignInEventArgs e)
        {
            SetContentView(Resource.Layout.MainScreen);
            Android.Support.V4.App.FragmentManager     fragmentManager = SupportFragmentManager;
            Android.Support.V4.App.FragmentTransaction transaction     = fragmentManager.BeginTransaction();
            SlidingTabFragment fragment = new SlidingTabFragment();

            transaction.Replace(Resource.Id.sample_content_fragment, fragment);
            transaction.Commit();
        }
Ejemplo n.º 25
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     this.SetContentView(Resource.Layout.activity_example);
     Android.Support.V4.App.FragmentManager     fm = this.SupportFragmentManager;
     Android.Support.V4.App.FragmentTransaction ft = fm.BeginTransaction();
     ft.Replace(Resource.Id.container, selectedExampleFragment);
     ft.Commit();
     this.Title = ((ExampleFragment)selectedExampleFragment).Title();
     // Create your application here
 }
Ejemplo n.º 26
0
 public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object @object)
 {
     base.DestroyItem(container, position, @object);
     if (position >= Count)
     {
         FragmentManager     manager = ((Fragment)@object).FragmentManager;
         FragmentTransaction trans   = manager.BeginTransaction();
         trans.Remove((Fragment)@object);
         trans.Commit();
     }
 }
Ejemplo n.º 27
0
        private void BtnViewProfile_Click(object sender, EventArgs e)
        {
            var    profile = new ProfileFragment();
            Bundle b       = new Bundle();
            long   UserId  = Convert.ToInt64(GlobalClass.UserID);

            b.PutLong("UserId", UserId);
            profile.Arguments = (b);
            Android.Support.V4.App.FragmentManager eventFragmentManager = Activity.SupportFragmentManager;
            eventFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, profile, "profile").AddToBackStack("profile").Commit();
        }
Ejemplo n.º 28
0
        private void ShowFragment(SupportFragment fragment)
        {
            var trans = SupportFragmentManager.BeginTransaction();

            trans.Hide(mCurrentFragment);
            trans.Show(fragment);
            trans.AddToBackStack(null);
            trans.Commit();

            mStackFragment.Push(mCurrentFragment);
            mCurrentFragment = fragment;
        }
        private async void GoToAllProgramsPage(long boardId)
        {
            var uwBoardView = await _uwBoardControllerService.GetUpwardBoardView(boardId);

            if (uwBoardView != null)
            {
                var allProgramsFragment = new AllProgramsPage(uwBoardView).CreateFragment(this);
                var ft = FragmentManager.BeginTransaction();
                ft.AddToBackStack(null);
                ft.Replace(Resource.Id.simpleActivityContent, allProgramsFragment, Constants.FRAG_TYPE_ALL_PROGRAMS);
                ft.Commit();
            }
        }
Ejemplo n.º 30
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.HomePage);

            SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar);


            mLocationMap = new LocationMap();
            mOSMMap      = new BaseOSMMap();
            mHome        = new Home();

            mapWithLabel   = new SampleWithMinimapItemizedOverlayWithFocus();
            mStackFragment = new Stack <SupportFragment>();
            var trans = SupportFragmentManager.BeginTransaction();

            trans.Add(Resource.Id.fragmentContainer, mLocationMap, "mainPage");
            trans.Add(Resource.Id.fragmentContainer, mOSMMap, "OSMMAP");
            trans.Add(Resource.Id.fragmentContainer, mapWithLabel, "MapWithLabel");
            trans.Add(Resource.Id.fragmentContainer, mHome, "Home");
            trans.Hide(mLocationMap);
            trans.Hide(mOSMMap);
            trans.Hide(mapWithLabel);
            trans.Commit();
            mCurrentFragment = mHome;//mMainPage;


            SetSupportActionBar(toolBar);

            SupportActionBar ab = SupportActionBar;

            ab.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            ab.SetDisplayHomeAsUpEnabled(true);

            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);


            if (navigationView != null)
            {
                SetUpDrawerContent(navigationView);
            }
            LogInModule lg               = new LogInModule();
            View        header           = navigationView.GetHeaderView(0);
            TextView    _userNameTXTVIEW = header.FindViewById <TextView>(Resource.Id.nav_userName);

            /*View view=navigationView.inflateHeaderView(R.layout.nav_header_main);*/
            _userNameTXTVIEW.Text = lg.GetUserName();
        }