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
Value | Type | Description |
---|---|---|
profileUserUUID | VFOpenProfileAction | User UUID of the profile to open |
openProfileAction | VFNewCommentAction | Information about the new comment action |
trendingPressedAction | VFTrendingPressedAction | |
notificationPresentationAction | VFNotificationPresentationAction | |
authPromptType | VFAuthPromptType | Where does the auth action come from |
Updated 20 days ago
What’s Next