Listen to user actions

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

VFPreviewCommentsFragment previewCommentsFragment = VFPreviewCommentsFragment.newInstance(articleViewModel.getStory().getContainerId(), articleMetadata, this, vfSettings);
previewCommentsFragment.setActionCallback(this);
val previewCommentsFragment = VFPreviewCommentsFragment.newInstance(articleViewModel.getStory().getContainerId(), articleMetadata, this, vfSettings)
previewCommentsFragment.setActionCallback(this)
VFNewCommentFragment newCommentFragment = VFNewCommentFragment.newInstance(newCommentAction, getIntent().getStringExtra(IntentKeys.INTENT_CONTAINER_ID), articleMetadata, this, vfSettings);
newCommentFragment.setActionCallback(this);
val newCommentFragment = VFNewCommentFragment.newInstance(newCommentAction, getIntent().getStringExtra(IntentKeys.INTENT_CONTAINER_ID), articleMetadata, this, vfSettings)
newCommentFragment.setActionCallback(this)
VFProfileFragment profileFragment = VFProfileFragment.newInstance(UUID.fromString(getIntent().getStringExtra(IntentKeys.INTENT_USER_UUID)), ProfileViewModel.VFProfilePresentationType.profile, this, vfSettings);
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

VFActionData

ValueTypeDescription
profileUserUUIDVFOpenProfileActionUser UUID of the profile to open
openProfileActionVFNewCommentActionInformation about the new comment action
trendingPressedActionVFTrendingPressedAction
notificationPresentationActionVFNotificationPresentationAction

What’s Next