Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -47203,6 +47203,7 @@ package android.widget { ctor public NumberPicker(android.content.Context, android.util.AttributeSet); ctor public NumberPicker(android.content.Context, android.util.AttributeSet, int); ctor public NumberPicker(android.content.Context, android.util.AttributeSet, int, int); method public java.lang.CharSequence getDisplayedValueForCurrentSelection(); method public java.lang.String[] getDisplayedValues(); method public int getMaxValue(); method public int getMinValue(); core/java/android/widget/NumberPicker.java +17 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.widget; import android.annotation.CallSuper; import android.annotation.IntDef; import android.annotation.TestApi; import android.annotation.Widget; import android.content.Context; import android.content.res.ColorStateList; Loading Loading @@ -1507,6 +1508,22 @@ public class NumberPicker extends LinearLayout { tryComputeMaxWidth(); } /** * Retrieves the displayed value for the current selection in this picker. * * @hide */ @TestApi public CharSequence getDisplayedValueForCurrentSelection() { // The cache field itself is initialized at declaration time, and since it's final, it // can't be null here. The cache is updated in ensureCachedScrollSelectorValue which is // called, directly or indirectly, on every call to setDisplayedValues, setFormatter, // setMinValue, setMaxValue and setValue, as well as user-driven interaction with the // picker. As such, the contents of the cache are always synced to the latest state of // the widget. return mSelectorIndexToStringCache.get(getValue()); } @Override protected float getTopFadingEdgeStrength() { return TOP_AND_BOTTOM_FADING_EDGE_STRENGTH; Loading Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -47203,6 +47203,7 @@ package android.widget { ctor public NumberPicker(android.content.Context, android.util.AttributeSet); ctor public NumberPicker(android.content.Context, android.util.AttributeSet, int); ctor public NumberPicker(android.content.Context, android.util.AttributeSet, int, int); method public java.lang.CharSequence getDisplayedValueForCurrentSelection(); method public java.lang.String[] getDisplayedValues(); method public int getMaxValue(); method public int getMinValue();
core/java/android/widget/NumberPicker.java +17 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.widget; import android.annotation.CallSuper; import android.annotation.IntDef; import android.annotation.TestApi; import android.annotation.Widget; import android.content.Context; import android.content.res.ColorStateList; Loading Loading @@ -1507,6 +1508,22 @@ public class NumberPicker extends LinearLayout { tryComputeMaxWidth(); } /** * Retrieves the displayed value for the current selection in this picker. * * @hide */ @TestApi public CharSequence getDisplayedValueForCurrentSelection() { // The cache field itself is initialized at declaration time, and since it's final, it // can't be null here. The cache is updated in ensureCachedScrollSelectorValue which is // called, directly or indirectly, on every call to setDisplayedValues, setFormatter, // setMinValue, setMaxValue and setValue, as well as user-driven interaction with the // picker. As such, the contents of the cache are always synced to the latest state of // the widget. return mSelectorIndexToStringCache.get(getValue()); } @Override protected float getTopFadingEdgeStrength() { return TOP_AND_BOTTOM_FADING_EDGE_STRENGTH; Loading