Listen to user actions

Set the VFActionsInterface to the fragment you want to listen actions on

VFPreviewCommentsFragment previewCommentsFragment = [..];
previewCommentsFragment.setActionCallback(this);
val previewCommentsFragment = VFPreviewCommentsFragment.newInstance(articleViewModel.getStory().getContainerId(), articleMetadata, this, vfSettings)
previewCommentsFragment.setActionCallback(this)
VFNewCommentFragment newCommentFragment = [..];
newCommentFragment.setActionCallback(this);
val newCommentFragment = VFNewCommentFragment.newInstance(newCommentAction, getIntent().getStringExtra(IntentKeys.INTENT_CONTAINER_ID), articleMetadata, this, vfSettings)
newCommentFragment.setActionCallback(this)
VFProfileFragment profileFragment = [..];
profileFragment.setActionCallback(this);
val profileFragment = VFProfileFragment.newInstance(UUID.fromString(getIntent().getStringExtra(IntentKeys.INTENT_USER_UUID)), ProfileViewModel.VFProfilePresentationType.profile, this, vfSettings)
profileFragment.setActionCallback(this)

Implement the VFActionsInterface.

@Override
public void onNewAction(VFActionType actionType, VFActionData action) {
    if (actionType == VFActionType.closeNewCommentPressed) {
        onBackPressed();
    }
}
fun onNewAction(actionType: VFActionType, action: VFActionData ? ) {
    if (actionType == VFActionType.closeNewCommentPressed) {
        onBackPressed()
    }
}

VFActionType

seeMoreCommentsPressed
writeNewCommentPressed
closeNewCommentPressed
openProfilePressed
closeProfilePressed
notificationPressed
trendingArticlePressed
authPressed
commentPosted
`replyPosted

VFActionData

ValueTypeDescription
profileUserUUIDVFOpenProfileActionUser UUID of the profile to open
openProfileActionVFNewCommentActionInformation about the new comment action
trendingPressedActionVFTrendingPressedAction
notificationPresentationActionVFNotificationPresentationAction
authPromptTypeVFAuthPromptTypeWhere does the auth action come from

What’s Next