Listen to user actions

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

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

VFActionData

ValueTypeDescription
profileUserUUIDUUIDUser UUID of the profile to open
newCommentActionVFNewCommentActionInformation about the new comment action

What’s Next