Skip to content

Commit 165a6ba

Browse files
committed
Fix java and android examples after slight api tweak.
1 parent e9082cd commit 165a6ba

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

example-android/src/main/java/com/seatgeek/sixpack/android/SixpackActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public class SixpackActivity extends ActionBarActivity {
3838

3939
buttonColor.participate(
4040
new OnParticipationSuccess() {
41-
@Override public void onParticipation(final ParticipatingExperiment experiment, Alternative selectedAlternative) {
42-
if (SixpackModule.BUTTON_COLOR_RED.equals(selectedAlternative.getName())) {
41+
@Override public void onParticipation(final ParticipatingExperiment experiment) {
42+
if (SixpackModule.BUTTON_COLOR_RED.equals(experiment.getSelectedAlternative().getName())) {
4343
colorfulButton.setBackgroundColor(Color.RED);
44-
} else if (SixpackModule.BUTTON_COLOR_BLUE.equals(selectedAlternative.getName())) {
44+
} else if (SixpackModule.BUTTON_COLOR_BLUE.equals(experiment.getSelectedAlternative().getName())) {
4545
colorfulButton.setBackgroundColor(Color.BLUE);
4646
}
4747

example-java/src/main/java/com/seatgeek/sixpack/examplejava/SixpackTestJava.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public static void main(String[] args) {
2929

3030
// participate in the new experiment
3131
pillColor.participate(
32-
(participatingExperiment, selectedAlternative) -> {
32+
(participatingExperiment) -> {
3333
// We successfully participated, now we can use the alternative specified by Sixpack
34-
System.out.println("Will you take a " + selectedAlternative.getName() + " pill? [y/n]");
34+
System.out.println("Will you take a " + participatingExperiment.getSelectedAlternative().getName() + " pill? [y/n]");
3535
String answer = new Scanner(System.in).nextLine();
3636

3737
if ("y".equalsIgnoreCase(answer)) {

0 commit comments

Comments
 (0)