Configuration

interface Configuration

Exposes configuration options available to lenses carousel feature.

Functions

Link copied to clipboard
abstract fun attachViewTo(layoutPlacement: LensesComponent.Carousel.LayoutPlacement, onViewStub: Consumer<ViewStub>)

Allows placing of views relative to the carousel based on a given LayoutPlacement. When a ViewStub has been attached to the carousel, the Consumer will provide that available ViewStub to inflate the views into.

Link copied to clipboard

Allows to configure each lenses carousel item by receiving ItemOptions in the provided Consumer.

Link copied to clipboard

Properties

Link copied to clipboard
abstract var activateIdle: Boolean

By default, carousel reacts to interactions of processor and displays any applied lens as selected, while this option enables carousel to start in the idle state where no lens is yet applied and selected.

Link copied to clipboard
abstract var activateOnStart: Boolean

By default, carousel reacts to interactions of processor and displays any applied lens as selected, while this option enables carousel to start in an activated state - idle or with a lens selected if disableIdle is true.

Link copied to clipboard
abstract var activateOnTap: Boolean

Enables activation of lenses carousel by a tap gesture on the root view that the CameraKit views are inflated to. True by default and activate only when lenses carousel is deactivated.

Link copied to clipboard

Sets whether the carousel close button should be visible and operational or completely disabled, invisible.

Link copied to clipboard

Sets the carousel close button bottom margin to the value of provided dimension resource. This parameter has no effect if closeButtonEnabled value is false. This parameter has no effect if custom view is set.

Link copied to clipboard

Enables deactivation of lenses carousel by clicking on close button when closeButtonEnabled is true. False by default, meaning that a click on the close button resets lenses carousel to idle, no lens selected state.

Link copied to clipboard
abstract var disableIdle: Boolean

Disables presentation of the idle state - an empty item which can be selected to remove any previously applied lens.

Link copied to clipboard
abstract var enabled: Boolean

True if carousel feature should be enabled. Typically, it is True when observedGroupIds is not empty, False otherwise.

Link copied to clipboard
abstract var heightDimenRes: Int?

Sets the carousel height to the value of provided dimension resource. This parameter has no effect if custom view is set.

Link copied to clipboard
abstract var marginBottomDimenRes: Int?

Sets the carousel bottom margin to the value of provided dimension resource. This parameter has no effect if custom view is set.

Link copied to clipboard
abstract var observedGroupIds: Set<String>

Uses the provided observedGroupIds to present lenses in carousel. If observedGroupIds is empty (default) then the carousel feature is considered to be disabled, any interaction with Carousel is no-op.

Link copied to clipboard

Allows to asynchronously provide lens group IDs to present lenses in carousel. By default, the observedGroupIdsProvider is backed by a Callable which returns the observedGroupIds set as is, however, if custom observedGroupIdsProvider is supplied, then its results are merged with the observedGroupIds to a final set of lens groups that appear in the carousel. Any Exception thrown in the provided observedGroupIdsProvider is suppressed resulting in only the observedGroupIds used as the final set of group IDs that appear in the carousel.

Link copied to clipboard

Sets the carousel bottom padding to the value of provided dimension resource. This parameter has no effect if custom view is set.

Link copied to clipboard
abstract var paddingTopDimenRes: Int?

Sets the carousel top padding to the value of provided dimension resource. This parameter has no effect if custom view is set.

Link copied to clipboard

Custom implementation of Carousel.View to be used as a delegate to show and hide lenses carousel. By default, the internal carousel view implementation is used.