EmbeddedPhotoPickerView.EmbeddedPhotoPickerStateChangeListener


interface EmbeddedPhotoPickerView.EmbeddedPhotoPickerStateChangeListener


A state change listener which supplies callbacks for state changes related to any currently running Embedded PhotoPicker session.

Summary

Public functions

Unit

Reports that the user is done with their selection and should collapse the picker.

Unit

Reports that terminal error has occurred in the session.

Unit

Reports that session of app with photopicker was established successfully.

Unit

Reports that URI permission has been granted to the item selected by the user.

Unit

Reports that URI permission has been revoked of the item deselected by the user.

Public functions

onSelectionComplete

Added in 1.0.0-alpha01
fun onSelectionComplete(): Unit

Reports that the user is done with their selection and should collapse the picker.

This doesn't necessarily mean that the session should be closed, but rather the user has indicated that they are done selecting images and should go back to the app.

onSessionError

Added in 1.0.0-alpha01
fun onSessionError(throwable: Throwable): Unit

Reports that terminal error has occurred in the session. Any further events notified on this session will be ignored. The embedded photopicker view will be torn down along with session upon error.

onSessionOpened

Added in 1.0.0-alpha01
fun onSessionOpened(newSession: EmbeddedPhotoPickerSession): Unit

Reports that session of app with photopicker was established successfully. Also shares EmbeddedPhotoPickerSession handle containing the view with the caller that should be used to notify the session of UI events.

onUriPermissionGranted

fun onUriPermissionGranted(uris: List<Uri>): Unit

Reports that URI permission has been granted to the item selected by the user.

It is possible that the permission to the URI was revoked if the item was unselected by user before the URI is actually accessed by the caller. Hence callers must handle SecurityException when attempting to read or use the URI in response to this callback.

onUriPermissionRevoked

fun onUriPermissionRevoked(uris: List<Uri>): Unit

Reports that URI permission has been revoked of the item deselected by the user.