-
-
Save anonymous/fa08fd2208e08064e58922f5e15ec32f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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