To display images in a viewer, use StfalconImageViewer.Builder. You must provide the context, the list of data items, and an image loading function. You can further customize the experience by setting a starting position, defining a transition from a specific ImageView, and adding an image change listener to handle transitions between images.
Key methods:
Builder<T>(context, items, imageLoader): Initializes the builder with the context, the data list, and the function used to load images into ImageViews..withStartPosition(position: Int): Sets the initial index of the image to be displayed..withTransitionFrom(view: ImageView): Configures a transition animation starting from a specific view..withImageChangeListener { ... }: Provides a callback when the image index changes, allowing you to update transitions or UI elements..show(): Displays the viewer.
viewer = StfalconImageViewer.Builder<Poster>(this, Demo.posters, ::loadPosterImage)
.withStartPosition(startPosition)
.withTransitionFrom(target)
.withImageChangeListener {
viewer.updateTransitionImage(postersGridView.imageViews[it])
}
.show()