• Use Photo Picker Jetpack library (androidx.photopicker:photopicker-compose:1.0.0-alpha01) for easy integration. • Create a Composable demo that tracks selected attachments with mutableStateOf. • Configure a BottomSheetScaffold to show the picker when a button is pressed. • Set picker options: max 5 selections, ordered selection, and a red accent color. • Handle selection completion by hiding the bottom sheet via coroutineScope.launch. • Update attachment list on URI permission grant or revoke, keeping state in sync.

Article Summaries:

  • The Android team released the Photo Picker Jetpack library (androidx.photopicker:photopicker-compose:1.0.0‑alpha01) to simplify embedding a photo picker in apps. Developers can add the library with a single Gradle dependency and use the @Composable EmbeddedPhotoPicker inside a BottomSheetScaffold. The picker supports configuration options such as a maximum selection limit, ordered selection, and custom accent colors. State is managed through rememberEmbeddedPhotoPickerState, with callbacks for selection completion, URI permission grants, and revocations. The demo shows how to open the picker, display selected images with Coil, and deselect items programmatically. The library also offers a non‑Compose API via EmbeddedPhotoPickerView.

Sources: