Custom UI

Customize the UI components in your app

The VFCustomUIDelegate allows you to customize the UI components, by giving you direct references to them.

PreviewCommentsFragment previewCommentsFragment = PreviewCommentsFragment.newInstance(articleViewModel.getStory().getContainerId(), articleMetadata, this, vfSettings);
previewCommentsFragment.setCustomUICallback(this);
val previewCommentsFragment = PreviewCommentsFragment.newInstance(
    articleViewModel.getStory().getContainerId(),
    articleMetadata,
    this,
    vfSettings
)
previewCommentsFragment.setCustomUICallback(this)

Implement the VFCustomUIInterface.

@Override
 public void customizeView(VFCustomViewType customViewType, View view) {
     switch (customViewType) {
         case commentCellCommentText:
             VFTextView commentTextView = (VFTextView) view;
             commentTextView.setTextColor(Color.RED);
             break;
     }
 }
fun customizeView(customViewType: VFCustomViewType ? , view : View) {
    when(customViewType) {
        VFCustomViewType.commentCellCommentText - > {
            val commentTextView = view as VFTextView
            commentTextView.setTextColor(Color.RED)
        }
    }
}

Customizable views

VFCustomViewTypeView typeDescription
commentCellDislikeImageVFImageView
commentCellDislikeTextVFTextView
commentCellLikeImageVFImageView
commentCellLikeTextVFTextView
commentCellDateTextVFTextView
commentCellUserTextVFTextVIew
commentCellCommentTextVFTextView
commentCellReplyTextVFTextView

What’s Next