Compose Support

Before integrating the VideoFeed and StoryBlock components in your Android Compose project, make sure to follow the official Firework Getting Started Guide for Android SDK.

Video Feed

An Activity that uses the VideoFeed component must extend ComponentActivity or a subclass of ComponentActivity.

A Fragment that uses the VideoFeed component must extend Fragment or a subclass of Fragment.

Then you can add VideoFeed to your project

@Composable
private fun VideoFeed(modifier: Modifier) {
    AndroidView(
        modifier = modifier.fillMaxSize(),
        factory = { context ->
        fwVideoFeedView(context) {
            viewOptions {
                ......
            }
        }
    })
}

For viewOptions detail configuration, refer to the video-feed-integration doc, you are allowed to fill in more options here.

Storyblock

An Activity that uses the Storyblock component must extend FragmentActivity or a subclass of FragmentActivity.

A Fragment that uses the Storyblock component must extend Fragment or a subclass of Fragment.

Use single storyblock

Create a Storyblock code down below, and add the widget to your compose code.

To view the configuration details of the viewOptions, refer to the Storyblock doc, you are allowed to fill in more options here.

Note

Don't forget to destroy the FwStoryBlockView in DisposableEffect

Use multiple storyblocks in Grid

Create and Initialize the FwStoryBlockView with view options.

Integrate with LazyVerticalGrid Component

Build LazyVerticalGridItem demo code.

You can integrate LazyVerticalGridItem into your compose code.

Note

Don't forget to destroy the FwStoryBlockView in DisposableEffect

Last updated

Was this helpful?