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.home, container, false); SupportMapFragment mapFragment = (SupportMapFragment)ChildFragmentManager.FindFragmentById(Resource.Id.map); centerMarker = (ImageView)view.FindViewById(Resource.Id.centerMarker); mapFragment.GetMapAsync(this); // reference the accept ride views cancelTripButton = (ImageButton)view.FindViewById(Resource.Id.cancelTripButton); callRiderButton = (ImageButton)view.FindViewById(Resource.Id.callRiderButton); navigateButton = (ImageButton)view.FindViewById(Resource.Id.navigateButton); tripButton = (Button)view.FindViewById(Resource.Id.tripButton); riderNameText = (TextView)view.FindViewById(Resource.Id.riderNameText); rideInfoLayout = (LinearLayout)view.FindViewById(Resource.Id.rideInfoLayout); tripButton.Click += TripButton_Click; callRiderButton.Click += CallRiderButton_Click; navigateButton.Click += NavigateButton_Click; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { Window.RequestFeature(WindowFeatures.NoTitle); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.DropLocationLayout); _mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); _mapFragment.GetMapAsync(this); FindViewById(Resource.Id.ActionConfirm).Click += delegate { Intent myIntent = new Intent(this, typeof(DropItemActivity)); myIntent.PutExtra("Latitude", _currentLocation.Latitude); myIntent.PutExtra("Longitude", _currentLocation.Longitude); SetResult(Result.Ok, myIntent); //Finish(); base.OnBackPressed(); OverridePendingTransition(Resource.Animation.fromRight, Resource.Animation.toLeft); }; FindViewById(Resource.Id.ActionBack).Click += delegate { base.OnBackPressed(); OverridePendingTransition(Resource.Animation.fromRight, Resource.Animation.toLeft); }; }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); mapFrag = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map); mapFrag.getMapAsync(this); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Create your application here var mapFragment = new SupportMapFragment(); var fragmentTx = this.SupportFragmentManager.BeginTransaction(); fragmentTx.Add(Resource.Id.mapaFrag, mapFragment); fragmentTx.Commit(); SetContentView(Resource.Layout.Detail); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); string DOUBLE_BYTE_SPACE = "\u3000"; AutoResizeTextView textView = (AutoResizeTextView)this.FindViewById(Resource.Id.txtL); String fixString = ""; /*if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR1 * && android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { * fixString = DOUBLE_BYTE_SPACE; * }*/ fixString = DOUBLE_BYTE_SPACE; textView.Text = fixString + "MEME SAN JUAN" + fixString; }
public void IniciarFragmentoMapa(int frame) { try { //Se obtiene el fragmento del mapa fragmentoMapa = SupportFragmentManager.FindFragmentByTag("map") as SupportMapFragment; //Si es null se va a crear if (fragmentoMapa == null) { //Se agregan las opciones del mapa GoogleMapOptions mapOptions = new GoogleMapOptions() .InvokeMapType(GoogleMap.MapTypeSatellite) .InvokeZoomControlsEnabled(true) .InvokeCompassEnabled(true); //Se crea la instancia del mapa, se agregan las opciones y se carga en el frame Android.Support.V4.App.FragmentTransaction transaccion = SupportFragmentManager.BeginTransaction(); fragmentoMapa = SupportMapFragment.NewInstance(mapOptions); transaccion.Add(frame, fragmentoMapa, "map"); transaccion.Commit(); } } catch (Exception ex) { //Se guarda el detalle del error Logs.saveLogError("MainActivity.IniciarFragmentoMapa " + ex.Message + " " + ex.StackTrace); } }
protected override void OnCreate(Bundle bundle) { OverridePendingTransition(Resource.Animation.slide_in_right, Resource.Animation.slide_out_left); base.OnCreate(bundle); SetContentView(Resource.Layout.InitialMapView); Crittercism.Initialize(this, "55fcbf43d224ac0a00ed3d83"); sharedPreferences = GetSharedPreferences(mSharedPreferences, FileCreationMode.Private); string LanguageValue = string.Empty; LanguageValue = GetPreference <string>(AppConstants.Language); Mvx.Resolve <IMvxTextProviderBuilder>().LoadResources(LanguageValue); SupportMapFragment mapViewFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.mapView); mapViewFragment.GetMapAsync(this); // Create your application here var set = this.CreateBindingSet <InitialMapView, InitialMapViewModel>(); set.Bind().For(s => s.Parkings).To(vm => vm.Parkings); set.Apply(); SetButtonEffects(new List <int>() { Resource.Id.tvGoToSigin }); //get preferences //Mvx.Resolve<IMvxTextProviderBuilder>().LoadResources(string.Empty); //Mvx.Resolve<IMvxTextProviderBuilder>().LoadResources(value); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment view = inflater.Inflate(Resource.Layout.MainMapFragment, container, false); _mapViewModel = Stops.Setup.IoC.Container.Get <Core.ViewModels.MapViewModel> (); /* * Create the map */ _supportMapFragment = new SupportMapFragment(); Android.Support.V4.App.FragmentTransaction transaction = FragmentManager.BeginTransaction(); transaction.Add(Resource.Id.mainMapFragmentMapWrapper, _supportMapFragment); transaction.SetTransition(Android.Support.V4.App.FragmentTransaction.TransitFragmentFade); transaction.Commit(); //TODO vto = view.ViewTreeObserver; vto.GlobalLayout += GlobalLayoutHandler; _supportMapFragment.GetMapAsync(this); _mainMapFragmentButtonSearch = (Button)view.FindViewById(Resource.Id.mainMapFragmentButtonSearch); _mainMapFragmentButtonFab = view.FindViewById <Clans.Fab.FloatingActionMenu>(Resource.Id.mainMapFragmentButtonFab); _mainMapFragmentButtonSearch.Click += (sender, e) => { MapBridge.Instance.Trigger("SearchButtonClicked"); }; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); /** * 使用地图sdk前需先初始化BMapManager. * BMapManager是全局的,可为多个MapView共用,它需要地图模块创建前创建, * 并在地图地图模块销毁后销毁,只要还有地图模块在使用,BMapManager就不应该销毁 */ DemoApplication app = (DemoApplication)this.Application; if (app.mBMapManager == null) { app.mBMapManager = new BMapManager(ApplicationContext); /** * 如果BMapManager没有初始化则初始化BMapManager */ app.mBMapManager.Init(new DemoApplication.MyGeneralListener()); } Log.Debug(LTAG, "OnCreate"); SetContentView(Resource.Layout.activity_fragment); map = SupportMapFragment.NewInstance(); FragmentManager manager = SupportFragmentManager; manager.BeginTransaction().Add(Resource.Id.map, map, "map_fragment").Commit(); }
public override void OnDestroyView() { base.OnDestroyView(); // Clean markers foreach (Marker marker in transportMarkers.Values) { Activity.RunOnUiThread(marker.Remove); } transportMarkers.Clear(); markerSteps.Clear(); // Stop and clean animators foreach (ValueAnimator valueAnimator in markerAnimators.Values) { Activity.RunOnUiThread(valueAnimator.Pause); } markerAnimators.Clear(); // Dispose map googleMap.Clear(); googleMap.Dispose(); mapFragment.Dispose(); mapFragment = null; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); if ((int)Build.VERSION.SdkInt >= 21) { Window.SetStatusBarColor(new Color(ContextCompat.GetColor(this, Resource.Color.primary_dark))); Window.DecorView.SystemUiVisibility = StatusBarVisibility.Visible; } viewModel = new PastTripsDetailViewModel { Title = id = Intent.GetStringExtra("Id") }; viewModel.Trip = Trip; seekBar = FindViewById <SeekBar>(Resource.Id.trip_progress); seekBar.Enabled = false; startTime = FindViewById <TextView>(Resource.Id.text_start_time); endTime = FindViewById <TextView>(Resource.Id.text_end_time); startTime.Text = endTime.Text = string.Empty; time = FindViewById <TextView>(Resource.Id.text_time); distance = FindViewById <TextView>(Resource.Id.text_distance); distanceUnits = FindViewById <TextView>(Resource.Id.text_distance_units); consumption = FindViewById <TextView>(Resource.Id.text_consumption); consumptionUnits = FindViewById <TextView>(Resource.Id.text_consumption_units); speed = FindViewById <TextView>(Resource.Id.text_speed); speedUnits = FindViewById <TextView>(Resource.Id.text_speed_units); mapFrag = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFrag.GetMapAsync(this); }
private void DisposeItems() { _content?.Dispose(); _content = null; _close?.Dispose(); _close = null; _resultsView?.Dispose(); _resultsView = null; _resultsTxv?.Dispose(); _resultsTxv = null; _orderId?.Dispose(); _orderId = null; _checkBtn?.Dispose(); _checkBtn = null; _presenter = null; _servicePoints = null; _spRecyclerView?.Dispose(); _spRecyclerView = null; _mapFragment?.Dispose(); _mapFragment = null; _viewIcon?.SetImageDrawable(null); _viewIcon.Dispose(); _animationView?.Dispose(); _receiver?.Dispose(); _receiver = null; _connection?.Dispose(); _connection = null; }
public void Init() { if (isCreated) { return; } isCreated = true; _supportMapFragment = new SupportMapFragment(); //Android.Support.V4.App.Fragment Android.Support.V4.App.FragmentTransaction transaction = FragmentManager.BeginTransaction(); /* * When this container fragment is created, we fill it with our first * "real" fragment */ //_mapFragmentRoot.Alpha = 0.01f; transaction.Add(Resource.Id.mapFragmentMapCointatiner, _supportMapFragment); transaction.SetTransition(Android.Support.V4.App.FragmentTransaction.TransitFragmentFade); transaction.Commit(); _supportMapFragment.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); if (!PlacesApi.IsInitialized) { string key = Resources.GetString(Resource.String.mapkey); PlacesApi.Initialize(this, key); } startTripButton = (Button)FindViewById(Resource.Id.startTripButton); placeLayout = (RelativeLayout)FindViewById(Resource.Id.placeLayout); centerMarker = (ImageView)FindViewById(Resource.Id.centerMarker); placeTextView = (TextView)FindViewById(Resource.Id.placeTextView); getDirectionButton = (Button)FindViewById(Resource.Id.getDirectionsButton); locationButton = (ImageButton)FindViewById(Resource.Id.locationButton); locationButton.Click += LocationButton_Click; getDirectionButton.Click += GetDirectionButton_Click; startTripButton.Click += StartTripButton_Click; placeLayout.Click += PlaceLayout_Click; CreateLocationRequest(); }
private void SetUpMap() { if (myMap == null) { SupportMapFragment mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); } }
private async void InitComponent() { try { MapIcon = FindViewById <TextView>(Resource.Id.map_icon); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, MapIcon, IonIconsFonts.AndroidLocate); ListIcon = FindViewById <TextView>(Resource.Id.list_icon); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, ListIcon, IonIconsFonts.AndroidList); MapButton = FindViewById <LinearLayout>(Resource.Id.map_button); ListButton = FindViewById <LinearLayout>(Resource.Id.list_button); SearchView = FindViewById <SearchView>(Resource.Id.searchView); SearchView.SetQuery("", false); SearchView.SetIconifiedByDefault(false); SearchView.OnActionViewExpanded(); SearchView.Iconified = false; SearchView.ClearFocus(); //Change text colors var editText = (EditText)SearchView.FindViewById(Resource.Id.search_src_text); editText.SetHintTextColor(Color.White); editText.SetTextColor(Color.White); editText.Hint = GetText(Resource.String.Lbl_SearchForPlace); //Change Color Icon Search ImageView searchViewIcon = (ImageView)SearchView.FindViewById(Resource.Id.search_mag_icon); searchViewIcon.SetColorFilter(Color.White); BtnSelect = FindViewById <FloatingActionButton>(Resource.Id.add_button); MAdapter = new PlacesAdapter(this); MAdapter.ItemClick += MAdapterOnItemClick; var mapFrag = SupportMapFragment.NewInstance(); SupportFragmentManager.BeginTransaction().Add(Resource.Id.map, mapFrag, mapFrag.Tag).Commit(); mapFrag.GetMapAsync(this); if (!string.IsNullOrEmpty(UserDetails.Lat) || !string.IsNullOrEmpty(UserDetails.Lng)) { Lat = Convert.ToDouble(UserDetails.Lat); Lng = Convert.ToDouble(UserDetails.Lng); OnLocationChanged(); } else { await GetPosition(); } } catch (Exception e) { Console.WriteLine(e); } }
protected override void OnCreate(Bundle savedInstanceState) { Log.Debug(TAG, "OnCreate: "); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_supportmapfragment_demo); mSupportMapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.supportMap); mSupportMapFragment.GetMapAsync(this); }
private void SetUpMap() { if (gmap == null) { // Activity. FragmentManager.FindFragmentById<MapFragment>(Resource.Id.map).GetMapAsync(this); mFragment = (SupportMapFragment)ChildFragmentManager.FindFragmentById(Resource.Id.map); mFragment.GetMapAsync(this); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.MapWithOverlayLayout); mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.LocationActivity); mMapViewFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mMapViewFragment.GetMapAsync(this); }
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)); }
/// <summary> /// Ons the create view. /// </summary> /// <returns>The create view.</returns> /// <param name="inflater">Inflater.</param> /// <param name="container">Container.</param> /// <param name="savedInstanceState">Saved instance state.</param> public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { scale = Context.Resources.DisplayMetrics.Density; int pixels = 0; if (v == null) { v = (ViewGroup)inflater.Inflate(Resource.Layout.sucursales_fragment, container, false); } cordinatorSucursales = v.FindViewById <CoordinatorLayout>(Resource.Id.cordinatorSucursales); btnLogout = v.FindViewById <ImageButton>(Resource.Id.btnLogout); btnVolver = v.FindViewById <ImageView>(Resource.Id.btnVolver); linearLayoutBtnIrAMapasDeTienda = v.FindViewById <LinearLayout>(Resource.Id.linearLayoutBtnIrAMapasDeTienda); lblNombreActivity = v.FindViewById <TextView>(Resource.Id.lblNombreActivity); btnVolver.Visibility = ViewStates.Invisible; btnLogout.Visibility = ViewStates.Invisible; linearLayoutBtnIrAMapasDeTienda.Visibility = ViewStates.Invisible; lblNombreActivity.Text = "¿En qué tienda estás?"; sheet_suc = v.FindViewById <LinearLayout>(Resource.Id.linear_sheet_sucursales); linear_mapa = v.FindViewById <LinearLayout>(Resource.Id.linear_mapa); listaVacia = v.FindViewById <LinearLayout>(Resource.Id.sucursal_lista_vacia); CoordinatorLayout.LayoutParams linearLayoutParams = new CoordinatorLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent); if (isVertical) { pixels = (int)(360 * scale + 0.5f); bottomSheetBehavior_suc = BottomSheetBehavior.From(sheet_suc); bottomSheetBehavior_suc.PeekHeight = pixels; } else { ViewGroup.LayoutParams parameters = (ViewGroup.LayoutParams)sheet_suc.LayoutParameters; parameters.Width = 500; parameters.Height = 660; if (parameters is ViewGroup.MarginLayoutParams) { ((ViewGroup.MarginLayoutParams)parameters).LeftMargin = 780; } sheet_suc.LayoutParameters = parameters; pixels = (int)(0 * scale + 0.5f); } linearLayoutParams.SetMargins(0, 0, 0, pixels); linear_mapa.LayoutParameters = linearLayoutParams; recycler = v.FindViewById <RecyclerView>(Resource.Id.mi_recycler_view_sucursales); adapter = new AdapterSucursal(DataManager.Sucursales, this); adapter.itemClick += OnItemClick; recycler.SetAdapter(adapter); layoutManager = new LinearLayoutManager(Activity); recycler.SetLayoutManager(layoutManager); mf = (SupportMapFragment)ChildFragmentManager.FindFragmentById(Resource.Id.map_sucursales); mf.GetMapAsync(this); ThreadPool.QueueUserWorkItem(o => cargaServicios()); RetainInstance = true; return(v); }
private void SetupMap() { if (_map != null) { return; } _mapFragment = FragmentManager.FindFragmentById(Resource.Id.map) as SupportMapFragment; _mapFragment.GetMapAsync(this); }
void CreateMap() { _myMapFrag = SupportMapFragment.NewInstance(); //FragmentTransaction tx = FragmentManager.BeginTransaction(); var tx = ChildFragmentManager.BeginTransaction(); tx.Add(Resource.Id.frameMap, _myMapFrag); tx.Commit(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); SupportMapFragment mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); mapFragment.GetMapAsync(this); }
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.home, container, false); SupportMapFragment MapFragment = (SupportMapFragment)ChildFragmentManager.FindFragmentById(Resource.Id.map); MapFragment.GetMapAsync(this); InitializeLocationManager(); return(view); }
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 bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.View_Map); MapViewModel viewModel = (MapViewModel)ViewModel; SupportMapFragment fragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map); fragment.GetMapAsync(this); }
protected override void OnGotFocus() { base.OnGotFocus(); // Late load map if (mapFragment == null) { mapFragment = ChildFragmentManager.FindFragmentById(Resource.Id.NearbyMapFragment_Map) as SupportMapFragment; mapFragment.GetMapAsync(this); } }
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); SetContentView(Resource.Layout.activity_fragment); MapStatus ms = new MapStatus.Builder().Overlook(-20).Zoom(15).Build(); BaiduMapOptions bo = new BaiduMapOptions().MapStatus(ms) .CompassEnabled(false).ZoomControlsEnabled(false); map = SupportMapFragment.NewInstance(bo); FragmentManager manager = SupportFragmentManager; manager.BeginTransaction().Add(Resource.Id.map, map, "map_fragment").Commit(); }
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(); }
/// <summary> /// All we do here is add a SupportMapFragment to the Activity. /// </summary> private void InitMap() { var mapOptions = new GoogleMapOptions() .InvokeMapType(GoogleMap.MapTypeSatellite) .InvokeZoomControlsEnabled(false) .InvokeCompassEnabled(true); var fragTx = SupportFragmentManager.BeginTransaction(); var mapFragment = SupportMapFragment.NewInstance(mapOptions); fragTx.Add(Resource.Id.mapWithOverlay, mapFragment, "map"); fragTx.Commit(); }