OSDN Git Service

NumberPicker should not play initial animation while in edit mode
authorSvetoslav Ganov <svetoslavganov@google.com>
Wed, 2 Feb 2011 23:06:36 +0000 (15:06 -0800)
committerSvetoslav Ganov <svetoslavganov@google.com>
Wed, 2 Feb 2011 23:17:24 +0000 (15:17 -0800)
bug:3417930

1. Added a check if the widget is in edit mode to determine if to
   play the initial annimation.

Change-Id: Ibcf23fa1ec55a1950323e71eda90da6418b655fb

core/java/android/widget/NumberPicker.java

index c5b1caa..8e660ff 100644 (file)
@@ -583,7 +583,7 @@ public class NumberPicker extends LinearLayout {
         updateInputTextView();
         updateIncrementAndDecrementButtonsVisibilityState();
 
-        if (mFlingable) {
+        if (mFlingable && !isInEditMode()) {
             // Start with shown selector wheel and hidden controls. When made
             // visible hide the selector and fade-in the controls to suggest
             // fling interaction.
@@ -1056,7 +1056,7 @@ public class NumberPicker extends LinearLayout {
         super.onAttachedToWindow();
         // make sure we show the controls only the very
         // first time the user sees this widget
-        if (mFlingable) {
+        if (mFlingable && !isInEditMode()) {
             // animate a bit slower the very first time
             showInputControls(mShowInputControlsAnimimationDuration * 2);
         }