EmbeddedPhotoPickerFeatureInfo.Builder
public
static
final
class
EmbeddedPhotoPickerFeatureInfo.Builder
extends Object
java.lang.Object | |
↳ | android.widget.photopicker.EmbeddedPhotoPickerFeatureInfo.Builder |
Summary
Public constructors | |
---|---|
Builder()
|
Public methods | |
---|---|
EmbeddedPhotoPickerFeatureInfo
|
build()
Build the class for desired feature info arguments |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setAccentColor(long accentColor)
Sets accent color which will change color of primary picker elements like Done button, selected media icon colors, tab color etc. |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setHighlightAlbumId(String highlightAlbumId)
The app can choose to highlight media items of a photopicker album in the embedded photopicker in its expanded state. |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setHighlightSearchMediaTextQuery(String highlightSearchMediaTextQuery)
The app can choose to highlight media items in the embedded photopicker in its expanded state. |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setMaxSelectionLimit(int maxSelectionLimit)
Sets maximum number of items that can be selected by the user The value of this intent-extra should be a positive integer greater than
or equal to 1 and less than or equal to |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setMimeTypes(List<String> mimeTypes)
Sets the mime type to filter media items on. |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setOrderedSelection(boolean orderedSelection)
Sets ordered selection of media items i.e. |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setPreSelectedUris(List<Uri> preSelectedUris)
Sets list of uris to be pre-selected when embedded picker is opened. |
EmbeddedPhotoPickerFeatureInfo.Builder
|
setThemeNightMode(int themeNightMode)
Sets the embedded photo picker theme to light or dark irrespective of the device theme. |
Inherited methods | |
---|---|
Public constructors
Public methods
build
public EmbeddedPhotoPickerFeatureInfo build ()
Build the class for desired feature info arguments
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo |
This value cannot be null . |
setAccentColor
public EmbeddedPhotoPickerFeatureInfo.Builder setAccentColor (long accentColor)
Sets accent color which will change color of primary picker elements like Done button, selected media icon colors, tab color etc.
The value of this intent-extra must be a string specifying the hex code of the accent color that is to be used within the picker.
This param is same as ERROR(/MediaStore#EXTRA_PICK_IMAGES_ACCENT_COLOR)
. See ERROR(/MediaStore#EXTRA_PICK_IMAGES_ACCENT_COLOR)
for more details on accepted colors.
Parameters | |
---|---|
accentColor |
long : Hex code of desired accent color. By default, the color of elements
will reflect based on device theme |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
This value cannot be null . |
setHighlightAlbumId
public EmbeddedPhotoPickerFeatureInfo.Builder setHighlightAlbumId (String highlightAlbumId)
The app can choose to highlight media items of a photopicker album in the embedded
photopicker in its expanded state. These can be one of Favorites, Camera, Screenshots,
Videos or Downloads. In order to do so, the input value should be one of the album
values:
ERROR(/MediaStore#PICK_IMAGES_HIGHLIGHT_ALBUM_FAVORITES)
for the Favorites album,
ERROR(/MediaStore#PICK_IMAGES_HIGHLIGHT_ALBUM_CAMERA)
for the Camera album,
ERROR(/MediaStore#PICK_IMAGES_HIGHLIGHT_ALBUM_SCREENSHOTS)
for the Screenshots album,
ERROR(/MediaStore#PICK_IMAGES_HIGHLIGHT_ALBUM_VIDEOS)
for the Videos album and
ERROR(/MediaStore#PICK_IMAGES_HIGHLIGHT_ALBUM_DOWNLOADS)
for the Downloads album.
The value of this string param must not be empty or null in case the app wants to
show a highlighted album media section. An empty value will result in simply ignoring
the request for a highlighted media section. A null value will result in
IllegalArgumentException
being thrown. Any other value except the ones
specified will also result in IllegalArgumentException
to be thrown.
The app can also choose to highlight media items based on a text query using
ERROR(EmbeddedPhotoPickerFeatureInfo.setHighlightMediaTextQuery/android.widget.photopicker.EmbeddedPhotoPickerFeatureInfo#setHighlightMediaTextQuery EmbeddedPhotoPickerFeatureInfo.setHighlightMediaTextQuery)
. Only one of album
highlight or text highlight should be used at any point. Using both will result in
IllegalArgumentException
to be thrown.
Parameters | |
---|---|
highlightAlbumId |
String : One of the above mentioned string params specifying the
album name.
This value cannot be null . |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
Throws | |
---|---|
IllegalArgumentException |
in case input album is null |
setHighlightSearchMediaTextQuery
public EmbeddedPhotoPickerFeatureInfo.Builder setHighlightSearchMediaTextQuery (String highlightSearchMediaTextQuery)
The app can choose to highlight media items in the embedded photopicker in its expanded state. The media items in this highlighted section are based on the string input query set in this method. The photopicker will trigger a search based on this input value to show media results in this section.This can be any string literal for which the app wants to highlight media results.
The value of this string param must not be empty or null in case the app wants to
show a highlighted media section. An empty value will result in simply ignoring
the request for a highlighted media section. A null value will result in
IllegalArgumentException
The app can also choose to highlight a specific photopicker album using
ERROR(EmbeddedPhotoPickerFeatureInfo.setHighlightAlbumName/android.widget.photopicker.EmbeddedPhotoPickerFeatureInfo#setHighlightAlbumName EmbeddedPhotoPickerFeatureInfo.setHighlightAlbumName)
. Only one of album
highlight or text highlight should be used at any point. Using both will result in
IllegalArgumentException
to be thrown.
Parameters | |
---|---|
highlightSearchMediaTextQuery |
String : A String param based on which the highlighted
results shown.
This value cannot be null . |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
Throws | |
---|---|
IllegalArgumentException |
in case input string query is null |
setMaxSelectionLimit
public EmbeddedPhotoPickerFeatureInfo.Builder setMaxSelectionLimit (int maxSelectionLimit)
Sets maximum number of items that can be selected by the user
The value of this intent-extra should be a positive integer greater than
or equal to 1 and less than or equal to ERROR(/MediaStore#getPickImagesMaxLimit)
Parameters | |
---|---|
maxSelectionLimit |
int : Max selection count restriction. Pass limit as 1 to open
PhotoPicker in single-select mode. Default is multi select mode with limit as
ERROR(/MediaStore#getPickImagesMaxLimit())
Value is 1 or greater |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
This value cannot be null . |
setMimeTypes
public EmbeddedPhotoPickerFeatureInfo.Builder setMimeTypes (List<String> mimeTypes)
Sets the mime type to filter media items on.
Values may be a combination of concrete MIME types (such as "image/png") and/or partial MIME types (such as "image/*").
Parameters | |
---|---|
mimeTypes |
List : List of mime types to filter. By default, all media items
will be returned
This value cannot be null . |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
This value cannot be null . |
setOrderedSelection
public EmbeddedPhotoPickerFeatureInfo.Builder setOrderedSelection (boolean orderedSelection)
Sets ordered selection of media items i.e. this allows user to view/receive items in their selected order
Parameters | |
---|---|
orderedSelection |
boolean : Pass true to set ordered selection. Default is false |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
This value cannot be null . |
setPreSelectedUris
public EmbeddedPhotoPickerFeatureInfo.Builder setPreSelectedUris (List<Uri> preSelectedUris)
Sets list of uris to be pre-selected when embedded picker is opened.
This is same as ERROR(/MediaStore#EXTRA_PICKER_PRE_SELECTION_URIS)
.
See ERROR(/MediaStore#EXTRA_PICKER_PRE_SELECTION_URIS)
for more details
on restrictions and filter criteria.
Parameters | |
---|---|
preSelectedUris |
List : list of uris to be pre-selected
This value cannot be null . |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
This value cannot be null . |
setThemeNightMode
public EmbeddedPhotoPickerFeatureInfo.Builder setThemeNightMode (int themeNightMode)
Sets the embedded photo picker theme to light or dark irrespective of the device theme.
Parameters | |
---|---|
themeNightMode |
int : hex code of the desired Configuration.UI_MODE_NIGHT_MASK
value.
The default value is Supported values are - Configuration.UI_MODE_NIGHT_UNDEFINED -> system theme
Configuration.UI_MODE_NIGHT_YES -> dark theme
Configuration.UI_MODE_NIGHT_NO -> light theme |
Returns | |
---|---|
EmbeddedPhotoPickerFeatureInfo.Builder |
This value cannot be null . |