Beispiel #1
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);
            // Capture the Map Fragment
            SupportMapFragment mapFragment = ChildFragmentManager.FindFragmentById(Resource.Id.gmap).JavaCast <SupportMapFragment>();

            if (mapFragment == null)
            {
                mapFragment = SupportMapFragment.NewInstance();
                mapFragment.GetMapAsync(this);
            }
            mapFragment.GetMapAsync(this);
        }
        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)
        {
            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 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);
        }
        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);
        }
Beispiel #6
0
        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);
        }
        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)
        {
            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();
        }
Beispiel #9
0
 private void SetUpMap()
 {
     if (myMap == null)
     {
         SupportMapFragment mapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map);
         mapFragment.GetMapAsync(this);
     }
 }
Beispiel #10
0
 private void SetupMapIfNeeded()
 {
     if (_mapFragment == null)
     {
         InitMapFragment();
     }
     _mapFragment?.GetMapAsync(this);
 }
Beispiel #11
0
        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);
     }
 }
Beispiel #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));
        }
Beispiel #14
0
        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);
        }
Beispiel #16
0
        /// <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);
        }
Beispiel #17
0
        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);
        }
        private void SetupMap()
        {
            if (_map != null)
            {
                return;
            }

            _mapFragment = FragmentManager.FindFragmentById(Resource.Id.map) as SupportMapFragment;
            _mapFragment.GetMapAsync(this);
        }
 public void SetMarkers(List <ServicePoint> points)
 {
     _servicePoints = points;
     RunOnUiThread(() =>
     {
         _spRecyclerView.Visibility   = ViewStates.Gone;
         _mapFragment.View.Visibility = ViewStates.Visible;
         _viewIcon.SetImageDrawable(ContextCompat.GetDrawable(ApplicationContext, Resource.Drawable.ic_list));
         _mapFragment?.GetMapAsync(this);
     });
 }
Beispiel #20
0
        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);
        }
Beispiel #21
0
        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);
        }
Beispiel #22
0
        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);
        }
Beispiel #23
0
        protected override void OnGotFocus()
        {
            base.OnGotFocus();

            // Late load map
            if (mapFragment == null)
            {
                mapFragment = ChildFragmentManager.FindFragmentById(Resource.Id.NearbyMapFragment_Map) as SupportMapFragment;
                mapFragment.GetMapAsync(this);
            }
        }
Beispiel #24
0
 /// <summary>
 /// Setup the map based on the build version used.
 /// </summary>
 private void mapSetup()
 {
     if (Int32.Parse(Build.VERSION.Sdk) <= 23) //if the android version is older
     {
         mf.GetMapAsync(this);                 //set the mapFragment
     }
     else
     {
         mView.GetMapAsync(this); //set the mapView
     }
 }
        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);
        }
Beispiel #26
0
        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();
        }
Beispiel #27
0
        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);
        }
Beispiel #28
0
        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);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.home, container, false);
            SupportMapFragment mapFragment = ChildFragmentManager.FindFragmentById(Resource.Id.map).JavaCast <SupportMapFragment>();

            mapFragment.GetMapAsync(new OnMapReady(map =>
            {
                mainMap = map;
            }));
            profileImg        = (_BaseCircleImageView)view.FindViewById(Resource.Id.home_iv);
            profileImg.Click += ProfileImg_Click;
            return(view);
        }
Beispiel #30
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            InitControls();
            MapFragment = (SupportMapFragment)SupportFragmentManager.FindFragmentById(Resource.Id.map);
            MapFragment.GetMapAsync(this);

            CheckLocationPermission();
            ResolveDependencies();
            await SetupLocationProvider();
        }