Skip to content

Commit

Permalink
Merge pull request #11 from mediavrog/8-nudge-event
Browse files Browse the repository at this point in the history
fixes #8 proper call to onDismiss and onAccept in nudge state
  • Loading branch information
mediavrog authored Aug 11, 2016
2 parents 0526c6f + af48dc5 commit e6fffd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/net/mediavrog/irr/IrrLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void enableFlowControls() {
@Override
public void onClick(View v) {
if (mDecisionListener != null)
mDecisionListener.onDismiss(getContext(), State.NUDGE);
mDecisionListener.onAccept(getContext(), State.NUDGE);
setState(State.RATE);
}
});
Expand All @@ -314,7 +314,7 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
if (mDecisionListener != null)
mDecisionListener.onAccept(getContext(), State.NUDGE);
mDecisionListener.onDismiss(getContext(), State.NUDGE);
setState(State.FEEDBACK);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public String toString(boolean evaluate) {
irr.setOnUserDecisionListener(new IrrLayout.OnUserDecisionListener() {
@Override
public void onAccept(Context ctx, IrrLayout.State s) {
Toast.makeText(ctx, "Accepted sth in state " + s.toString(), Toast.LENGTH_LONG).show();
Toast.makeText(ctx, "Accepted in state " + s.toString(), Toast.LENGTH_LONG).show();
}

@Override
public void onDismiss(Context ctx, IrrLayout.State s) {
Toast.makeText(ctx, "Dismissed sth in state " + s.toString(), Toast.LENGTH_LONG).show();
Toast.makeText(ctx, "Dismissed in state " + s.toString(), Toast.LENGTH_LONG).show();
}
});

Expand Down

0 comments on commit e6fffd0

Please sign in to comment.