EmbeddedPhotoPickerUiCustomizationParams.Builder
public
static
final
class
EmbeddedPhotoPickerUiCustomizationParams.Builder
extends Object
| java.lang.Object | |
| ↳ | android.widget.photopicker.EmbeddedPhotoPickerUiCustomizationParams.Builder |
Builder class for EmbeddedPhotoPickerUiCustomizationParams.
Summary
Public constructors | |
|---|---|
Builder()
|
|
Public methods | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams
|
build()
Builds the |
EmbeddedPhotoPickerUiCustomizationParams.Builder
|
setAspectRatio(int aspectRatio)
Sets the desired aspect ratio for the media grid thumbnails within the Photo Picker UI. |
EmbeddedPhotoPickerUiCustomizationParams.Builder
|
setNavigationBarVisibleInExpandedMode(boolean visible)
Sets whether to show the Navigation Bar in the embedded photopicker when in expanded mode. |
EmbeddedPhotoPickerUiCustomizationParams.Builder
|
setSearchBarVisibleInExpandedMode(boolean visible)
Sets whether to show the Search Bar in the embedded photopicker when in expanded mode. |
EmbeddedPhotoPickerUiCustomizationParams.Builder
|
setSelectionBarVisibleInExpandedMode(boolean visible)
Sets whether to show the Selection Bar in the embedded photopicker when in expanded mode. |
Inherited methods | |
|---|---|
Public constructors
Public methods
build
public EmbeddedPhotoPickerUiCustomizationParams build ()
Builds the EmbeddedPhotoPickerUiCustomizationParams object.
| Returns | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams |
A new EmbeddedPhotoPickerUiCustomizationParams instance with the
configured UI properties.
This value cannot be null. |
setAspectRatio
public EmbeddedPhotoPickerUiCustomizationParams.Builder setAspectRatio (int aspectRatio)
Sets the desired aspect ratio for the media grid thumbnails within the Photo Picker UI.
The value must be one of the following constants:
-
EmbeddedPhotoPickerUiCustomizationParams.ASPECT_RATIO_UNDEFINED -
EmbeddedPhotoPickerUiCustomizationParams.ASPECT_RATIO_SQUARE_1_1 -
EmbeddedPhotoPickerUiCustomizationParams.ASPECT_RATIO_PORTRAIT_9_16
IllegalArgumentException.
If not set, the EmbeddedPhotoPickerUiCustomizationParams.ASPECT_RATIO_UNDEFINED will be used.
| Parameters | |
|---|---|
aspectRatio |
int: The aspect ratio constant.
Value is one of the following: |
| Returns | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This value cannot be null. |
| Throws | |
|---|---|
IllegalArgumentException |
if the provided aspectRatio is not one of the
supported constants (ERROR[not public: #VALID_ASPECT_RATIOS]). |
setNavigationBarVisibleInExpandedMode
public EmbeddedPhotoPickerUiCustomizationParams.Builder setNavigationBarVisibleInExpandedMode (boolean visible)
Sets whether to show the Navigation Bar in the embedded photopicker when in expanded mode. By default, the Navigation Bar is shown.
If this is explicitly set to true and
EmbeddedPhotoPickerFeatureInfo.Builder.setAllowedNavigationTabs(Set) is
configured with a non-empty set, both
NavigationTabConstants.NAV_TAB_PHOTOS and
NavigationTabConstants.NAV_TAB_COLLECTIONS must be allowed. Otherwise,
EmbeddedPhotoPickerFeatureInfo.Builder.build() will throw an
IllegalArgumentException.
| Parameters | |
|---|---|
visible |
boolean: false to hide the Navigation Bar, true to show it. |
| Returns | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This Builder object.
This value cannot be null. |
setSearchBarVisibleInExpandedMode
public EmbeddedPhotoPickerUiCustomizationParams.Builder setSearchBarVisibleInExpandedMode (boolean visible)
Sets whether to show the Search Bar in the embedded photopicker when in expanded mode. By default, the Search Bar is shown.
If this is explicitly set to true and
EmbeddedPhotoPickerFeatureInfo.Builder.setAllowedNavigationTabs(Set) is
configured with a non-empty set, NavigationTabConstants.NAV_TAB_SEARCH must be
allowed. Otherwise, EmbeddedPhotoPickerFeatureInfo.Builder.build() will throw an
IllegalArgumentException.
| Parameters | |
|---|---|
visible |
boolean: false to hide the Search Bar, true to show it. |
| Returns | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This Builder object.
This value cannot be null. |
setSelectionBarVisibleInExpandedMode
public EmbeddedPhotoPickerUiCustomizationParams.Builder setSelectionBarVisibleInExpandedMode (boolean visible)
Sets whether to show the Selection Bar in the embedded photopicker when in expanded mode. By default, the Selection Bar is shown.
| Parameters | |
|---|---|
visible |
boolean: false to hide the Selection Bar, true to show it. |
| Returns | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This Builder object.
This value cannot be null. |