Skip to main content
Version: 2.3.x

ThumbView

This option allows you to display our custom widget that display stories in an horizontal scrollable view with a Instagram-like UI.

Layout

You first need to add our scaffold view and player view within your Activity/Fragment layout:

<com.joinstoriessdk.androidsdk.ui.StoryScaffoldView
android:id="@+id/story_scaffold"
android:layout_width="0dp"
android:layout_height="144dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<com.joinstoriessdk.androidsdk.ui.player.StoryPlayer
android:id="@+id/story_player"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

Trigger

To start the display of our thumbView widget, you need to call the startThumbView method:

binding.storyScaffold.setStoryPlayer(binding.storyPlayer)
binding.storyScaffold.startThumbView("<join_alias>")

Configuration

You can fine tune SDK behavior and UI, by specifying optional values of the StoryScaffoldView parameter.

Show Label

Show/hide text below each thumb. The label is visible by default

storyScaffold.withLabel = true | false

Label Typeface

Thumb views label custom font (withLabel should be true)

storyScaffold.typeface = ResourcesCompat.getFont(context, R.font.font)

Label Color

Thumb views label custom text color (withLabel should be true)

storyScaffold.labelColor = Color.BLACK

Thumb View Spacing

Spacing between thumb views

storyScaffold.thumbViewSpacing = 32

Thumb View Overlay Color

Color of the overlay displayed on the thumb view image when a story was selected by the user and is loading

storyScaffold.thumbViewOverlayColor = Color.parseColor("#BB4C4C4C")

Loader Inner View Width

Spacing between the image and the loader in a thumb view

storyScaffold.loaderInnerViewWidth = 8

Loader Inner View Color

Color between the image and the loader in a thumb view. By default, is TRANSPARANT

storyScaffold.loaderInnerViewColor = intArrayOf(Color.RED, Color.CYAN, Color.YELLOW)

Loader Colors

Colors of the thumb view loader. A sweep gradient will be applied on it. The default colours are RED and BLUE

storyScaffold.loaderInnerViewColor = intArrayOf(Color.RED, Color.BLUE)

Loader Width

Width of the thumb view

storyScaffold.loaderWidth = 8

Story Viewed Indicator Color

Color of the thumb view indicator displayed when a story has been viewed by the user

storyScaffold.storyViewedIndicatorColor = Color.GRAY

Story Viewed Indicator Alpha

Alpha of the thumb view indicator displayed when a story has been viewed by the user. Range [0..255]

storyScaffold.storyViewedIndicatorAlpha = 80

Multiple widgets

You can implement our thumbView widget multiple times on the same screen, with the same or different join alias.

To do so, you need to implement n StoryScaffoldView within your UI, and call the startThumbView method n times, one for each instance of StoryScaffoldView.