Commit e5b437c
Feature/purchase thank you message (#24)
* feat: Display thank you message on purchase
I modified MainScreen (MenuScreen.kt) to display a "Thank you" message
when the app has been purchased.
Changes:
- Added `isPurchased` parameter to `MenuScreen`.
- `MainActivity` now passes the purchase status (`currentTrialState == TrialManager.TrialState.PURCHASED`) to `MenuScreen`.
- In `MenuScreen`, if `isPurchased` is true, the donation button and related text are replaced with "Thank you for supporting the development! 🎉💛".
- Added a new preview for the purchased state in `MenuScreen.kt`.
* System message dynamic height (#23)
* feat: Adjust system message height and back button behavior
Implements dynamic height changes for the system message text field in the PhotoReasoningScreen based on focus and keyboard visibility:
- Focused + Keyboard open: 600dp
- Focused + Keyboard closed: 1000dp
- Not focused: 120dp
Additionally, modifies back button behavior:
- If the system message field is focused with the keyboard closed (1000dp height), the first back press deselects the field, changing its height to 120dp.
- Subsequent back presses perform the default navigation.
Keyboard visibility is detected in MainActivity and propagated to the PhotoReasoningScreen.
* fix: Add missing import for onFocusChanged
Adds the import `androidx.compose.ui.focus.onFocusChanged` to `PhotoReasoningScreen.kt` to resolve a build compilation error.
* fix: Correct system message TextField behavior
Addresses your feedback on the system message TextField in PhotoReasoningScreen:
- Sets focused height with keyboard to 450dp (was 600dp).
- Dynamically adjusts minLines and maxLines of the OutlinedTextField to ensure the text input area expands with the component's height.
- Modifies the BackHandler to explicitly clear focus from the TextField (in addition to collapsing it) when it's focused without the keyboard and back is pressed. This ensures it can be re-expanded correctly on subsequent focus.
These changes improve the usability and appearance of the system message input field.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent c687483 commit e5b437c
File tree
3 files changed
+94
-21
lines changed- app/src/main/kotlin/com/google/ai/sample
- feature/multimodal
3 files changed
+94
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
73 | 81 | | |
74 | 82 | | |
75 | 83 | | |
| |||
286 | 294 | | |
287 | 295 | | |
288 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
289 | 317 | | |
290 | 318 | | |
291 | 319 | | |
| |||
400 | 428 | | |
401 | 429 | | |
402 | 430 | | |
403 | | - | |
| 431 | + | |
| 432 | + | |
404 | 433 | | |
405 | 434 | | |
406 | 435 | | |
| |||
751 | 780 | | |
752 | 781 | | |
753 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
754 | 788 | | |
755 | 789 | | |
756 | 790 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
222 | 233 | | |
223 | 234 | | |
224 | 235 | | |
| |||
268 | 279 | | |
269 | 280 | | |
270 | 281 | | |
271 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
272 | 289 | | |
273 | 290 | | |
274 | 291 | | |
275 | 292 | | |
276 | 293 | | |
277 | 294 | | |
278 | | - | |
| 295 | + | |
279 | 296 | | |
280 | 297 | | |
Lines changed: 29 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
171 | | - | |
| 175 | + | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
| |||
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
186 | | - | |
| 191 | + | |
| 192 | + | |
187 | 193 | | |
188 | 194 | | |
189 | 195 | | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
192 | 205 | | |
193 | 206 | | |
194 | 207 | | |
| |||
223 | 236 | | |
224 | 237 | | |
225 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
226 | 246 | | |
227 | 247 | | |
228 | 248 | | |
229 | 249 | | |
230 | 250 | | |
231 | 251 | | |
232 | | - | |
233 | | - | |
234 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
235 | 256 | | |
236 | 257 | | |
237 | 258 | | |
| |||
633 | 654 | | |
634 | 655 | | |
635 | 656 | | |
636 | | - | |
| 657 | + | |
| 658 | + | |
637 | 659 | | |
638 | 660 | | |
639 | 661 | | |
640 | 662 | | |
641 | 663 | | |
642 | 664 | | |
643 | | - | |
| 665 | + | |
644 | 666 | | |
645 | 667 | | |
0 commit comments