Grid (Android)

Setting Up Grid

To set up the Grid, the host application must invoke the init() function, which requires both the context and the embed Id. These are essential fields, embed id can be obtained from the live2.ai dashboard.

Kotlin:

val gridView: SiteSectionContainer = findViewById(R.id.gridView)
gridView.init(context = this, embedId = Constants.GRID_EMBED)

Grid Layout

XML Layout:

<com.live2.media.ui.container.SiteSectionContainer
                android:id="@+id/gridView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:numberOfColumns = 2
                app:enablePreview="true"
                app:showTitle="true"
                app:viewType="Grid" />
  • Enabling video previews on the L1 screen: Set app:enablePreview="true" to allow video previews on the L1 screen.

  • Disabling video previews on the L1 screen: Set app:enablePreview="false" to prevent video previews from being displayed on the L1 screen.

  • The app:numberOfColumns attribute specifies the number of vertical columns in the grid layout, displaying that number of columns.

Last updated