PickVisualMediaRequestKt

Added in 1.6.0

public final class PickVisualMediaRequestKt


Summary

Public methods

PickVisualMediaRequest

public static final @NonNull PickVisualMediaRequest PickVisualMediaRequest(
    @NonNull ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType,
    @IntRange(from = 2) int maxItems,
    boolean isOrderedSelection,
    @NonNull ActivityResultContracts.PickVisualMedia.DefaultTab defaultTab
)

Creates a request for a androidx.activity.result.contract.ActivityResultContracts.PickMultipleVisualMedia or androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia Activity Contract.

Parameters
@NonNull ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType

type to go into the PickVisualMediaRequest

@IntRange(from = 2) int maxItems

limit the number of selectable items when using PickMultipleVisualMedia

boolean isOrderedSelection

whether the user can control the order of selected media when using PickMultipleVisualMedia (defaults to false)

@NonNull ActivityResultContracts.PickVisualMedia.DefaultTab defaultTab

the tab to initially open in the picker (defaults to DefaultTab.PhotosTab)

Returns
@NonNull PickVisualMediaRequest

a PickVisualMediaRequest that contains the given input

PickVisualMediaRequest

public static final @NonNull PickVisualMediaRequest PickVisualMediaRequest(
    long accentColor,
    @NonNull ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType,
    @IntRange(from = 2) int maxItems,
    boolean isOrderedSelection,
    @NonNull ActivityResultContracts.PickVisualMedia.DefaultTab defaultTab
)

Creates a request for a androidx.activity.result.contract.ActivityResultContracts.PickMultipleVisualMedia or androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia Activity Contract.

Parameters
long accentColor

color long to customize picker accent color

@NonNull ActivityResultContracts.PickVisualMedia.VisualMediaType mediaType

type to go into the PickVisualMediaRequest

@IntRange(from = 2) int maxItems

limit the number of selectable items when using PickMultipleVisualMedia

boolean isOrderedSelection

whether the user can control the order of selected media when using PickMultipleVisualMedia (defaults to false)

@NonNull ActivityResultContracts.PickVisualMedia.DefaultTab defaultTab

the tab to initially open in the picker (defaults to DefaultTab.PhotosTab)

Returns
@NonNull PickVisualMediaRequest

a PickVisualMediaRequest that contains the given input