diff options
| author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-09-08 18:08:36 -0700 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2011-09-08 20:19:48 -0700 |
| commit | a53efe9923bedab4fe5d578f32eaff308e5b9e76 (patch) | |
| tree | b96e4c8cd21e71f5c1e4d29aee3e07353af64ac4 /core/java/android/widget/TimePicker.java | |
| parent | 5e8752595f7a3d3dd1e0d469ac275295e38bcfe1 (diff) | |
The time and data pickers did not support IME editor action correctly.
1. Updated TextView to traverse all focusable items. It was searching focus
down and up and was missing right and left focusabled. Updated the focus
seach to use FOCUS_FORWARD and FOCUS_BACKWARD - now all focusable views
are visited.
2. TimePicker and DatePicker were not specifying the IME options for
the next and done editor actions.
bug:5264046
Change-Id: Ief80863fc312582f2f76928bf6e915f620c427e5
Diffstat (limited to 'core/java/android/widget/TimePicker.java')
| -rw-r--r-- | core/java/android/widget/TimePicker.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java index 23502299c7c1..7865d5008f04 100644 --- a/core/java/android/widget/TimePicker.java +++ b/core/java/android/widget/TimePicker.java @@ -16,8 +16,6 @@ package android.widget; -import com.android.internal.R; - import android.annotation.Widget; import android.content.Context; import android.content.res.Configuration; @@ -30,8 +28,11 @@ import android.view.LayoutInflater; import android.view.View; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; +import android.view.inputmethod.EditorInfo; import android.widget.NumberPicker.OnValueChangeListener; +import com.android.internal.R; + import java.text.DateFormatSymbols; import java.util.Calendar; import java.util.Locale; @@ -149,6 +150,8 @@ public class TimePicker extends FrameLayout { onTimeChanged(); } }); + EditText hourInput = (EditText) mHourSpinner.findViewById(R.id.numberpicker_input); + hourInput.setImeOptions(EditorInfo.IME_ACTION_NEXT); // divider (only for the new widget style) mDivider = (TextView) findViewById(R.id.divider); @@ -184,6 +187,8 @@ public class TimePicker extends FrameLayout { onTimeChanged(); } }); + EditText minuteInput = (EditText) mMinuteSpinner.findViewById(R.id.numberpicker_input); + minuteInput.setImeOptions(EditorInfo.IME_ACTION_NEXT); /* Get the localized am/pm strings and use them in the spinner */ mAmPmStrings = new DateFormatSymbols().getAmPmStrings(); @@ -214,6 +219,8 @@ public class TimePicker extends FrameLayout { } }); } + EditText amPmInput = (EditText) mAmPmSpinner.findViewById(R.id.numberpicker_input); + amPmInput.setImeOptions(EditorInfo.IME_ACTION_DONE); // update controls to initial state updateHourControl(); |
