Skip to content

Commit

Permalink
passed like button to listener
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-alexander committed Jan 3, 2016
1 parent 1fdca28 commit 0cb97db
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ dependencies {
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.mikepenz:iconics-core:2.5.2@aar'
compile 'com.mikepenz:community-material-typeface:1.3.41.1@aar'
//compile 'com.github.jd-alexander:LikeButton:0.1.2'
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/like/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

@Override
public void liked() {
public void liked(LikeButton likeButton) {
Toast.makeText(this, "Liked!", Toast.LENGTH_SHORT).show();
}

@Override
public void unLiked() {
public void unLiked(LikeButton likeButton) {
Toast.makeText(this, "Disliked!", Toast.LENGTH_SHORT).show();
}
}
4 changes: 2 additions & 2 deletions likebutton/src/main/java/com/like/LikeButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ public void onClick(View v) {

if (likeListener != null) {
if (isChecked) {
likeListener.liked();
likeListener.liked(this);
} else {
likeListener.unLiked();
likeListener.unLiked(this);
}
}

Expand Down
4 changes: 2 additions & 2 deletions likebutton/src/main/java/com/like/OnLikeListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* Created by Joel on 23/12/2015.
*/
public interface OnLikeListener {
void liked();
void unLiked();
void liked(LikeButton likeButton);
void unLiked(LikeButton likeButton);
}

0 comments on commit 0cb97db

Please sign in to comment.