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
Value | Type | Description |
---|---|---|
profileUserUUID | VFOpenProfileAction | User UUID of the profile to open |
openProfileAction | VFNewCommentAction | Information about the new comment action |
trendingPressedAction | VFTrendingPressedAction | |
notificationPresentationAction | VFNotificationPresentationAction |
Updated 11 months ago
What’s Next