Skip to content

Instantly share code, notes, and snippets.

/.java Secret

Created May 5, 2016 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/fa08fd2208e08064e58922f5e15ec32f to your computer and use it in GitHub Desktop.
Save anonymous/fa08fd2208e08064e58922f5e15ec32f to your computer and use it in GitHub Desktop.
//In Adapter Class
@Override
public void liked(LikeButton likeButton) {
QuestionData questionHolder = data.get(position);
Voting voting = new Voting(getAdapterPosition(), ViewpagerAdapter.this, questionId, questionHolder);
voting.onUpVote();
voting.realTimeUpVoting();
}
//In Voting Class
public void realTimeDownVoting(){
System.out.println("VoteDownBefore="+mQuestionData.getVotes());
String voteString= mQuestionData.getVotes();
int voteNumber=((Integer.parseInt(voteString))-1);
mQuestionData.setVotes("" + voteNumber);
System.out.println("VoteDownAfter=" + mQuestionData.getVotes());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment