Commit 63c86ed
committed
fix: Correct SAF interaction logic and ensure English default strings
This commit addresses critical feedback on SAF behavior and UI language:
1. **Corrected SAF Interaction Logic:**
- I verified and ensured that the application correctly waits for a valid result from the Storage Access Framework (SAF) file picker.
- The media permission denial count is now only reset if you successfully select a file/folder via SAF and a valid URI is returned.
- If SAF is cancelled by you, or if no valid URI is returned, the denial count is NOT reset, and the application does NOT proceed as if permission was granted. The feature requiring screenshot access remains unavailable.
- This fixes the issue where the app might have incorrectly proceeded without a valid SAF selection.
2. **Ensured English Default String Resources:**
- All user-facing strings in `MainActivity.kt` related to the permission dialogs (specifically `SafGuidanceDialog`) and Toast messages for the permission/SAF flow have been moved to string resources.
- The default string resource file (`app/src/main/res/values/strings.xml`) now contains English text for these elements.
- Corresponding German translations are provided in `app/src/main/res/values-de/strings.xml`.
- This corrects instances where default UI text might have been in German or hardcoded.
The overall permission flow remains: two consecutive system permission requests, followed by a non-cancellable SAF guidance dialog if both requests are denied, leading to an SAF attempt that tries to open in common screenshot directories.1 parent 6d38411 commit 63c86ed
3 files changed
Lines changed: 22 additions & 6 deletions
File tree
- app/src/main
- kotlin/com/google/ai/sample
- res
- values-de
- values
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
32 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
32 | 40 | | |
0 commit comments