You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Overhaul snippets app into a multi-activity demo
This commit transforms the snippets project from a single-activity example into a comprehensive, multi-activity demonstration app. It now serves as a catalog of Places SDK features, with separate, self-contained examples for both Java and Kotlin.
Key changes:
- **New App Structure**:
- `KotlinMainActivity` is the new launcher, presenting a `RecyclerView` of available demos. A parallel `JavaMainActivity` is also included.
- A `MainApplication` class now handles the centralized initialization of the Places SDK.
- The app now supports an edge-to-edge display theme.
- **New Demo Activities**:
- **Current Place**: Finds and displays a list of likely places near the user's current location, handling permission requests.
- **Place Autocomplete**: Demonstrates the `AutocompleteSupportFragment`, the autocomplete intent, and programmatic predictions, with a toggle for location bias vs. restriction.
- **Place Details**: Fetches and displays basic details for a specific Place ID.
- **Place Photos**: Fetches and displays a photo and its attributions for a place.
- **Places Icon**: Shows how to retrieve and display a place's icon mask and background color.
- **Is Open**: Checks if a place is open, using both a `Place` object and a Place ID.
- **UI and Layouts**:
- Added dedicated XML layouts for each new activity and for `RecyclerView` list items.
- Implemented standard UI patterns with `MaterialToolbar`, `RecyclerView`, and `ConstraintLayout`.
- **Build & Dependency Updates**:
- Upgraded Gradle to version 9.1.0.
- Updated various AndroidX and Material Design library versions.
- Added `core-ktx` dependency.
* feat: updated places to 5.0.0
* feat: added PlaceDetailsCompose
* feat: added PlaceDetailsUIKit
* feat: added PlacesUIKit3D
* feat: snippets
* feat: updated CurrentPlace, PlaceDetails
* feat: header
* feat: place autocomplete
* fix: removed duplicated
---------
Co-authored-by: dkhawk <107309+dkhawk@users.noreply.github.com>
val status =Autocomplete.getStatusFromIntent(intent)
150
-
binding.response.text = status.statusMessage
148
+
PlaceAutocompleteActivity.RESULT_ERROR-> {
149
+
val status =PlaceAutocomplete.getResultStatusFromIntent(intent)
150
+
binding.response.text = status?.statusMessage
151
151
}
152
152
RESULT_CANCELED-> {
153
153
// The user canceled the operation.
@@ -156,9 +156,8 @@ class PlaceAutocompleteActivity : BaseActivity() {
156
156
}
157
157
158
158
privatefunstartAutocompleteActivity() {
159
-
val autocompleteIntent =Autocomplete.IntentBuilder(mode, placeFields)
159
+
val autocompleteIntent =PlaceAutocomplete.IntentBuilder()
160
160
.setInitialQuery(query)
161
-
.setHint(hint)
162
161
.setCountries(countries)
163
162
.setLocationBias(locationBias)
164
163
.setLocationRestriction(locationRestriction)
@@ -269,6 +268,7 @@ class PlaceAutocompleteActivity : BaseActivity() {
269
268
else emptyList()
270
269
}
271
270
271
+
// This Enum is deprecated, but there is no replacement. See https://developers.google.com/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/widget/model/AutocompleteActivityMode
0 commit comments