EmbeddedPhotoPickerSession
public interface EmbeddedPhotoPickerSession
| android.widget.photopicker.EmbeddedPhotoPickerSession |
Class that holds the embedded photopicker view wrapped in SurfaceControlViewHost.SurfacePackage that can be embedded by the caller in their view hierarchy by placing it in a SurfaceView via its SurfaceView.setChildSurfacePackage api. Callers of EmbeddedPhotoPickerProvider.openSession will asynchronously receive instance of this class from the service upon its successful execution via EmbeddedPhotoPickerClient.onSessionOpened callback.
Instance of this class can be then used by callers to notify PhotoPicker about different events for service to act upon them.
When a session is no longer being used, it should be closed by callers to help system release the resources.
Summary
Public methods | |
|---|---|
abstract void | close() Close the session, i.e. |
abstract SurfaceControlViewHost.SurfacePackage | getSurfacePackage() Returns the |
abstract void | notifyConfigurationChanged(Configuration configuration) Notifies photopicker that host side configuration has changed. |
abstract void | notifyPhotoPickerExpanded(boolean isExpanded) Notify that user switched photopicker between expanded/collapsed state. |
abstract void | notifyResized(int width, int height) Notify that caller's presentation area has changed and photopicker's dimensions should change accordingly. |
abstract void | notifyVisibilityChanged(boolean isVisible) Notify that embedded photopicker view is visible or not to the user. |
abstract void | requestRevokeUriPermission(List<Uri> uris) Notify that the user deselected some items. |
Public methods
close
public abstract void close ()
Close the session, i.e. photopicker will release resources associated with this session. Any further notifications to this Session will be ignored by the service.
getSurfacePackage
public abstract SurfaceControlViewHost.SurfacePackage getSurfacePackage ()
Returns the SurfaceControlViewHost.SurfacePackage that contains view representing embedded picker.
Callers can attach this view in their hierarchy using SurfaceView.setChildSurfacePackage api.
| Returns | |
|---|---|
SurfaceControlViewHost.SurfacePackage | This value cannot be null. |
notifyConfigurationChanged
public abstract void notifyConfigurationChanged (Configuration configuration)
Notifies photopicker that host side configuration has changed.
| Parameters | |
|---|---|
configuration | Configuration: new configuration of caller This value cannot be null. |
notifyPhotoPickerExpanded
public abstract void notifyPhotoPickerExpanded (boolean isExpanded)
Notify that user switched photopicker between expanded/collapsed state.
Some photopicker features (like Profile selector, Album grid etc.) are only shown in full/expanded view and are hidden in collapsed view.
| Parameters | |
|---|---|
isExpanded | boolean: true if expanded, false if collapsed. |
notifyResized
public abstract void notifyResized (int width, int height)
Notify that caller's presentation area has changed and photopicker's dimensions should change accordingly.
| Parameters | |
|---|---|
width | int: width of the view, in pixels |
height | int: height of the view, in pixels |
notifyVisibilityChanged
public abstract void notifyVisibilityChanged (boolean isVisible)
Notify that embedded photopicker view is visible or not to the user.
This helps photopicker to close upstream work and manage the lifecycle of this Session instance.
| Parameters | |
|---|---|
isVisible | boolean: True if view visible to the user, false if not. |