Builder
class Builder
| kotlin.Any | |
| ↳ | android.widget.photopicker.EmbeddedPhotoPickerUiCustomizationParams.Builder |
Builder class for EmbeddedPhotoPickerUiCustomizationParams.
Summary
| Public constructors | |
|---|---|
Builder() |
|
| Public methods | |
|---|---|
| EmbeddedPhotoPickerUiCustomizationParams |
build()Builds the |
| EmbeddedPhotoPickerUiCustomizationParams.Builder |
setAspectRatio(aspectRatio: Int)Sets the desired aspect ratio for the media grid thumbnails within the Photo Picker UI. |
| EmbeddedPhotoPickerUiCustomizationParams.Builder |
Sets whether to show the Navigation Bar in the embedded photopicker when in expanded mode. |
| EmbeddedPhotoPickerUiCustomizationParams.Builder |
setSearchBarVisibleInExpandedMode(visible: Boolean)Sets whether to show the Search Bar in the embedded photopicker when in expanded mode. |
| EmbeddedPhotoPickerUiCustomizationParams.Builder |
setSelectionBarVisibleInExpandedMode(visible: Boolean)Sets whether to show the Selection Bar in the embedded photopicker when in expanded mode. |
Public constructors
Public methods
build
fun build(): EmbeddedPhotoPickerUiCustomizationParams
Builds the EmbeddedPhotoPickerUiCustomizationParams object.
| Return | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams |
A new EmbeddedPhotoPickerUiCustomizationParams instance with the configured UI properties. This value cannot be null. |
setAspectRatio
fun setAspectRatio(aspectRatio: Int): EmbeddedPhotoPickerUiCustomizationParams.Builder
Sets the desired aspect ratio for the media grid thumbnails within the Photo Picker UI.
The value must be one of the following constants:
Any other value will result in throwingIllegalArgumentException.
If not set, the ASPECT_RATIO_UNDEFINED will be used.
| Parameters | |
|---|---|
aspectRatio |
Int: The aspect ratio constant. Value is one of the following: |
| Return | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
if the provided aspectRatio is not one of the supported constants (ERROR[not public: #VALID_ASPECT_RATIOS]). |
setNavigationBarVisibleInExpandedMode
fun setNavigationBarVisibleInExpandedMode(: Boolean): EmbeddedPhotoPickerUiCustomizationParams.Builder
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. |
| Return | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This Builder object. This value cannot be null. |
setSearchBarVisibleInExpandedMode
fun setSearchBarVisibleInExpandedMode(visible: Boolean): EmbeddedPhotoPickerUiCustomizationParams.Builder
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. |
| Return | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This Builder object. This value cannot be null. |
setSelectionBarVisibleInExpandedMode
fun setSelectionBarVisibleInExpandedMode(visible: Boolean): EmbeddedPhotoPickerUiCustomizationParams.Builder
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. |
| Return | |
|---|---|
EmbeddedPhotoPickerUiCustomizationParams.Builder |
This Builder object. This value cannot be null. |