Skip to content

Commit 6f49c74

Browse files
Update docs
1 parent 24adc8d commit 6f49c74

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

docs/architecture/frameworks.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ from mpos import Intent, FileExplorerActivity, Activity
207207
class MyActivity(Activity):
208208
def pick_file(self):
209209
intent = Intent(action="pick_file")
210-
intent.putExtra("mode", "pick")
211210
intent.putExtra("path_pattern", [".wav"])
212211
self.startActivityForResult(intent, self.on_file_picked)
213212
```

docs/frameworks/file-explorer-activity.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ The activity is registered for the `pick_file` action, so any app can ask the us
99
Two modes are supported:
1010

1111
- **`browse`** (default): navigate directories, open files, rename or delete them.
12-
- **`pick`**: select one or more files and return them to the caller.
12+
- **`pick`**: select one or more files and return them to the caller. The `pick_file` action automatically uses pick mode, so callers do not need to set the `"mode"` extra.
1313

1414
## Launching
1515

1616
### Pick files with `startActivityForResult`
1717

18+
Using the `pick_file` action automatically opens `FileExplorerActivity` in pick mode, so you do **not** need to set the `"mode"` extra.
19+
1820
```python
1921
from mpos import Intent, Activity
2022

2123
class MyActivity(Activity):
2224
def _open_file_clicked(self, event):
2325
intent = Intent(action="pick_file")
24-
intent.putExtra("mode", "pick")
2526
intent.putExtra("start_dir", "/data/audio")
2627
intent.putExtra("path_pattern", [".wav"])
2728
self.startActivityForResult(intent, self._on_file_picked)
@@ -49,7 +50,7 @@ class MyActivity(Activity):
4950

5051
| Extra | Type | Default | Description |
5152
|-------|------|---------|-------------|
52-
| `mode` | `str` | `"browse"` | `"browse"` or `"pick"`. |
53+
| `mode` | `str` | `"browse"` (or `"pick"` when action is `"pick_file"`) | `"browse"` or `"pick"`. Only needed when launching `FileExplorerActivity` directly; the `"pick_file"` action implies picker mode automatically. |
5354
| `start_dir` | `str` | `"."` | Directory to open. Non-existent paths are walked up to the first existing parent, falling back to `"/"`. |
5455
| `path_pattern` | `str` or `list` | `[]` | File extensions to accept in pick mode, e.g. `[".png", ".jpg"]`. Strings may include a leading `*` (`"*.wav"`). An empty list accepts all files. |
5556

@@ -114,7 +115,6 @@ class GalleryLauncher(Activity):
114115

115116
def _choose_image(self, event):
116117
intent = Intent(action="pick_file")
117-
intent.putExtra("mode", "pick")
118118
intent.putExtra("start_dir", "/data/images")
119119
intent.putExtra("path_pattern", [".png", ".jpg", ".jpeg", ".raw"])
120120
self.startActivityForResult(intent, self._on_image_picked)

docs/other/supported-file-formats.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ MicroPythonOS uses LVGL's built-in image decoders and its own audio stack. The f
66

77
| Format | Extensions | Notes |
88
|--------|------------|-------|
9+
| BMP | `.bmp` | Supports RGB565 and RGB888 |
910
| PNG | `.png` | Fully supported via LodePNG. |
1011
| Baseline JPEG | `.jpg`, `.jpeg` | Fully supported via TJpgD. |
1112
| Progressive JPEG | `.jpg`, `.jpeg` | **Not supported.** Files will decode as `0x0` and appear blank. |

0 commit comments

Comments
 (0)