The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.widget; |
| 18 | |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
Alan Viverette | 518ff0d | 2014-08-15 14:20:35 -0700 | [diff] [blame] | 20 | import android.annotation.Nullable; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | import android.annotation.Widget; |
| 22 | import android.content.Context; |
Svetoslav Ganov | f592696 | 2011-07-12 12:26:20 -0700 | [diff] [blame] | 23 | import android.content.res.Configuration; |
Svetoslav Ganov | 4243dc3 | 2011-01-18 19:39:57 -0800 | [diff] [blame] | 24 | import android.content.res.TypedArray; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.os.Parcelable; |
| 26 | import android.util.AttributeSet; |
Svetoslav Ganov | 8a2a895 | 2011-01-27 17:40:13 -0800 | [diff] [blame] | 27 | import android.view.accessibility.AccessibilityEvent; |
Svetoslav Ganov | a53efe9 | 2011-09-08 18:08:36 -0700 | [diff] [blame] | 28 | import com.android.internal.R; |
| 29 | |
Svetoslav Ganov | f592696 | 2011-07-12 12:26:20 -0700 | [diff] [blame] | 30 | import java.util.Locale; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | |
Alan Viverette | b3f2463 | 2015-10-22 16:01:48 -0400 | [diff] [blame] | 32 | import libcore.icu.LocaleData; |
| 33 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | /** |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 35 | * A widget for selecting the time of day, in either 24-hour or AM/PM mode. |
Alan Viverette | 5134478 | 2014-07-16 17:39:27 -0700 | [diff] [blame] | 36 | * <p> |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 37 | * For a dialog using this view, see {@link android.app.TimePickerDialog}. See |
| 38 | * the <a href="{@docRoot}guide/topics/ui/controls/pickers.html">Pickers</a> |
| 39 | * guide for more information. |
| 40 | * |
| 41 | * @attr ref android.R.styleable#TimePicker_timePickerMode |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | */ |
| 43 | @Widget |
| 44 | public class TimePicker extends FrameLayout { |
Chet Haase | 3053b2f | 2014-08-06 07:51:50 -0700 | [diff] [blame] | 45 | private static final int MODE_SPINNER = 1; |
| 46 | private static final int MODE_CLOCK = 2; |
| 47 | |
Alan Viverette | 5134478 | 2014-07-16 17:39:27 -0700 | [diff] [blame] | 48 | private final TimePickerDelegate mDelegate; |
Fabrice Di Meglio | eeff63a | 2013-08-05 12:07:24 -0700 | [diff] [blame] | 49 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | /** |
| 51 | * The callback interface used to indicate the time has been adjusted. |
| 52 | */ |
| 53 | public interface OnTimeChangedListener { |
| 54 | |
| 55 | /** |
| 56 | * @param view The view associated with this listener. |
| 57 | * @param hourOfDay The current hour. |
| 58 | * @param minute The current minute. |
| 59 | */ |
| 60 | void onTimeChanged(TimePicker view, int hourOfDay, int minute); |
| 61 | } |
| 62 | |
| 63 | public TimePicker(Context context) { |
| 64 | this(context, null); |
| 65 | } |
Svetoslav Ganov | 4243dc3 | 2011-01-18 19:39:57 -0800 | [diff] [blame] | 66 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 67 | public TimePicker(Context context, AttributeSet attrs) { |
Svetoslav Ganov | 4243dc3 | 2011-01-18 19:39:57 -0800 | [diff] [blame] | 68 | this(context, attrs, R.attr.timePickerStyle); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | } |
| 70 | |
Alan Viverette | 617feb9 | 2013-09-09 18:09:13 -0700 | [diff] [blame] | 71 | public TimePicker(Context context, AttributeSet attrs, int defStyleAttr) { |
| 72 | this(context, attrs, defStyleAttr, 0); |
| 73 | } |
| 74 | |
| 75 | public TimePicker(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { |
| 76 | super(context, attrs, defStyleAttr, defStyleRes); |
Fabrice Di Meglio | eeff63a | 2013-08-05 12:07:24 -0700 | [diff] [blame] | 77 | |
Alan Viverette | 5134478 | 2014-07-16 17:39:27 -0700 | [diff] [blame] | 78 | final TypedArray a = context.obtainStyledAttributes( |
| 79 | attrs, R.styleable.TimePicker, defStyleAttr, defStyleRes); |
Alan Viverette | 518ff0d | 2014-08-15 14:20:35 -0700 | [diff] [blame] | 80 | final int mode = a.getInt(R.styleable.TimePicker_timePickerMode, MODE_SPINNER); |
Fabrice Di Meglio | dfaa6c7 | 2014-07-10 19:33:33 -0700 | [diff] [blame] | 81 | a.recycle(); |
| 82 | |
Chet Haase | 3053b2f | 2014-08-06 07:51:50 -0700 | [diff] [blame] | 83 | switch (mode) { |
| 84 | case MODE_CLOCK: |
Alan Viverette | daf33ed | 2014-10-23 13:34:17 -0700 | [diff] [blame] | 85 | mDelegate = new TimePickerClockDelegate( |
Chet Haase | 3053b2f | 2014-08-06 07:51:50 -0700 | [diff] [blame] | 86 | this, context, attrs, defStyleAttr, defStyleRes); |
| 87 | break; |
| 88 | case MODE_SPINNER: |
| 89 | default: |
Alan Viverette | daf33ed | 2014-10-23 13:34:17 -0700 | [diff] [blame] | 90 | mDelegate = new TimePickerSpinnerDelegate( |
Chet Haase | 3053b2f | 2014-08-06 07:51:50 -0700 | [diff] [blame] | 91 | this, context, attrs, defStyleAttr, defStyleRes); |
| 92 | break; |
Fabrice Di Meglio | dfaa6c7 | 2014-07-10 19:33:33 -0700 | [diff] [blame] | 93 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 94 | } |
Svetoslav Ganov | 50f34d1 | 2010-12-03 16:05:40 -0800 | [diff] [blame] | 95 | |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 96 | /** |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 97 | * Sets the currently selected hour using 24-hour time. |
| 98 | * |
| 99 | * @param hour the hour to set, in the range (0-23) |
| 100 | * @see #getHour() |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 101 | */ |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 102 | public void setHour(int hour) { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 103 | mDelegate.setHour(hour); |
Fabrice Di Meglio | 64902bd | 2013-08-15 17:49:49 -0700 | [diff] [blame] | 104 | } |
| 105 | |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 106 | /** |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 107 | * Returns the currently selected hour using 24-hour time. |
| 108 | * |
| 109 | * @return the currently selected hour, in the range (0-23) |
| 110 | * @see #setHour(int) |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 111 | */ |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 112 | public int getHour() { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 113 | return mDelegate.getHour(); |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Sets the currently selected minute.. |
| 118 | * |
| 119 | * @param minute the minute to set, in the range (0-59) |
| 120 | * @see #getMinute() |
| 121 | */ |
| 122 | public void setMinute(int minute) { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 123 | mDelegate.setMinute(minute); |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Returns the currently selected minute. |
| 128 | * |
| 129 | * @return the currently selected minute, in the range (0-59) |
| 130 | * @see #setMinute(int) |
| 131 | */ |
| 132 | public int getMinute() { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 133 | return mDelegate.getMinute(); |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Sets the current hour. |
| 138 | * |
| 139 | * @deprecated Use {@link #setHour(int)} |
| 140 | */ |
| 141 | @Deprecated |
| 142 | public void setCurrentHour(@NonNull Integer currentHour) { |
| 143 | setHour(currentHour); |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * @return the current hour in the range (0-23) |
| 148 | * @deprecated Use {@link #getHour()} |
| 149 | */ |
| 150 | @NonNull |
| 151 | @Deprecated |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 152 | public Integer getCurrentHour() { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 153 | return mDelegate.getHour(); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 154 | } |
Fabrice Di Meglio | 64902bd | 2013-08-15 17:49:49 -0700 | [diff] [blame] | 155 | |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 156 | /** |
| 157 | * Set the current minute (0-59). |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 158 | * |
| 159 | * @deprecated Use {@link #setMinute(int)} |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 160 | */ |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 161 | @Deprecated |
| 162 | public void setCurrentMinute(@NonNull Integer currentMinute) { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 163 | mDelegate.setMinute(currentMinute); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | /** |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 167 | * @return the current minute |
| 168 | * @deprecated Use {@link #getMinute()} |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 169 | */ |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 170 | @NonNull |
| 171 | @Deprecated |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 172 | public Integer getCurrentMinute() { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 173 | return mDelegate.getMinute(); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | /** |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 177 | * Sets whether this widget displays time in 24-hour mode or 12-hour mode |
| 178 | * with an AM/PM picker. |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 179 | * |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 180 | * @param is24HourView {@code true} to display in 24-hour mode, |
| 181 | * {@code false} for 12-hour mode with AM/PM |
| 182 | * @see #is24HourView() |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 183 | */ |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 184 | public void setIs24HourView(@NonNull Boolean is24HourView) { |
| 185 | if (is24HourView == null) { |
| 186 | return; |
| 187 | } |
| 188 | |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 189 | mDelegate.setIs24Hour(is24HourView); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | /** |
Alan Viverette | 646a0f8 | 2015-03-18 13:24:07 -0700 | [diff] [blame] | 193 | * @return {@code true} if this widget displays time in 24-hour mode, |
| 194 | * {@code false} otherwise} |
| 195 | * @see #setIs24HourView(Boolean) |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 196 | */ |
| 197 | public boolean is24HourView() { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 198 | return mDelegate.is24Hour(); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Set the callback that indicates the time has been adjusted by the user. |
| 203 | * |
| 204 | * @param onTimeChangedListener the callback, should not be null. |
| 205 | */ |
| 206 | public void setOnTimeChangedListener(OnTimeChangedListener onTimeChangedListener) { |
| 207 | mDelegate.setOnTimeChangedListener(onTimeChangedListener); |
Fabrice Di Meglio | 64902bd | 2013-08-15 17:49:49 -0700 | [diff] [blame] | 208 | } |
| 209 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 210 | @Override |
| 211 | public void setEnabled(boolean enabled) { |
| 212 | super.setEnabled(enabled); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 213 | mDelegate.setEnabled(enabled); |
Svetoslav Ganov | 51c52ed | 2010-12-28 13:45:03 -0800 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | @Override |
| 217 | public boolean isEnabled() { |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 218 | return mDelegate.isEnabled(); |
| 219 | } |
| 220 | |
| 221 | @Override |
| 222 | public int getBaseline() { |
| 223 | return mDelegate.getBaseline(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 224 | } |
| 225 | |
Svetoslav Ganov | f592696 | 2011-07-12 12:26:20 -0700 | [diff] [blame] | 226 | @Override |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 227 | protected Parcelable onSaveInstanceState() { |
| 228 | Parcelable superState = super.onSaveInstanceState(); |
| 229 | return mDelegate.onSaveInstanceState(superState); |
| 230 | } |
| 231 | |
| 232 | @Override |
| 233 | protected void onRestoreInstanceState(Parcelable state) { |
Fabrice Di Meglio | eeff63a | 2013-08-05 12:07:24 -0700 | [diff] [blame] | 234 | BaseSavedState ss = (BaseSavedState) state; |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 235 | super.onRestoreInstanceState(ss.getSuperState()); |
| 236 | mDelegate.onRestoreInstanceState(ss); |
| 237 | } |
| 238 | |
Dianne Hackborn | a7bb6fb | 2015-02-03 18:13:40 -0800 | [diff] [blame] | 239 | @Override |
| 240 | public CharSequence getAccessibilityClassName() { |
| 241 | return TimePicker.class.getName(); |
| 242 | } |
| 243 | |
Alan Viverette | a54956a | 2015-01-07 16:05:02 -0800 | [diff] [blame] | 244 | /** @hide */ |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 245 | @Override |
Alan Viverette | a54956a | 2015-01-07 16:05:02 -0800 | [diff] [blame] | 246 | public boolean dispatchPopulateAccessibilityEventInternal(AccessibilityEvent event) { |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 247 | return mDelegate.dispatchPopulateAccessibilityEvent(event); |
| 248 | } |
| 249 | |
Svetoslav Ganov | f592696 | 2011-07-12 12:26:20 -0700 | [diff] [blame] | 250 | /** |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 251 | * A delegate interface that defined the public API of the TimePicker. Allows different |
| 252 | * TimePicker implementations. This would need to be implemented by the TimePicker delegates |
| 253 | * for the real behavior. |
Svetoslav Ganov | f592696 | 2011-07-12 12:26:20 -0700 | [diff] [blame] | 254 | */ |
Fabrice Di Meglio | eeff63a | 2013-08-05 12:07:24 -0700 | [diff] [blame] | 255 | interface TimePickerDelegate { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 256 | void setHour(int hour); |
| 257 | int getHour(); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 258 | |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 259 | void setMinute(int minute); |
| 260 | int getMinute(); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 261 | |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 262 | void setIs24Hour(boolean is24Hour); |
| 263 | boolean is24Hour(); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 264 | |
| 265 | void setOnTimeChangedListener(OnTimeChangedListener onTimeChangedListener); |
| 266 | |
| 267 | void setEnabled(boolean enabled); |
| 268 | boolean isEnabled(); |
| 269 | |
| 270 | int getBaseline(); |
| 271 | |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 272 | Parcelable onSaveInstanceState(Parcelable superState); |
| 273 | void onRestoreInstanceState(Parcelable state); |
| 274 | |
| 275 | boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event); |
| 276 | void onPopulateAccessibilityEvent(AccessibilityEvent event); |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 277 | } |
| 278 | |
Alan Viverette | b3f2463 | 2015-10-22 16:01:48 -0400 | [diff] [blame] | 279 | static String[] getAmPmStrings(Context context) { |
| 280 | final Locale locale = context.getResources().getConfiguration().locale; |
| 281 | final LocaleData d = LocaleData.get(locale); |
| 282 | |
| 283 | final String[] result = new String[2]; |
| 284 | result[0] = d.amPm[0].length() > 4 ? d.narrowAm : d.amPm[0]; |
| 285 | result[1] = d.amPm[1].length() > 4 ? d.narrowPm : d.amPm[1]; |
| 286 | return result; |
| 287 | } |
| 288 | |
Fabrice Di Meglio | eeff63a | 2013-08-05 12:07:24 -0700 | [diff] [blame] | 289 | /** |
| 290 | * An abstract class which can be used as a start for TimePicker implementations |
| 291 | */ |
| 292 | abstract static class AbstractTimePickerDelegate implements TimePickerDelegate { |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 293 | protected final TimePicker mDelegator; |
| 294 | protected final Context mContext; |
| 295 | protected final Locale mLocale; |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 296 | |
Alan Viverette | 518ff0d | 2014-08-15 14:20:35 -0700 | [diff] [blame] | 297 | protected OnTimeChangedListener mOnTimeChangedListener; |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 298 | |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 299 | public AbstractTimePickerDelegate(@NonNull TimePicker delegator, @NonNull Context context) { |
Fabrice Di Meglio | 9e4009e | 2013-08-19 13:16:46 -0700 | [diff] [blame] | 300 | mDelegator = delegator; |
Fabrice Di Meglio | eeff63a | 2013-08-05 12:07:24 -0700 | [diff] [blame] | 301 | mContext = context; |
Alan Viverette | 4420ae8 | 2015-11-16 16:10:56 -0500 | [diff] [blame] | 302 | mLocale = context.getResources().getConfiguration().locale; |
Alan Viverette | 518ff0d | 2014-08-15 14:20:35 -0700 | [diff] [blame] | 303 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 304 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 305 | } |