EmbeddedPhotoPickerClient
public
interface
EmbeddedPhotoPickerClient
android.widget.photopicker.EmbeddedPhotoPickerClient |
Callback to define mechanisms by which can apps can receive notifications about
different events from embedded photopicker for the corresponding Session
(EmbeddedPhotoPickerSession
).
PhotoPicker will invoke the methods of this interface on the Executor provided by
the caller in EmbeddedPhotoPickerProvider.openSession
Any methods on a single instance of this object will always be invoked in a non-concurrent or thread safe way. In other words, all methods are invoked in a serial execution manner on the executor passed by the caller. Hence callers wouldn't need any buffer or locking mechanism on their end.
See also:
Summary
Public methods | |
---|---|
abstract
void
|
onSelectionComplete()
Reports that the user is done with their selection and should collapse the picker. |
abstract
void
|
onSessionError(Throwable cause)
Reports that terminal error has occurred in the session. |
abstract
void
|
onSessionOpened(EmbeddedPhotoPickerSession session)
Reports that session of app with photopicker was established successfully. |
abstract
void
|
onUriPermissionGranted(List<Uri> uris)
Reports that URI permission has been granted to the item selected by the user. |
abstract
void
|
onUriPermissionRevoked(List<Uri> uris)
Reports that URI permission has been revoked of the item deselected by the user. |
Public methods
onSelectionComplete
public abstract void onSelectionComplete ()
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
public abstract void onSessionError (Throwable cause)
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.
Parameters | |
---|---|
cause |
Throwable : This value cannot be null . |
onSessionOpened
public abstract void onSessionOpened (EmbeddedPhotoPickerSession session)
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.
Parameters | |
---|---|
session |
EmbeddedPhotoPickerSession : This value cannot be null . |
onUriPermissionGranted
public abstract void onUriPermissionGranted (List<Uri> uris)
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.
Parameters | |
---|---|
uris |
List : This value cannot be null . |
onUriPermissionRevoked
public abstract void onUriPermissionRevoked (List<Uri> uris)
Reports that URI permission has been revoked of the item deselected by the user.
Parameters | |
---|---|
uris |
List : This value cannot be null . |