Package com.zendesk.sdk.support
Class ArticleVotingView
- java.lang.Object
-
- RelativeLayout
-
- com.zendesk.sdk.support.ArticleVotingView
-
public class ArticleVotingView extends RelativeLayout
This view provides voting functionality for a Help Center article. Articles can be voted up or down, and this vote is persisted usingArticleVoteStorage
. The article's ID must be bound to the view usingArticleVotingView.bindTo(Long, ArticleVoteStorage)
before the View can be used. The supplied value should be the return value of eitherArticle.getId()
orSimpleArticle.getId()
.
-
-
Constructor Summary
Constructors Constructor and Description ArticleVotingView(Context context)
ArticleVotingView(Context context, AttributeSet attrs)
ArticleVotingView(Context context, AttributeSet attrs, int defStyleAttr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
bindTo(java.lang.Long articleId, ArticleVoteStorage articleVoteStorage)
Binds the given article ID and article vote storage to this voting view, so that all votes cast through this view will be votes on that article, and the vote information will be persisted in the supplied storage.
-
-
-
Method Detail
-
bindTo
public void bindTo(java.lang.Long articleId, ArticleVoteStorage articleVoteStorage)
Binds the given article ID and article vote storage to this voting view, so that all votes cast through this view will be votes on that article, and the vote information will be persisted in the supplied storage. If there is a vote for this article already in storage (if the user has previously voted on this article, on this device), it will be loaded and the appropriate button will show as "pressed". Make sure to call this method before attempting to use the view.- Parameters:
articleId
- the ID for the article all votes should be cast on.articleVoteStorage
- the storage to be used for persisting the article's vote.
-
-