VideoWidgetViewModel

class VideoWidgetViewModel(widgetInfos: WidgetInfos, analyticsService: AnalyticsService, networkApiClient: NetworkApiClient, onDismiss: () -> Unit, rewardItemMapCache: Map<String, RewardItem>, userProfileRewardDelegate: UserProfileDelegate?, dataStoreDelegate: DataStoreDelegate, viewModelDispatcher: CoroutineDispatcher, uiDispatcher: CoroutineDispatcher) : BaseViewModel, VideoAlertWidgetModel

Functions

dismissWidget
Link copied to clipboard
fun dismissWidget(action: DismissAction)
finish
Link copied to clipboard
open override fun finish()
call this to cleanup the viewModel and its association
getGamificationReward
Link copied to clipboard
suspend fun getGamificationReward(rewardUrl: String, analyticsService: AnalyticsService, userAccessToken: String): ProgramGamificationProfile?
isInteractivityExpired
Link copied to clipboard
fun isInteractivityExpired(interactiveUntil: String?): Boolean
checks if widgets expired interactive_until
markAsInteractive
Link copied to clipboard
open override fun markAsInteractive()
This will capture the analytics event Widget Became Interactive It should be called when the widget is opened first time for user interaction
onClear
Link copied to clipboard
open override fun onClear()
all models should override this to cleanup their resources
onVideoAlertClickLink
Link copied to clipboard
fun onVideoAlertClickLink(linkUrl: String)
registerPlayStarted
Link copied to clipboard
open override fun registerPlayStarted()
startDismissTimeout
Link copied to clipboard
fun startDismissTimeout(timeout: String, onDismiss: () -> Unit)
subscribeWidgetResults
Link copied to clipboard
inline fun <T : Any> subscribeWidgetResults(channelName: String, sdkConfiguration: SdkConfiguration, user: LiveLikeUser, widgetId: String, flow: MutableStateFlow<T?>)
trackWidgetEngagedAnalytics
Link copied to clipboard
fun trackWidgetEngagedAnalytics(currentWidgetType: WidgetType?, currentWidgetId: String, programId: String)
unsubscribeWidgetResults
Link copied to clipboard
fun unsubscribeWidgetResults()
videoAlertLinkClicked
Link copied to clipboard
open override fun videoAlertLinkClicked(url: String)
voteApi
Link copied to clipboard
fun voteApi(url: String, id: String, currentUserFlow: StateFlow<LiveLikeUser?>, patchVoteUrl: String? = null)

Properties

analyticsService
Link copied to clipboard
val analyticsService: AnalyticsService
currentWidgetType
Link copied to clipboard
var currentWidgetType: WidgetType? = null
dataFlow
Link copied to clipboard
val dataFlow: <ERROR CLASS>
dataStoreDelegate
Link copied to clipboard
val dataStoreDelegate: DataStoreDelegate
enableDefaultWidgetTransition
Link copied to clipboard
var enableDefaultWidgetTransition: Boolean = true
rewardType
Link copied to clipboard
var rewardType: String
selectedPositionFlow
Link copied to clipboard
val selectedPositionFlow: <ERROR CLASS>
selectionLockedFlow
Link copied to clipboard
val selectionLockedFlow: <ERROR CLASS>
showDismissButton
Link copied to clipboard
var showDismissButton: Boolean = true
showTimer
Link copied to clipboard
var showTimer: Boolean = true
subscribedWidgetChannelName
Link copied to clipboard
var subscribedWidgetChannelName: String? = null
subscribeResultJobs
Link copied to clipboard
var subscribeResultJobs: <ERROR CLASS>
timerStartTime
Link copied to clipboard
var timerStartTime: Long? = null
uiScope
Link copied to clipboard
val uiScope: <ERROR CLASS>
This is the main scope for all coroutines launched by MainViewModel.
userSelectedOptionIdFlow
Link copied to clipboard
val userSelectedOptionIdFlow: <ERROR CLASS>
viewModelScope
Link copied to clipboard
val viewModelScope: <ERROR CLASS>
widgetData
Link copied to clipboard
open override val widgetData: LiveLikeWidget
widget data holder
widgetInfos
Link copied to clipboard
val widgetInfos: WidgetInfos
widgetStateFlow
Link copied to clipboard
val widgetStateFlow: <ERROR CLASS>