summaryrefslogtreecommitdiff
path: root/core/java/android/widget/TimePickerClockDelegate.java
Commit message (Collapse)AuthorAgeFilesLines
* Recycle obtained TypedArraysNikolas Havrikov2022-02-101-0/+1
| | | | | | Bug: 218835043 Test: make Change-Id: I34f53b8767b34b77a8a8246e9d3863854477feb6
* Merge "Remove unnecessary right padding from time picker" am: 71a1e5cfe1 am: ↵Tetsutoki Shiozawa2019-01-091-4/+9
|\ | | | | | | | | | | | | | | 314a239612 am: 3c2cafb1cb Change-Id: Iebb9f81a968093420c320afa2c6fab19e43833ad
| * Remove unnecessary right padding from time pickerTetsutoki Shiozawa2019-01-081-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Symptom: When the device language was set to Spanish, "A.M." label was not fully displayed on the time picker widget. "M." was lacked. Root cause: There are unnecessary right paddings on the layout definition of time picker. It uselessly consumes the room for ampm_layout. Bug: 64498105 Change-Id: Ie52fafc0fb7d6d6ea5b0ca2eaeb53755d4aebc19
* | Always use Context.getSystemService() to get IMMYohei Yukawa2018-09-171-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation to deprecate the following two methods. * InputMethodManager#getInstance() * InputMethodManager#peekInstance() Since we soon need to stop relying on the current per-process InputMethodManager singleton model to fully support multi-display, those two methods really need to be deprecated. With this CL, framework code no longer depends on InputMethodManager#peekInstance(), which is also marked as deprecated in this CL. InputMethodManager#getInstance() is a bit tricky because it also works as a constructor of such a per-process singleton instance. Remaining two call-sites of this method will be migrated in a subsequent CL. This is a mechanical refactoring, which in theory should have no observable logical behavior difference. There could be a small performance regression, but it is basically not avoidable to correctly support multi-display scenarios. Bug: 115891476 Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases Test: atest CtsWidgetTestCases:android.widget.cts.EditTextTest Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest Test: atest FrameworksCoreTests:com.android.internal.inputmethod Test: atest FrameworksServicesTests:com.android.server.textservices Change-Id: I5db31491f3d47d3ad4a621e956995135c72e007b
* Fix TimePicker separator l10n issue.David Ogutu2018-01-301-10/+47
| | | | | | | | | | | This was surfacing in the android clock with certain locales e.g. fr_CA. Fixed for all unqiue locale patterns. Bug: 71572309 Test: manual - changed locale to Fr_CA and made sure clock seperator WAI Test: atest CtsWidgetTestCases:TextViewTest CtsWidgetTestCases:EditTextTest CtsWidgetTestCases:TextViewFadingEdgeTest FrameworksCoreTests:TextViewFallbackLineSpacingTest FrameworksCoreTests:TextViewTest Change-Id: Ie43bf9428e8c5ef2fe2e9545cb5a6dada25d6e52
* Improved autofill support on DatePicker and TimePicker:Felipe Leme2017-08-151-10/+25
| | | | | | | | | | | | | - Save autofilled value so UI is properly highlighted. - Notify TimePicker listener just once. Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases Test: cts-tradefed run commandAndExit cts-dev -m CtsWidgetTestCases -t android.widget.cts.DatePickerTest Test: cts-tradefed run commandAndExit cts-dev -m CtsWidgetTestCases -t android.widget.cts.TimePickerTest Fixes: 37098837 Change-Id: I38d64c107f6059b94c92676ea37681006474f519
* Respect the locale in vertical location of AM/PMRoozbeh Pournader2017-07-061-28/+60
| | | | | | | | | | | | | | | | | | If the locale puts the AM/PM before the hour and minute in time formatting, make sure TimePicker respects that by putting the AM/PM above the hour and minute in landscape mode, where the AM/PM used to always appear below the hour and minute. Two sets of locales are affected. All of them put the AM/PM before the hour and minute, but the first set also defaults to 12-hour, so the change is most visible in these: Ewe, Chinese (both Simplified and Traditional, including Cantonese), Korean, and Tamil. The second set, Hungarian, Japanese, Myanmar, Sinhala, and Turkish, would only see the difference if the time picker is forced into 12-hour mode. Test: manual (tested en-US, ar-EG, ta-IN, zh-Hans-CN, ko-KR) Change-Id: Ic5840d46d81a004294bda4644df02c721152686b Fixes: 63352170
* Respect locale direction in TimePicker AM/PM locationRoozbeh Pournader2017-07-051-10/+19
| | | | | | | | | | Previously, the code that decided where the AM/PM indicator should end up relative to the hours and minutes assumed that the locale was LTR. Now it works correctly for RTL locales too. Bug: 62846484 Test: manual (tested adding an alarm under ar-EG, en-US, and ta-IN, all of which are 12-hour) Change-Id: I748baff01e2b3398747a2f8c074edbd16322bdf9
* Hide IME when switching to Radial Time PickerAurimas Liutikas2017-06-171-0/+5
| | | | | | | | | | | When switching back to the Radial Time Picker with an IME visible, make sure to hide it. Test: Set time from Settings. Switch to TextInputTimePicker. Enter text so IME appears. Switch back to RadialTimePicker IME should be hidden again. Change-Id: Ia0ed149d74333b2f643d50a324172b64aa5e223b
* Disable state save/restore for inflated date/time picker viewsAdam Powell2017-05-231-0/+1
| | | | | | | | | | | | Fix a bug where the internal date/time picker views reused view IDs causing state save/restore bugs when placed within AlertDialogs and other places. Since the pickers already save/restore their state at a higher level leaving this enabled was redundant. Bug 32654446 Test: manual Change-Id: I3df2fc932ac5296ab6eb0a5013dddef8d1117635
* Update TimePicker mode switch icon.Aurimas Liutikas2017-05-151-1/+1
| | | | | | | | | Previously the icon was an event icon, but a clock icon is more appropriate so we are switching to that instead. Bug: 37351390 Test: Open time picker Change-Id: I47e6caf3c341c10264168004628288fd00e4601a
* Merge "Added auto-fill support for DatePicker and TimePicker."TreeHugger Robot2017-03-011-0/+3
|\
| * Added auto-fill support for DatePicker and TimePicker.Felipe Leme2017-03-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Also fixed some getAutoFillType() implementations to return null when the view is disabled. Bug: 33550221 Bug: 35840787 Test: CtsAutoFillServiceTestCases (with new tests) pass Test: m update-api Change-Id: I46acc1fb106cf2153515cc1c9567b34cfabd1c62
* | Do not send onTimeChanged updates if nothing actually changed.Aurimas Liutikas2017-02-281-1/+8
|/ | | | | | Bug: 29314380 Test: android.widget.cts.TimePickerTest#testSetOnTimeChangedListener now passes. Change-Id: I4df96cd306967027ea76e2c256b50ca687eae9ba
* Adding text input mode to TimePicker.Aurimas Liutikas2017-02-061-13/+120
| | | | | | | Test: Tests will have a follow up CL. Bug:30044800 Change-Id: I71a0fba97026da76251768016edf1b159617abb9
* Use localized hour when announcing selection for accessibility am: ↵Alan Viverette2016-08-101-11/+7
|\ | | | | | | | | | | | | | | 66a8562c58 am: fde654fb97 am: 4922fdc35f Change-Id: I769d1cc8b25af34b4a08fba27e62db09a22412bc
| * Use localized hour when announcing selection for accessibilityAlan Viverette2016-08-041-11/+7
| | | | | | | | | | Bug: 30451273 Change-Id: I04276dc12d479ff5336799ebb32ff4cf5d66068a
* | TimePicker - introduce hidden methods for CTS testingAndrei Stingaceanu2016-07-071-0/+29
| | | | | | | | | | | | | | | | For assisting the TimePickerTest keyboard traversal and keyboard entries CTS tests. Bug: 26187903 Change-Id: Ie30a006d07b7e5f75b11645e84c5df8b470cb52b
* | Add setOnDateChangedListener to DatePickerClara Bayarri2016-06-031-5/+0
|/ | | | | | | | | Also refactor slightly the hierarchy in TimePicker to use the common parent AbstractTimePickerDelegate in the same way as DatePicker. Bug: 28310875 Change-Id: Iecaf206ba1691e26d4496014dc1d13f070c4722a
* Maintain internal consistency for TimePickerClockDelegate hourAlan Viverette2016-04-281-59/+78
| | | | | | | | | Hour was not updated correctly when a new hour was selected using the radial picker or when AM/PM was changed, which prevented programmatic calls from working. Bug: 28398738 Change-Id: I0c1ffd9f9e569d980e72e74dc62568a56930afc4
* Call OnTimeChangedListener on AM/PM change in clock-style TimePickerAlan Viverette2016-04-191-1/+4
| | | | | Bug: 28257554 Change-Id: I25aabac783ea2b6e68be4b6c60f0d55a4c37af26
* Include current selection mode in TimePicker event textAlan Viverette2016-04-121-8/+12
| | | | | Bug: 23118708 Change-Id: I709f28674c7a959cdfb279f8643a07aa562d8fef
* Use Holo date/time picker layouts on very small screensAlan Viverette2016-03-011-69/+5
| | | | | | | | | | If the screen is smaller than "small" then use the Holo picker layouts. Unifies the SavedState between delegates so that we can seamlessly transition between them during configuration changes. Pushes the DatePickerSpinnerDelegate up to the same level as the calendar delegate. Bug: 27239893 Change-Id: Ida4dc2748d38bd766ae93d12aef15e963921939c
* LayoutLib fixes for NDeepanshu Gupta2016-02-181-4/+2
| | | | | | | Moves LayoutLib to Java 8 - YAY! Fix delegates Change-Id: I098996e43e330e995d33f12df1c16355bbc02f0f
* Only look for nearest child View in ViewGroupAlan Viverette2015-11-201-2/+6
| | | | | | | | | NearestTouchDelegate may still be assigned to non-ViewGroup views, but we won't attempt to find a target child View until the touch moves into a ViewGroup. Bug: 25813455 Change-Id: I570f88fee63623110e3463e8d4579cca8113fd5e
* Set mTempCalendar in TimePickerSpinnerDelegateAlan Viverette2015-11-191-2/+2
| | | | | | | | | A previous CL removed setLocale(), which had been initializing the temp calendar. This CL also makes the calendar final, since the locale is only set once during construction. Bug: 25776094 Change-Id: If0af34df3120a7c4b1667129a553b9f8b7ec1999
* Update the TimePicker hour format when toggling 24-hour modeAlan Viverette2015-11-161-15/+18
| | | | | Bug: 25615007 Change-Id: I47a9f6b07e0cf7c86ca6d25c835a06878878d483
* Clean up TimePickerAlan Viverette2015-11-161-80/+63
| | | | | | | | | No functional changes, only refactoring: - shorten method and variable names - remove unused validation callback - avoid using return in setters Change-Id: Ie7c19cfe3c5cb515695f943c534899d37ad032bb
* Implement new keyboard interaction model in TimePickerAlan Viverette2015-10-221-681/+245
| | | | | | | | Also enlarges the touch targets for the AM/PM buttons by redirecting unhandled touches within the containing view group. Bug: 20257430 Change-Id: I28e8d8894a4702116bb68cc6a6d4115e5aa87a69
* Animate radial time picker selector during hour/minute transitionAlan Viverette2015-10-021-2/+2
| | | | | | | | | Also propagates XML attrs from time picker to radial view during construction, which allows the hour colors & etc. to be changed inline without needing to set the timePickerStyle theme attribute. Bug: 20333885 Change-Id: Ib42b9f5b93b5d6ce1dcbaa05f99cef40c9f9a9d3
* Ensure AM/PM buttons are at least 48x48dpAlan Viverette2015-09-161-6/+2
| | | | | | | Also cleans up imports. Bug: 24057304 Change-Id: I95e8e7c49247bcf51aabcb656d76c0bfa0f0865c
* Scale month view for small screens, use verbatim span for AM/PM labelAlan Viverette2015-04-011-2/+12
| | | | | | | | Also fixes initial day selection in DatePickerDialog. Bug: 19933912 Bug: 19937345 Change-Id: I88264a192c087361dbf21b055e74e1facf2506bc
* Merge "Deprecate AnalogClock widget, Integer methods on TimePickerView"Alan Viverette2015-03-301-5/+5
|\
| * Deprecate AnalogClock widget, Integer methods on TimePickerViewAlan Viverette2015-03-181-5/+5
| | | | | | | | | | Bug: 19754178 Change-Id: Ic51c40995ce841040d745070243e483d4d97ce5c
* | Clean up time picker attributes and drawing codeAlan Viverette2015-03-241-31/+95
|/ | | | Change-Id: I16283d666f49885855a5f9bb3781cea07af058fd
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-2/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Implement landscape layout for time picker dialogAlan Viverette2015-02-261-22/+16
| | | | | | | | | | | | | | | Adds support overriding default alert dialog panel elements by including them in the dialog's custom content view, but no public API (yet!) since the panel IDs have never been public. Some minor cleanup and refactoring in TimePickerDialog. Removes Holo styles for "clock" and "calendar" style pickers since they are new in Material. If the new styles are used against Holo they will match Material but with Holo primary/accent colors. Also implements themed color state lists to resolve TODOs in both time and date pickers. Bug: 19431361 Change-Id: I095fd8d653e02d9e5d20d66611432a08a7a5685e
* Update time picker to match latest Material specAlan Viverette2015-02-201-8/+22
| | | | | | | | Also removes saveLayerAlpha() call from radial time picker's disabled drawing path. Bug: 19431361 Change-Id: I18641bb9544107bb8704fc43d0dd6c5b18ff99ce
* First quick implementation of auto assist data.Dianne Hackborn2015-02-061-10/+0
| | | | | | | | | | | | | | Introduce new AssistData class that contains all data the framework automatically generates for assist. Currently populated with a very simple tree structure representing the app's view hierarchy. Reworked how we populate the class name for accessibility info, so this is provided through a new method call on View that subclasses can override. This method is also used to populate the class name in AssistData. Change-Id: Ibd0acdc8354727d4291473283b5e4b70894905dc
* Merge "resolved conflicts for a0bc2e7e to lmp-mr1-dev" into lmp-mr1-devDeepanshu Gupta2015-01-051-0/+2
|\
| * resolved conflicts for a0bc2e7e to lmp-mr1-devDeepanshu Gupta2014-12-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original change wasn't properly merged into lmp-mr1-dev because of merge conflicts. This change manually resolves the conflicts. The main reason for the conflict was that TimePickerSpinnerDelegate was swapped with TimePickerClockDelegate. This change also fixes the typo in the original change which was fixed in a subsequent change. Original commit: 12b6d29b7b5592dcfb6e6fd6f0c21a40f37d014a fix for typo: cb09bc45c58740af953874f9915306d351fc3d9d Change-Id: I50bf8c2d86318f632465a38adfad16d1382a9319
* | Use min when comparing AM and PM text lengthsAlan Viverette2015-01-051-7/+9
|/ | | | | | | | Also cleans up code a little to prevent unnecessary re-computation of lower-cased strings and use final where possible. BUG: 18874813 Change-Id: I852eb7a281aed64ac36e95f32f5fa410f50abfa4
* Improve time picker accessibilityAlan Viverette2014-12-101-0/+22
| | | | | | | | Overrides click action description for TimePicker hour/minute selectors and manually specifies traversal order for radial time picker nodes. BUG: 17468036 Change-Id: I4472b42a95d762085d7a4d382feb2b9216c0d41c
* Merge "Ensure time picker dialog fits on small screens" into lmp-mr1-devAlan Viverette2014-11-121-41/+31
|\
| * Ensure time picker dialog fits on small screensAlan Viverette2014-11-121-41/+31
| | | | | | | | | | | | | | | | Also fixes dialog padding in landscape mode and a bug in the ColorStateList method used to apply a selected color. BUG: 18251582 Change-Id: Id5b8c7893ec42fd4d5f4a7520e6ac170839d3143
* | Call OnTimeChangedListener when new TimePicker values are selectedAlan Viverette2014-11-071-17/+26
|/ | | | | BUG: 18295303 Change-Id: Ib5922db3a16c1975554072e2af241bbd6cf807c4
* Add support for Explore by Touch to RadialTimePickerViewAlan Viverette2014-10-241-15/+5
| | | | | | | | Also adds IntArray, which is like LongArray for integers, and prevents the AM/PM label text in the time picker header from wrapping. BUG: 17468036 Change-Id: I7120089885709f23e20368927e4b3ed9db2e5393
* Swap names for clock delegates so they are correctAlan Viverette2014-10-231-380/+1062
| | | | Change-Id: Ic11affae802f0afe4746f65f0b96979a7c5a9c0a
* Update AM/PM selectors for clock face TimePickerAlan Viverette2014-10-151-1/+1
| | | | | | | | The selectors are now CheckedTextViews, which makes more sense when using a screen reader. BUG: 17468036 Change-Id: I09c62a08172a710faa8fb7ed2bf99a66331e5701
* Update date and time picker stylingAlan Viverette2014-08-251-2/+2
| | | | | | | | | | | Change text sizes, fix year picker selected color, remove pulse animations, fix landscape layout centering. BUG: 17185948 BUG: 17187072 BUG: 14973897 BUG: 16938600 Change-Id: I11ad0abb217a950f4a96d1f781e08f09796c67bb