Exemplo n.º 1
0
        private void LayoutDestination_Click(object sender, EventArgs e)
        {
            AutocompleteFilter filter = new AutocompleteFilter.Builder().SetCountry("US").Build();
            Intent             intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.ModeOverlay)
                                        .SetFilter(filter)
                                        .Build(this);

            StartActivityForResult(intent, 2);
        }
Exemplo n.º 2
0
        void LayoutPickUp_Click(object sender, System.EventArgs e)
        {
            AutocompleteFilter filter = new AutocompleteFilter.Builder()
                                        .SetCountry("NG")
                                        .Build();

            Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.ModeOverlay)
                            .SetFilter(filter)
                            .Build(this);

            StartActivityForResult(intent, 1);
        }
Exemplo n.º 3
0
        private void SetResources()
        {
            buscador = (PlaceAutocompleteFragment)FragmentManager.FindFragmentById(Resource.Id.buscador_google);
            buscador.SetOnPlaceSelectedListener(this);
            buscador.SetHint("Escribe la dirección...");
            AutocompleteFilter filtro = new AutocompleteFilter.Builder().SetTypeFilter(Place.TypeCountry).SetCountry("MX").Build();

            buscador.SetFilter(filtro);
            comentarios = FindViewById <TextView>(Resource.Id.mandado_comentarios);
            calle       = FindViewById <TextView>(Resource.Id.mandado_calle);
            numero      = FindViewById <TextView>(Resource.Id.mandado_numero);
            //Botón
            agregar_lugar        = FindViewById <Button>(Resource.Id.btn_agregar_lugar);
            agregar_lugar.Click += delegate
            {
                Agregar_lugar();
            };
            //Select
            int marcadores = GlobalValues.arr_lugares.Count;

            spinner_servicio = FindViewById <Spinner>(Resource.Id.mandado_servicio);
            populate_servicios();
        }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Window.RequestFeature(WindowFeatures.NoTitle); // Ce sera Masquer la barre de titre
            base.OnCreate(savedInstanceState);
            RequestedOrientation = ScreenOrientation.Portrait;
            SetContentView(Resource.Layout.activity_map);
            SetUpMap();
            var mGoogleApiClient = new Builder(this)
                                   .AddApi(PlacesClass.GEO_DATA_API)
                                   .AddApi(PlacesClass.PLACE_DETECTION_API)
                                   .EnableAutoManage(this, this)
                                   .Build();

            PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)base.FragmentManager.FindFragmentById(Resource.Id.place_autocomplete_fragment);

            autocompleteFragment.SetOnPlaceSelectedListener(this);


            AutocompleteFilter filter = new AutocompleteFilter.Builder()
                                        .SetTypeFilter(AutocompleteFilter.TypeFilterAddress)
                                        .Build();


            //search_txt = FindViewById<EditText>(Resource.Id.search_txt);
            //result_txt = FindViewById<TextView>(Resource.Id.result_txt);

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

            SetSupportActionBar(toolbar);

            SupportActionBar ab = SupportActionBar;

            ab.SetHomeAsUpIndicator(Resource.Mipmap.menu_but);
            ab.SetDisplayHomeAsUpEnabled(false);


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

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

            if (navigationView != null)
            {
                SetUpDrawerContent(navigationView);
            }

            menu_but        = FindViewById <Button>(Resource.Id.menu_but);
            menu_but.Click += (sender, e) =>
            {
                mDrawerLayout.OpenDrawer((int)GravityFlags.Left);
            };

            pick_location_but        = FindViewById <Button>(Resource.Id.pick_location_but);
            pick_location_but.Click += delegate
            {
                StartActivity(new Intent(Application.Context, typeof(PickActivity)));
                Finish();
            };

            //search_but = FindViewById<Button>(Resource.Id.search_but);
            //search_but.Click += delegate
            //{
            //    if (search_txt.Text.Length != 0)
            //    {
            //        result_txt.Text = search_txt.Text;
            //    }
            //};

            _isGooglePlayServicesInstalled = IsGooglePlayServicesInstalled();

            if (_isGooglePlayServicesInstalled)
            {
                // pass in the Context, ConnectionListener and ConnectionFailedListener
                apiClient = new Builder(this, this, this)
                            .AddApi(LocationServices.API).Build();

                // generate a location request that we will pass into a call for location updates
                locRequest = new LocationRequest();
            }
            else
            {
                Log.Error("OnCreate", "Google Play Services is not installed");
                Toast.MakeText(this, "Google Play Services is not installed", ToastLength.Long).Show();
                Finish();
            }
        }