Class ArticleVotingView

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArticleVotingView

        public ArticleVotingView(Context context)
      • ArticleVotingView

        public ArticleVotingView(Context context,
                                 AttributeSet attrs)
      • ArticleVotingView

        public ArticleVotingView(Context context,
                                 AttributeSet attrs,
                                 int defStyleAttr)
    • 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.