public bool OnNavigationItemSelected(IMenuItem item) { int id = item.ItemId; FragmentTransaction transaction = this.FragmentManager.BeginTransaction(); if (id == Resource.Id.navRating) { fragment = new Rating(); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); drawer.CloseDrawer(GravityCompat.Start); transaction.Replace(Resource.Id.FramePage, fragment); transaction.Commit(); } else if (id == Resource.Id.navTopDriver) { fragment = new addDriverFragment(); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); drawer.CloseDrawer(GravityCompat.Start); transaction.Replace(Resource.Id.FramePage, fragment); transaction.Commit(); } else if (id == Resource.Id.navBalance) { fragment = new Balance(); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); drawer.CloseDrawer(GravityCompat.Start); transaction.Replace(Resource.Id.FramePage, fragment); transaction.Commit(); } else if (id == Resource.Id.nav_send) { auth.SignOut(); editor = preferences.Edit(); editor.Clear().Commit(); if (auth.CurrentUser == null) { StartActivity(new Intent(this, typeof(LoginActivity))); Finish(); } } return(true); }
private void DisplayFragment() { Fragment fragment = AddOrderSecondFragment.GetInstance(); FragmentTransaction ft = FragmentManager.BeginTransaction(); ft.Replace(Resource.Id.frame_container, fragment, fragment.Class.Name); ft.AddToBackStack(null); ft.Commit(); }
//start search page fragment if search icon is clicked. void search_Click(object sender, EventArgs e) { FragmentTransaction fragmentTransaction = this.Activity.FragmentManager.BeginTransaction(); SearchFragmentActual prof = new SearchFragmentActual(); fragmentTransaction.Replace(Resource.Id.frame, prof); fragmentTransaction.AddToBackStack("HomePage"); fragmentTransaction.Commit(); }
private void addA_Click(object sender, EventArgs e) { Fragment_A fragmentA = new Fragment_A(); FragmentTransaction transaction = this.FragmentManager.BeginTransaction(); transaction.Add(Resource.Id.container, fragmentA, "fragA"); transaction.Commit(); }
private void LoadAllFragments() { FragmentTransaction fragmentTx = FragmentManager.BeginTransaction(); fragmentTx.Add(Resource.Id.fragmentFrameLayout, filmsFragment); fragmentTx.Add(Resource.Id.fragmentFrameLayout, pageFragment); fragmentTx.Detach(pageFragment); fragmentTx.Commit(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.SearchPage); mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar_search); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout_search); SetSupportActionBar(mToolbar); FragmentTransaction transaction = FragmentManager.BeginTransaction(); SlidingTabsFragment fragment = new SlidingTabsFragment(); transaction.Replace(Resource.Id.search_fragment, fragment); transaction.Commit(); try { mDrawerToggle = new MyActionBarDrawerToggle( this, //Host Activity mDrawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); mDrawerLayout.SetDrawerListener(mDrawerToggle); //gives drawer toggle permission to call the methods SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); mDrawerToggle.SyncState(); } catch { } mNavView = FindViewById <NavigationView>(Resource.Id.nav_view_search); mHomeItem = FindViewById <AdapterView>(Resource.Id.nav_home); mNavView.NavigationItemSelected += MNavView_NavigationItemSelected; if (bundle != null) { if (bundle.GetString("DrawerState") == "Opened") { SupportActionBar.SetTitle(Resource.String.openDrawer); } else { SupportActionBar.SetTitle(Resource.String.closeDrawer); } } else { //first time activity is ran SupportActionBar.SetTitle(Resource.String.closeDrawer); } }
private void LoadClockFragment() { using (FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction()) { fragmentTransaction.Replace(Resource.Id.weatherandcLockplaceholder, clockFragment); fragmentTransaction.DisallowAddToBackStack(); fragmentTransaction.Commit(); } }
public void LaunchViewBehavior(BehaviorGraph behaviorGraph) { FragmentTransaction ft = Activity.SupportFragmentManager.BeginTransaction(); Fragment fragment = new ClientViewBehaviorView(behaviorGraph); ft.Replace(Resource.Id.fragment_container, fragment); ft.AddToBackStack(null); ft.Commit(); }
private void goSettings(object sender, EventArgs e) { FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction(); AccountSettingsFragment accountSettingsFragment = new AccountSettingsFragment(); fragmentTransaction.Replace(Resource.Id.content_frame, accountSettingsFragment, "accountSettingsFragment"); fragmentTransaction.AddToBackStack(null); fragmentTransaction.Commit(); }
private void ShowDimensionBtnClicked(object sender, EventArgs e) { Fragment packageDetails = new PackageDetailsFragment(); FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction(); fragmentTransaction.SetTransition(FragmentTransit.EnterMask); fragmentTransaction.Replace(Resource.Id.fragment_container, packageDetails); fragmentTransaction.Commit(); }
protected void OnMyProfileClick(object sender, EventArgs e) { //ShowEmployeeCollectionView(FilterLookup.EmployeeReviews); DetailedUserProfileFragment userViewFragment = new DetailedUserProfileFragment(); FragmentTransaction transaction = FragmentManager.BeginTransaction(); transaction.Replace(Resource.Id.fragmentContainerID, userViewFragment); transaction.Commit(); }
private void AddA_Click(object sender, System.EventArgs e) { Log.Info("KKKKKKK", "Add A button Clicked"); FragmentA fragmentA = new FragmentA(); FragmentTransaction transaction = FragmentManager.BeginTransaction(); transaction.Add(Resource.Id.container, fragmentA, "fragA"); transaction.Commit(); }
public void removeFragment(Fragment myFrag, FragmentManager fragmentManager) { FragmentTransaction transaction = fragmentManager.BeginTransaction(); transaction.SetCustomAnimations(Resource.Animator.slide_from_out_bottom, Resource.Animator.slide_in_bottom); transaction.Remove(myFrag); transaction.Commit(); fragmentManager.PopBackStack(); }
public void replaceFragments(Fragment fragment, int idContainer, String fragmentTag, FragmentManager fragmentManager) { FragmentTransaction transaction = fragmentManager.BeginTransaction(); transaction.SetCustomAnimations(Resource.Animator.slide_in_up, Resource.Animator.slide_in_down); transaction.Replace(idContainer, fragment, fragmentTag); transaction.AddToBackStack(null); transaction.Commit(); }
public void LoadMovieFragment() { FragmentTransaction fragmentTx = FragmentManager.BeginTransaction(); fragmentTx.Detach(filmsFragment); fragmentTx.Attach(pageFragment); fragmentTx.AddToBackStack(null); fragmentTx.Commit(); }
public void InitMap() { // Maps var mapFragment = MapFragment.NewInstance(); FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction(); fragmentTransaction.Add(Resource.Id.mapContainer, mapFragment); fragmentTransaction.Commit(); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CustomMap); _toolbar = FindViewById <Toolbar>(Resource.Id.tv_cm_toolbar); SetSupportActionBar(_toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); _setPlaceButton = FindViewById <Button>(Resource.Id.btn_cm_setCoordinates); PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)FragmentManager.FindFragmentById(Resource.Id.place_autocomplete_fragment); var content = Intent.GetStringExtra("place"); _isEditable = Intent.GetBooleanExtra("isEditable", false); if (!_isEditable) { autocompleteFragment.View.Visibility = ViewStates.Gone; _setPlaceButton.Visibility = ViewStates.Gone; } else { autocompleteFragment.SetOnPlaceSelectedListener(this); autocompleteFragment.SetBoundsBias(new LatLngBounds( new LatLng(4.5931, -74.1552), new LatLng(4.6559, -74.0837))); _setPlaceButton.Click += SetPlaceButton_Click; } if (!string.IsNullOrWhiteSpace(content)) { _markerPosition = JsonConvert.DeserializeObject <Coordinates>(content); } _fusedLocationProviderClient = LocationServices.GetFusedLocationProviderClient(this); _mapFragment = FragmentManager.FindFragmentByTag("map") as MapFragment; if (_mapFragment == null) { Location location = await _fusedLocationProviderClient.GetLastLocationAsync(); var myPosition = new LatLng(location.Latitude, location.Longitude);// (20.5, 20.5); GoogleMapOptions mapOptions = new GoogleMapOptions() .InvokeMapType(GoogleMap.MapTypeNormal) .InvokeZoomControlsEnabled(true) .InvokeMapToolbarEnabled(true) .InvokeCamera(new CameraPosition(myPosition, 10, 0, 0)) .InvokeCompassEnabled(true); FragmentTransaction fragTx = FragmentManager.BeginTransaction(); _mapFragment = MapFragment.NewInstance(mapOptions); fragTx.Add(Resource.Id.map, _mapFragment, "map"); fragTx.Commit(); } _mapFragment.GetMapAsync(this); }
private void Work_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { swipe.Refreshing = false; BoxActivity content = new BoxActivity(); FragmentTransaction transaction1 = this.FragmentManager.BeginTransaction(); transaction1.Replace(Resource.Id.frameDriverlayout, content); transaction1.Commit(); }
private void ShowlastFragment(ManageStockPostApiResponse res) { FragmentTransaction ft = FragmentManager.BeginTransaction(); MvxFragmentBase fragment = new FragmentManageStockComplete(); fragment.SetArgument(FragmentManageStockComplete.AllocatedProductResponseKey, res); ft.Replace(Resource.Id.main_content, fragment, ManageStockView.MainContentFragmentTag); ft.Commit(); }
/// <summary> /// Helper method to hide the map /// </summary> private void HideMap() { if (map != null) { FragmentTransaction tx = FragmentManager.BeginTransaction(); tx.Hide(map); tx.Commit(); } }
private void GoChangePassword(object sender, EventArgs e) { FragmentTransaction ft = FragmentManager.BeginTransaction(); ChangePasswordFragment changePasswordFragment = new ChangePasswordFragment(); ft.Replace(Resource.Id.content_frame, changePasswordFragment, "f4"); ft.AddToBackStack(null); ft.Commit(); }
private void LoadAndDisplayFile() { FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction(); DisplayTextFileFragment fragment = new DisplayTextFileFragment(directory); fragmentTransaction.Replace(Resource.Id.main_area, fragment); fragmentTransaction.AddToBackStack(null); fragmentTransaction.Commit(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment View view = inflater.Inflate(Resource.Layout.AddBet, null); EditText teamName = view.FindViewById <EditText>(Resource.Id.teamName); EditText firstBet = view.FindViewById <EditText>(Resource.Id.firstBet); EditText betType = view.FindViewById <EditText>(Resource.Id.betType); Button saveBet = view.FindViewById <Button>(Resource.Id.addBetBtn); firstBet.FixDigits(); saveBet.Click += delegate { if (teamName.Text != string.Empty && firstBet.Text != string.Empty && betType.Text != string.Empty) { Team t = new Team(); t.Name = teamName.Text; t.Bet = betType.Text; t.Id = Guid.NewGuid(); t.Status = false; t.Win = 0; t.BetProvider = ApplicationState.ActiveProvider; if (AWSDataAccess.InsertTeam(t) != Guid.Empty) { BetDetails betDetails = new BetDetails(); betDetails.Id = Guid.NewGuid(); betDetails.Quantity = Convert.ToDecimal(firstBet.Text); betDetails.Team_Id = t.Id; if (AWSDataAccess.InsertBetDetails(betDetails) != Guid.Empty) { Toast.MakeText(Activity, "Bet added", ToastLength.Long).Show(); FragmentTransaction ft = FragmentManager.BeginTransaction(); ft.Replace(Resource.Id.frameLayout1, new HomeFragment()); ft.Commit(); } else { Toast.MakeText(Activity, "Error in bet saving", ToastLength.Long).Show(); } } else { Toast.MakeText(Activity, "Error in bet saving", ToastLength.Long).Show(); } } }; return(view); //return base.OnCreateView(inflater, container, savedInstanceState); }
void OnClick(NavBarAdapterClickEventArgs args) { if (items[args.Position].fragment != null) { FragmentTransaction transaction = c.FragmentManager.BeginTransaction(); transaction.Replace(Resource.Id.fragmentContainer, FragmentHome.Get()); transaction.Commit(); c.Drawer.CloseDrawers(); } }
public void LaunchViewJournal(JournalEntry journal) { Logger.Log("LaunchViewJournal"); FragmentTransaction ft = Activity.SupportFragmentManager.BeginTransaction(); Fragment fragment = new ClientViewJournalView(journal); ft.Replace(Resource.Id.fragment_container, fragment); ft.AddToBackStack(null); ft.Commit(); }
public bool Previous() { FragmentTransaction ft = FragmentManager.BeginTransaction(); Fragment frag = new FragmentProductsInStock(); ft.Replace(Resource.Id.main_content, frag, ManageStockView.MainContentFragmentTag); ft.Commit(); return(true); }
public bool Next() { FragmentTransaction ft = FragmentManager.BeginTransaction(); var fragment = new FragmentSelectedUnits(); ft.Replace(Resource.Id.main_content, fragment, ManageStockView.MainContentFragmentTag); ft.Commit(); return(true); }
private void BLogin_Click(object sender, EventArgs e) { MyFragmentManager.activity.InitWebSocket(); MyFragmentManager.InitWebSocket(MyFragmentManager.activity.webSocket); FragmentTransaction transaction = FragmentManager.BeginTransaction(); transaction.Replace(Resource.Id.main_activity_fragment_placeholder, new FragmentRA()); transaction.Commit(); }
private void HandleImageToVoice(object sender, EventArgs e) { FragmentTransaction fragmentManager = this.FragmentManager.BeginTransaction(); DescribeImageWithVoiceFragment voice = new DescribeImageWithVoiceFragment(); fragmentManager.Replace(Resource.Id.parent_fragment, voice); fragmentManager.SetTransition(FragmentTransit.FragmentOpen); fragmentManager.AddToBackStack(null); fragmentManager.Commit(); }
private void HandleCheckSimilarity(object sender, EventArgs e) { FragmentTransaction fragmentManager = this.FragmentManager.BeginTransaction(); CheckSimilarityFragment checkSimilarityFragment = new CheckSimilarityFragment(); fragmentManager.Replace(Resource.Id.parent_fragment, checkSimilarityFragment); fragmentManager.SetTransition(FragmentTransit.FragmentOpen); fragmentManager.AddToBackStack(null); fragmentManager.Commit(); }
/** * Replaces the old fragment with the new one and adds the old to the backstack, *if bool addToBackStack is set to true **/ public void switchFragment(string oldFragmentTag, string newFragmentTag, Fragment newFragment, bool addToBackStack) { menu.Opened = false; activeFragment = newFragmentTag; trans = FragmentManager.BeginTransaction(); Fragment oldFragment = FragmentManager.FindFragmentByTag(oldFragmentTag); if(addToBackStack && oldFragment != null) trans.AddToBackStack(oldFragmentTag); if(oldFragment != null) trans.Remove(oldFragment); trans.Add(Resource.Id.fragmentContainer, newFragment, newFragmentTag); trans.Commit(); }
private async void SetupMapIfNeeded() { if (_map == null && !_gettingMap) { // TODO À quoi sert cette variable ? On peut supprimer je pense. // a priori SetupMapIfNeeded peut-être appelé pluiseurs fois d'affilé, c'est pour prévenir ça _gettingMap = true; GoogleMapOptions mapOptions = new GoogleMapOptions() .InvokeMapType(GoogleMap.MapTypeNormal) //.InvokeZoomControlsEnabled(true) //.InvokeMapToolbarEnabled(true) .InvokeCompassEnabled(true) .InvokeCamera(await GetStartingCameraPosition()); _fragTx = FragmentManager.BeginTransaction(); _mapFragment = MapFragmentExtended.NewInstance(mapOptions); _fragTx.Add(Resource.Id.map, _mapFragment, "map"); _fragTx.Commit(); _mapFragment.GetMapAsync(this); } }
private void SetView(int fragmentResource, Fragment view, bool retainView) { _DrawerToggle.SetClosedResource(_CurrentViewTitle); _FragmentManager = FragmentManager.BeginTransaction(); _FragmentManager.Replace(fragmentResource, view); // If true, allows the user to return to that fragment. // Otherwise it is destroyed. if(retainView) { _FragmentManager.AddToBackStack(null); } _FragmentManager.Commit(); _DrawerLayout.CloseDrawers(); }