WidgetView

WidgetView

class WidgetView

Fields

Name Description
var widgetLifeCycleEventsListener: WidgetLifeCycleEventsListener?
var enableDefaultWidgetTransition: Boolean
var widgetViewFactory: LiveLikeWidgetViewFactory?

Constructors

<init>

constructor(context: Context, attr: AttributeSet)

Parameters

Name Description
context: Context
attr: AttributeSet

Methods

setSession

fun setSession(session: LiveLikeContentSession)

Parameters

Name Description
session: LiveLikeContentSession

ReturnValue

Name Description
Unit

applyTheme

fun applyTheme(theme: LiveLikeEngagementTheme)

will update the value of theme to be applied for all widgets This will update the theme on the current displayed widget as well

Parameters

Name Description
theme: LiveLikeEngagementTheme

ReturnValue

Name Description
Unit

applyTheme

fun applyTheme(themeJson: JsonObject): Result<Boolean>

this method parse livelike theme from json object and apply if its a valid json refer @applyTheme(theme)

Parameters

Name Description
themeJson: JsonObject

ReturnValue

Name Description
Result<Boolean>

onMeasure

fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Parameters

Name Description
widthMeasureSpec: Int
heightMeasureSpec: Int

ReturnValue

Name Description
Unit

setWidgetListener

fun setWidgetListener(widgetListener: WidgetListener)

Parameters

Name Description
widgetListener: WidgetListener

ReturnValue

Name Description
Unit

displayWidget

fun displayWidget(sdk: EngagementSDK, liveLikeWidget: LiveLikeWidget)

Parameters

Name Description
sdk: EngagementSDK
liveLikeWidget: LiveLikeWidget

ReturnValue

Name Description
Unit

displayWidget

fun displayWidget(sdk: EngagementSDK, widgetResourceJson: JsonObject)

displays the widget in the container throws error if json invalid clears the previous displayed widget (if any) only clears if json is valid

Parameters

Name Description
sdk: EngagementSDK
widgetResourceJson: JsonObject

ReturnValue

Name Description
Unit

clearWidget

fun clearWidget()

ReturnValue

Name Description
Unit

getCurrentState

fun getCurrentState(): WidgetStates?

ReturnValue

Name Description
WidgetStates?

setState

fun setState(widgetStates: WidgetStates)

Parameters

Name Description
widgetStates: WidgetStates

ReturnValue

Name Description
Unit

moveToNextState

fun moveToNextState()

ReturnValue

Name Description
Unit