Commit 14bc347
feat: Overhaul snippets app into a multi-activity demo (#955)
* 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: Upgrade Places SDK to 5.0.0
This commit upgrades the Places SDK for Android from version 4.4.1 to 5.0.0.
Key changes include:
- Updating all build.gradle.kts and libs.versions.toml files to use the new SDK version.
- Migrating from deprecated Place fields.
- Adopting centralized SDK versioning in libs.versions.toml for better consistency across modules.
* fix: fixed checksum
* fix: minSdk
* chore: modified .gitignore (#961)
* feat: replace enums
* chore: removed dependabot flow (#962)
* 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: Upgrade Places SDK to 5.0.0
This commit upgrades the Places SDK for Android from version 4.4.1 to 5.0.0.
Key changes include:
- Updating all build.gradle.kts and libs.versions.toml files to use the new SDK version.
- Migrating from deprecated Place fields.
- Adopting centralized SDK versioning in libs.versions.toml for better consistency across modules.
* fix: fixed checksum
* fix: minSdk
* feat: replace enums
* docs: Correct snippet region tags for autocomplete intent
* docs: Correct snippet tags in PlaceAutocompleteActivity
* docs: Fixes some missing region tags
Moved the "maps_places_place_details_simple" tag into executed code to ensure it works as expected.
Key changes:
- **Place Details**:
- The `PlaceDetailsActivity` (both Java and Kotlin) now requests the `Place.Field.LOCATION` field.
- The fetched `LatLng` coordinates are now displayed in the UI, providing a more complete example of the data available.
- **Place Autocomplete**:
- The `PlaceAutocompleteActivity` (both Java and Kotlin) now requests and displays the `FORMATTED_ADDRESS` of the selected place.
- The autocomplete intent example now filters for the `ESTABLISHMENT` type instead of `ADDRESS`.
- **Current Place**:
- The code in `CurrentPlaceActivity` (both Java and Kotlin) has been wrapped in `maps_places_current_place` snippet tags and annotated with comments to improve its utility as a documentation example.
---------
Co-authored-by: Enrique López-Mañas <eenriquelopez@gmail.com>1 parent 7464ebe commit 14bc347
File tree
55 files changed
+2087
-589
lines changed- PlaceDetailsUIKit/gradle
- demo-java
- app
- src/main/java/com/example/placesdemo
- gradle
- demo-kotlin
- app
- src/main
- java/com/example/placesdemo
- programmatic_autocomplete
- res
- layout
- values
- gradle
- snippets
- app
- src/main
- java/com/google/places
- data
- kotlin
- res
- layout
- values-v27
- values
- gradle
- wrapper
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
55 files changed
+2087
-589
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| |||
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
157 | | - | |
| 155 | + | |
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 159 | + | |
| 160 | + | |
165 | 161 | | |
166 | 162 | | |
167 | 163 | | |
| |||
251 | 247 | | |
252 | 248 | | |
253 | 249 | | |
254 | | - | |
| 250 | + | |
255 | 251 | | |
256 | 252 | | |
257 | 253 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | | - | |
126 | | - | |
| 124 | + | |
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
162 | | - | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| |||
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
237 | | - | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | | - | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
8 | | - | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
12 | | - | |
13 | | - | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
0 commit comments