Layout Options
LayoutOption controls the visual layout and appearance of FwVideoFeedView widget. It determines how video thumbnails are arranged, spaced, and styled.
Overview
LayoutOption provides comprehensive control over the feed's visual presentation, including:
Layout type (grid, horizontal, vertical)
Column count for grid layouts
Spacing between items
Thumbnail appearance (rounded corners, play icon)
Feed title positioning
Background colors
Creating LayoutOption
Using Builder
val layoutOption = LayoutOption.Builder()
.feedLayout(FeedLayout.GRID)
.columnCount(3)
.itemSpacing(8)
.roundedCorner(true)
.build()Using DSL (Recommended)
Properties
feedLayout
Type: FeedLayout (enum)
Default: FeedLayout.HORIZONTAL
Determines the layout type for displaying videos.
Values:
HORIZONTAL- Horizontal scrolling rowVERTICAL- Vertical scrolling columnGRID- Multi-column grid
columnCount
Type: Int
Default: 2
Applies to: Grid layout only
Number of columns in grid layout.
Note: This property only affects grid layouts. It's ignored for horizontal and vertical layouts.
backgroundColor
Type: Int (color)
Default: Transparent
Background color for the feed container.
feedPadding
Type: FeedPadding (data class)
Default: null
Sets the padding around the feed container. This controls the spacing between the feed content and its container edges.
FeedPadding Parameters:
start
Int
Start padding in pixels (left in LTR, right in RTL)
top
Int
Top padding in pixels
end
Int
End padding in pixels (right in LTR, left in RTL)
bottom
Int
Bottom padding in pixels
Tip: Use dpToPx() extension for density-independent values:
Use Cases:
Add horizontal margins to prevent content from touching screen edges
Create vertical spacing between feed and other UI elements
Support RTL layouts with start/end instead of left/right
Note: Unlike itemSpacing which controls spacing between items, feedPadding controls the outer padding of the entire feed container.
itemSpacing
Type: Int (pixels)
Default: 4dp
Spacing between feed items in pixels.
Tip: Use dpToPx() extension for dp values:
roundedCorner
Type: Boolean
Default: false
Enable or disable rounded corners on video thumbnails.
roundedCornerRadius
Type: Int (pixels)
Default: 5 (when roundedCorner is true)
Corner radius for rounded thumbnails in pixels.
Note: Only applies when roundedCorner is true.
showPlayIcon
Type: Boolean
Default: true
Show or hide the play icon overlay on video thumbnails.
playIconWidth
Type: Int (pixels)
Default: 24dp for Feed View; 50dp for Player Deck (converted to pixels)
Width and height of the square play icon area, in pixels. Applies to default and custom artwork and is capped by the component's maximum icon width.
playIcon
Available since 6.35.1 for FwVideoFeedView and FwPlayerDeckView.
Type: PlayIcon?
Default: null (inherits a lower-priority option, then falls back to the component default)
Pass this layoutOption to ViewOptions.Builder.layoutOption(...). WidgetImage.tintColor optionally tints the drawable; omit it to retain the artwork's colors.
PlayIcon.Defaultexplicitly restores the component's original artwork.nullinherits the lower-priority configuration.showPlayIcon(false)hides either kind of artwork.playIconWidthcontrols the square display size independently of the drawable.
showShoppingBagIcon
Type: Boolean
Default: false
Show or hide the shopping bag icon overlay on video thumbnails. When enabled and the video has associated products, a small shopping bag icon is displayed on the thumbnail to indicate shoppable content.
Behavior:
true- A shopping bag icon is shown on thumbnails of videos that have associated productsfalse- No shopping bag icon is displayed on thumbnails
Note: This only affects the feed thumbnail view. The shopping bag icon is not shown on videos without associated products regardless of this setting.
shoppingBagIcon
Type: ShoppingBagIcon (sealed class)
Default: ShoppingBagIcon.Default Customize the shopping bag icon appearance. Requires showShoppingBagIcon to be true.
Data Structure
WidgetImage
WidgetImage is the SDK's standard wrapper for a drawable resource with an optional tint:
drawableRes
Int (@DrawableRes)
No
A valid Android drawable resource ID (e.g. R.drawable.my_icon).
tintColor
Int? (@ColorInt)
Yes
A color int to tint the drawable. Pass null to keep the drawable's original colors.
CustomIcon.size
size
Pair<Int, Int>?
Yes
Width (first) and height (second) in pixels. If null, the icon retains the default proportional sizing based on the thumbnail.
Usage Examples
feedTitlePosition
Type: FeedTitlePosition (enum)
Default: FeedTitlePosition.NESTED
Position of the feed title relative to video thumbnails.
Values:
NESTED- Title overlays the thumbnailSTACKED- Title appears below the thumbnail
aspectRatio
Type: Double
Default: 9:16
Custom aspect ratio for video items.
Note: If not specified, the SDK uses the 9:16 aspect ratio.
Thumbnail Selection Rules
The SDK selects thumbnails according to the following priority:
The system will automatically extract a frame from the video and generate a default thumbnail matching the video's aspect ratio
When only a Vertical Image Poster or Horizontal Image Poster is uploaded The system will use the uploaded poster as the thumbnail
When both Vertical and Horizontal Image Posters are uploaded The Carousel component will automatically select the poster image that most closely matches its Item's aspect ratio as the thumbnail
Default Values
feedLayout
HORIZONTAL
columnCount
2
backgroundColor
Transparent
feedPadding
null
itemSpacing
0
roundedCorner
false
roundedCornerRadius
5 (when enabled)
playIcon
null (inherit; otherwise component default)
showPlayIcon
true
playIconWidth
Feed View: 24dp; Player Deck: 50dp
showShoppingBagIcon
false
shoppingBagIcon
ShoppingBagIcon.Default
feedTitlePosition
NESTED
aspectRatio
9:16
Layout Type Examples
Horizontal Layout
Displays videos in a single horizontal scrolling row.
Vertical Layout
Displays videos in a single vertical scrolling column.
Grid Layout
Displays videos in a multi-column grid.
Complete Examples
Modern Grid Feed
Horizontal Story Feed
Product Gallery Grid
Important Notes
columnCountonly affects grid layoutsroundedCornerRadiusonly applies whenroundedCorneristrueItem spacing is in pixels - use
dpToPx()for density-independent valuesAspect ratio can be calculated as
width.0 / height.0Background color affects the feed container, not individual thumbnails
Layout changes require re-initializing the feed view
See Also
ViewOptions Overview - Complete configuration system
BaseOption - Content source configuration
FwVideoFeedView - Video feed widget
TitleOption - Feed title styling
Last updated
Was this helpful?