Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add samples for release 3.1.0 #519

Merged
merged 16 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demo-java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ dependencies {
implementation "com.android.databinding:viewbinding:7.3.1"

// Places and Maps SDKs
implementation 'com.google.android.libraries.places:places:3.0.0'
implementation 'com.google.android.libraries.places:places:3.1.0'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.maps.android:android-maps-utils:2.4.0'
}

secrets {
// To add your Google Maps Platform API key to this project:
// 1. Create or open file local.properties in this folder, which will be ready by default
// 1. Create or open file local.properties in this folder, which will be read by default
// by secrets_gradle_plugin
// 2. Add this line, replacing YOUR_API_KEY with a key from a project with Places API enabled:
// PLACES_API_KEY=YOUR_API_KEY
Expand Down
1 change: 1 addition & 0 deletions demo-java/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
android:name=".AutocompleteAddressActivity"
android:windowSoftInputMode="stateHidden" />
<activity android:name=".PlaceDetailsAndPhotosActivity" />
<activity android:name=".PlaceIsOpenActivity"/>
<activity android:name=".CurrentPlaceActivity" />
<activity
android:name=".programmatic_autocomplete.ProgrammaticAutocompleteToolbarActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private void startAutocompleteIntent() {

// Build the autocomplete intent with field, country, and type filters applied
Intent intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.OVERLAY, fields)
.setCountry("US")
.setCountries(Arrays.asList("US"))
.setTypesFilter(new ArrayList<String>() {{
add(TypeFilter.ADDRESS.toString().toLowerCase());
}})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,25 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
List<Field> placeFields = FieldSelector.allExcept(
Field.ADDRESS_COMPONENTS,
Field.CURBSIDE_PICKUP,
Field.CURRENT_OPENING_HOURS,
Field.DELIVERY,
Field.DINE_IN,
Field.OPENING_HOURS,
Field.PHONE_NUMBER,
Field.RESERVABLE,
Field.SECONDARY_OPENING_HOURS,
Field.SERVES_BEER,
Field.SERVES_BREAKFAST,
Field.SERVES_BRUNCH,
Field.SERVES_DINNER,
Field.SERVES_LUNCH,
Field.SERVES_VEGETARIAN_FOOD,
Field.SERVES_WINE,
Field.UTC_OFFSET,
Field.TAKEOUT,
Field.WEBSITE_URI);
Field.WEBSITE_URI,
Field.WHEELCHAIR_ACCESSIBLE_ENTRANCE
);
fieldSelector = new FieldSelector(
binding.useCustomFields,
binding.customFieldsList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

package com.example.placesdemo;

import com.example.placesdemo.programmatic_autocomplete.ProgrammaticAutocompleteToolbarActivity;
import com.google.android.libraries.places.api.Places;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.placesdemo.programmatic_autocomplete.ProgrammaticAutocompleteToolbarActivity;
import com.google.android.libraries.places.api.Places;

public class MainActivity extends AppCompatActivity {

@Override
Expand All @@ -47,8 +47,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

setLaunchActivityClickListener(R.id.autocomplete_button, PlaceAutocompleteActivity.class);
setLaunchActivityClickListener(R.id.autocomplete_address_button, AutocompleteAddressActivity.class);
setLaunchActivityClickListener(R.id.programmatic_autocomplete_button, ProgrammaticAutocompleteToolbarActivity.class);
setLaunchActivityClickListener(R.id.programmatic_autocomplete_button, ProgrammaticAutocompleteToolbarActivity.class
);
setLaunchActivityClickListener(R.id.place_and_photo_button, PlaceDetailsAndPhotosActivity.class);
setLaunchActivityClickListener(R.id.is_open_button, PlaceIsOpenActivity.class);
setLaunchActivityClickListener(R.id.current_place_button, CurrentPlaceActivity.class);
}

Expand Down
Loading