private void ShowHamburgerMenu() { var fr = SupportFragmentManager.FindFragmentById(Resource.Id.content_frame) as ContentFragment; if (fr?.DrawerToggle != null) { fr.DrawerToggle.DrawerIndicatorEnabled = true; } //Unlock the menu sliding gesture DrawerLayout.SetDrawerLockMode(DrawerLayout.LockModeUnlocked); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Create the list fragment and add it as our sole content. if (SupportFragmentManager.FindFragmentById(Android.Resource.Id.Content) == null) { var list = new ArrayListFragment(); SupportFragmentManager.BeginTransaction().Add(Android.Resource.Id.Content, list).Commit(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.basic_demo); var mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.FifthView); var viewModel = (FifthViewModel)ViewModel; var mapFragment = (MyMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.ViewModel = ViewModel; }
public override void OnBeforeFragmentChanging(IMvxCachedFragmentInfo fragmentInfo, Android.Support.V4.App.FragmentTransaction transaction) { var currentFrag = SupportFragmentManager.FindFragmentById(Resource.Id.content_frame) as MvxFragment; if (currentFrag != null && fragmentInfo.ViewModelType != typeof(MenuViewModel) && currentFrag.FindAssociatedViewModelType() != fragmentInfo.ViewModelType) { fragmentInfo.AddToBackStack = true; } base.OnBeforeFragmentChanging(fragmentInfo, transaction); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_events_demo); mSupportMapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mSupportMapFragment.GetMapAsync(this); mTapView = (TextView)FindViewById(Resource.Id.tap_text); mToPointView = (TextView)FindViewById(Resource.Id.toPoint); mToLatLngView = (TextView)FindViewById(Resource.Id.toLatlng); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.marker_demo); mTopText = (TextView)FindViewById(Resource.Id.top_text); var mapFragment = ((SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map)); mapFragment.GetMapAsync(this); }
public void ShowMenuItem(MvxFragment fragment) { var topFragment = SupportFragmentManager.FindFragmentById(Resource.Id.content_frame); if (topFragment != null && topFragment.GetType().Equals(fragment.GetType())) { return; } SupportFragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit(); }
void SetUpMapIfNeeded() { if (mMap == null) { mMap = SupportFragmentManager.FindFragmentById(Resource.Id.map).JavaCast <SupportMapFragment> ().Map; if (mMap != null) { SetUpMap(); } } }
/// <summary> /// Close Fragment with a specific tag at a specific placeholder /// </summary> /// <param name="tag">The tag for the fragment to lookup</param> /// <param name="contentId">Where you want to close the Fragment</param> protected virtual void CloseFragment(string tag, int contentId) { var frag = SupportFragmentManager.FindFragmentById(contentId); if (frag == null) { return; } SupportFragmentManager.PopBackStackImmediate(tag, 1); }
protected override void OnResume() { base.OnResume(); AsyncUIOperationRepeater.INSTATNCE.RegisterAsyncTaskActivity(this); if (SupportFragmentManager.FindFragmentById(Resource.Id.frgForm) == null && DataCache.INSTATNCE.ServiceCountryList != null) { InitActivity(); } AsyncUIOperationRepeater.INSTATNCE.ExecutePendingUIOperation(this); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.View_Map); MapViewModel viewModel = (MapViewModel)ViewModel; SupportMapFragment fragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); fragment.GetMapAsync(this); }
void RemoveAttachToolBoxFragment() { var f = SupportFragmentManager.FindFragmentById(Resource.Id.attachToolbox); if (f != null) { SupportFragmentManager.BeginTransaction() .Remove(f) .Commit(); } }
private void ClosePopup() { _transparentPopupView.Visibility = ViewStates.Gone; var viewFragment = SupportFragmentManager.FindFragmentById(Resource.Id.PopupRegion) as MvxFragment; if (viewFragment != null) { CloseFragment(viewFragment); } }
private void RemoveFragmentIfShowing(FragmentTransaction ft, int contentId) { var frag = SupportFragmentManager.FindFragmentById(contentId); if (frag == null) { return; } ft.Detach(frag); _currentFragments.Remove(contentId); }
private void PagerFragmentUserChanged(object sender, User user) { var fragmentToRefresh = SupportFragmentManager.FindFragmentById(Resource.Id.mainFrameLayout); if (fragmentToRefresh is PagerFragment) { var pagerFragment = new PagerFragment(DAO); v4FragmentTransaction fragmentTransaction = SupportFragmentManager.BeginTransaction(); fragmentTransaction.Replace(Resource.Id.mainFrameLayout, pagerFragment); fragmentTransaction.Commit(); } }
/// <summary> /// Method callback when user selects a lamp color. Returned to main activity from which is called, then send to requesting fragment /// /// </summary> /// <param name="dialogId">Color Dialog ID</param> /// <param name="color">Selected color by user.</param> public void OnColorSelected(int dialogId, Color color) { // Get shown fragment instance from support fragment manager Android.Support.V4.App.Fragment currentFragment = SupportFragmentManager.FindFragmentById(Resource.Id.frame_layout_settings); // Check if the current displayed fragment is of type light settings. if (currentFragment is LightSettingsFragment && currentFragment.IsVisible) { // Send & update selected color. ((LightSettingsFragment)currentFragment).UpdateSelectedColor(color); } }
public override void OnBackPressed() { var currentFragment = SupportFragmentManager.FindFragmentById(Resource.Id.content_frame); var listener = currentFragment as IBackButtonListener; if (listener != null) { listener.OnBackPressed(); return; } base.OnBackPressed(); }
protected override void OnCreate(Bundle savedInstanceState) { Log.Debug(TAG, "OnCreate: "); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_gestures_demo); mSupportMapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.mapInGestures); mSupportMapFragment.GetMapAsync(this); mMyLocationButtonCheckbox = (CheckBox)FindViewById(Resource.Id.isShowMylocationButton); mMyLocationLayerCheckbox = (CheckBox)FindViewById(Resource.Id.isMyLocationLayerEnabled); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.LocationPickLayout); var supportMapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.userHomeLocationPickMapView); supportMapFragment.OnCreate(savedInstanceState); supportMapFragment.GetMapAsync(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.basic_demo); SupportMapFragment mapFragment = (SupportMapFragment)SupportFragmentManager .FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); addLatLong(); // addRedCarLatLong(); SecondCar(); }
protected void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.snapshot_demo); waitForMapLoadCheckBox = FindViewById <CheckBox> (Resource.Id.wait_for_map_load); var mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set the layout SetContentView(Resource.Layout.lite_demo); // Get the map and register for the ready callback var mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); }
public void OnMapReady(GoogleMap googleMap) { map = googleMap; addMarkers(); addPolyobjects(); var mapView = SupportFragmentManager.FindFragmentById(Resource.Id.map).View; if (mapView.ViewTreeObserver.IsAlive) { mapView.ViewTreeObserver.GlobalLayout += MapView_ViewTreeObserver_GlobalLayout; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.events_demo); tapTextView = FindViewById <TextView> (Resource.Id.tap_text); cameraTextView = FindViewById <TextView> (Resource.Id.camera_text); var mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); RequestPermissions(permissionGroup, 0); SupportMapFragment mapFragment = (SupportMapFragment)SupportFragmentManager .FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); }
private async void ShowMap() { var request = new GeolocationRequest(GeolocationAccuracy.Medium); var gps_location = await Geolocation.GetLocationAsync(request); location.currentLocation = new Android.Locations.Location(LocationService) { Latitude = gps_location.Latitude, Longitude = gps_location.Longitude }; var mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.fragment1); mapFragment.GetMapAsync(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Title = "SGV"; // Create the list fragment and add it as our sole content. if (SupportFragmentManager.FindFragmentById(Android.Resource.Id.Content) == null) { StaggeredGridFragment fragment = new StaggeredGridFragment(this); SupportFragmentManager.BeginTransaction().Add(Android.Resource.Id.Content, fragment).Commit(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_locationsource_demo); pressLocationSource = new PressLocationSource(ApplicationContext); SupportMapFragment mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.mapForLocationDemo); mapFragment.GetMapAsync(this); }
private MvxFragment GetActiveFragmentForViewModel(IMvxViewModel viewModel) { foreach (int regionId in _validRegionIds) { MvxFragment fragment = SupportFragmentManager.FindFragmentById(regionId) as MvxFragment; if (fragment != null && fragment.ViewModel == viewModel) { return(fragment); } } return(null); }