package org.robolectric.shadows;

import android.widget.NumberPicker;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.Implementation;

@Implements(NumberPicker.class)
public class ShadowNumberPicker extends ShadowLinearLayout {
  private int value;
  private int minValue;
  private int maxValue;
  private boolean wrapSelectorWheel;
  private String[] displayedValues;

  @Implementation
  public void setValue(int value) {
    this.value = value;
  }

  @Implementation
  public int getValue() {
    return value;
  }

  @Implementation
  public void setDisplayedValues(String[] displayedValues) {
    if (displayedValues != null && displayedValues.length != (maxValue - minValue) + 1) {
      throw new RuntimeException("Displayed values should fit into range min and max values");
    }
    this.displayedValues = displayedValues;
  }

  @Implementation
  public String[] getDisplayedValues() {
    return displayedValues;
  }

  @Implementation
  public void setMinValue(int minValue) {
    this.minValue = minValue;
  }

  @Implementation
  public void setMaxValue(int maxValue) {
    this.maxValue = maxValue;
  }

  @Implementation
  public int getMinValue() {
    return this.minValue;
  }

  @Implementation
  public int getMaxValue() {
    return this.maxValue;
  }

  @Implementation
  public void setWrapSelectorWheel(boolean wrapSelectorWheel) {
    this.wrapSelectorWheel = wrapSelectorWheel;
  }

  @Implementation
  public boolean getWrapSelectorWheel() {
    return wrapSelectorWheel;
  }
}

@@ -106,17 +106,21 @@
 mplement
-s
+ation
 ;%0Aimport
@@ -156,21 +156,17 @@
 mplement
-ation
+s
 ;%0A%0A@Impl
@@ -394,16 +394,84 @@
 dValues;
+%0A  private NumberPicker.OnValueChangeListener onValueChangeListener;
 %0A%0A  @Imp
@@ -1599,11 +1599,276 @@
 eel;%0A  %7D
+%0A%0A  @Implementation%0A  public void setOnValueChangedListener(NumberPicker.OnValueChangeListener listener) %7B%0A    this.onValueChangeListener = listener;%0A  %7D%0A%0A  public NumberPicker.OnValueChangeListener getOnValueChangeListener() %7B%0A    return onValueChangeListener;%0A  %7D
 %0A%7D%0A

Add OnValueChangeListener property to ShadowNumberPicker