Commit Graph

6996 Commits

Author SHA1 Message Date
TreeHugger Robot
de06d67d16 Merge "Added auto-fill support for DatePicker and TimePicker." 2017-03-01 23:15:35 +00:00
Felipe Leme
305b72c925 Added auto-fill support for DatePicker and TimePicker.
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
2017-03-01 10:43:48 -08:00
Aurimas Liutikas
1ca63ec5fb Merge "Do not send onTimeChanged updates if nothing actually changed." 2017-02-28 22:35:58 +00:00
Aurimas Liutikas
2f16bc8a3a Do not send onTimeChanged updates if nothing actually changed.
Bug: 29314380
Test: android.widget.cts.TimePickerTest#testSetOnTimeChangedListener now passes.
Change-Id: I4df96cd306967027ea76e2c256b50ca687eae9ba
2017-02-28 12:19:30 -08:00
Abodunrinwa Toki
90ebaa8d2d Merge "Don't trigger textclassifier in a11y action." 2017-02-28 20:02:08 +00:00
Abodunrinwa Toki
117240cc0e Don't trigger textclassifier in a11y action.
Support for smart text share in a11y mode needs to be done differently.
See: b/34779222

Test: Manually tested
Bug: 35252502
Change-Id: Ia268065c21fc5ac716ca06a0ec9d3866fbd13aa4
2017-02-28 18:02:53 +00:00
Andrei Stingaceanu
81926e39f0 Merge "AutoSize TextView (part 11) - fix final APIs" 2017-02-27 17:42:19 +00:00
Alan Viverette
8e1a729645 Implicitly cast views obtained via View.findView methods
Removes all explicit casts from android.widget classes. Also @removes
methods on ListView that were overriding @hidden methods and should
never have been exposed as public API.

Bug: 24137209
Test: make
Change-Id: I89f0e51258560987b3942251fd249210f825ac2a
2017-02-27 11:06:20 -05:00
Andrei Stingaceanu
ab18567419 AutoSize TextView (part 11) - fix final APIs
* public attr "autoSizeText" becomes "autoSizeTextType"
  (inlined with all other methods and naming)
* documentation for autoSizetextType "uniform" re-worked:
  "The TextView scales text size both horizontally and
  vertically to fit  within the container"
* converted comments into Javadoc for
  TextView#AUTO_SIZE_TEXT_TYPE_NONE and
  TextView#AUTO_SIZE_TEXT_TYPE_UNIFORM
* better documented attr "autoSizePresetSizes" to specify
  it is a resource array of dimensions
* various small fixes in comments

Bug: 35755149
Bug: 35763485
Bug: 35764658
Bug: 32221168
Test: run cts-dev -m CtsWidgetTestCases -t \
      android.widget.cts.TextViewTest

Change-Id: I36afd399e005521b6e85922aa9e1e4418bb960e1
2017-02-27 15:17:46 +00:00
TreeHugger Robot
d77ae2b0ac Merge "Implement reset to original selection." 2017-02-25 02:57:55 +00:00
Abodunrinwa Toki
89ba5fbde0 Implement reset to original selection.
The UX for smart selection specifies that the user is able to reset
the original selection by tapping once on the word after smart
selection. Tap once, and the selection resets to the word that was
initially selected (before smart selection happened), tap one more
time and the insertion cursor appears as usual. If the user taps
a different word other than the original selection, the insertion
cursor appears as before.

Test: I7456eb4773d40366a3f4aa7bf051a1c7ddda6e9d
Bug: 34777048
Change-Id: If73259ddb67379d5a5deaa01b840b5185cedf4c8
2017-02-24 19:36:30 +00:00
Siyamed Sinir
a2ba2a3923 Merge "Revert "Request re-layout after setText if layout width is 0"" 2017-02-24 07:45:54 +00:00
Siyamed Sinir
6f29b7aa9e Revert "Request re-layout after setText if layout width is 0"
This reverts commit b4b8740aed.
Reverts fix for bug 27995311.

Test: cts-tradefed run cts --test android.widget.cts.TextViewTest -m
CtsWidgetTestCases --skip-device-info --skip-preconditions
--skip-connectivity-check

Fixes: 34843459
Change-Id: I2cea04cd12953b110c59a5a84e9eea5060fc038d
2017-02-23 20:20:26 -08:00
TreeHugger Robot
f30b879c73 Merge "Added sanitization for CompoundButton and RadioGroup." 2017-02-23 15:24:07 +00:00
Felipe Leme
62fb65fd3c Merge "Added auto-fill support for Spinner." 2017-02-23 06:45:16 +00:00
Aurimas Liutikas
4f911e1c5a Merge "Fix toggling of AM/PM of TimePicker using hardware keyboard." 2017-02-23 04:52:07 +00:00
TreeHugger Robot
4bc511cb66 Merge "VideoView: option for audio focus, support for AudioAttributes" 2017-02-23 04:37:54 +00:00
Felipe Leme
c01a873c4f Added sanitization for CompoundButton and RadioGroup.
Bug: 33269702
Bug: 33550221
Test: CtsAutoFillServiceTestCases (with new tests) pass

Change-Id: Ie2c8d2784227371588aa02973b8ef3ac1a6950aa
2017-02-22 19:15:38 -08:00
Aurimas Liutikas
c51c5f29fb Fix toggling of AM/PM of TimePicker using hardware keyboard.
Set AM/PM mode before setting hour in TextInputTimePickerView. This is
needed so we know exactly which it is when we are using 12 hour clock.
Not setting it early was causing TextInputTimePickerView to update TimePicker
with the hour that was not offset correctly based on AM/PM state.

Test: existing tests caught this - TimePickerTest#testKeyboardInputModeClockAmPm
      verified locally that this test now passes.
Bug: 35262830

Change-Id: I7e912320cb5a72c5d9d4e80dc0b42deb651f2636
2017-02-22 17:00:30 -08:00
Felipe Leme
d09ccb8db6 Added auto-fill support for Spinner.
Spinner is a special kind of list-value field because its auto-fillable
values are not currently present in the assist structure: this change
adds a getAutoFillOptions() to fill that void, and implements the
auto-fill APIs on Spinner.

It also fixes RadioGroup.getAutoFillValue() - it should return the index
of the child, not its resource id.

Bug: 33550221
Test: CtsAutoFillServiceTestCases (with new tests) pass
Change-Id: I625e7dd705fade56fda490fcd3c4446c0c245ee1
2017-02-22 16:09:50 -08:00
Felipe Leme
7be469ad9d Merge "Fixed missing auto-fill save callbacks on TextView." 2017-02-22 23:56:47 +00:00
Jean-Michel Trivi
0f49f82e97 VideoView: option for audio focus, support for AudioAttributes
Add API for VideoView to select whether it uses audio focus during
  playback, and how.
Add support for AudioAttributes

Test: cts-tradefed run cts -m CtsWidgetTestCases -t android.widget.cts.VideoViewTest
Bug 30955183
Bug 30258418

Change-Id: I581d32c79c78b8197ded2319e0d5bfdc35b93c5e
2017-02-22 12:04:24 -08:00
Felipe Leme
0257c8a5d2 Fixed missing auto-fill save callbacks on TextView.
It was accidentally broken during a previous commit where the CTS test
failure was ignored by a known issue being fixed in another change -
this change fixes both problems.

Bug: 33550221
Bug: 3380254
Test: CtsAutoFillServiceTestCases pass (for real now :-)
Change-Id: I5b2aa6060995ca255e51d85aa6ec93a886fa522f
2017-02-22 11:57:53 -08:00
TreeHugger Robot
7843f0a799 Merge "Added auto-fill listeners for RadioGroup and CompoundButton." 2017-02-22 18:58:54 +00:00
Andrei Stingaceanu
f6e3654b61 Merge "CalendarView Material - fix exception if date is out of range" 2017-02-22 10:45:52 +00:00
Felipe Leme
5882c4f5d2 Added auto-fill listeners for RadioGroup and CompoundButton.
Bug: 33550221
Bug: 3380254
Test: CtsAutoFillServiceTestCases pass

Change-Id: Ia9293d16b6fe092552e19563328697c298451f8a
2017-02-21 16:53:00 -08:00
Phil Weaver
385912ee2d Deprecate "speak passwords" setting.
This will now be controlled by individual accessibility services.
We'll provide the password information to them, and they can
present or hide the information as it makes sense for their users.

Password information was anyway provided when a headset was
connected.

Bug: 28139568
Test: Manually verified that TalkBack now speaks passwords on the
lock screen and in text views. Since I'm removing functionality
that didn't have tests, it's tricky to have specific tests.
Change-Id: Ic3c724ccce5762ee9dcd9e7dcbd4eae6734dd05e
2017-02-21 15:24:54 -08:00
Felipe Leme
33791fd54b Add API to mark sanitized fields and implement it on TextView.
When sending a ViewNode to the auto-fill service, it's necessary to sanitize
it so it does not contain PII (Personally Identifiable Information).

A good rule of thumb is to mark as sanitized nodes whose value were statically
set from resources. Ideally, that logic should belong to View, but View does
not know how its contexts are set, so the decision must be made by the
subclasses, and this CL implements that logic on TextView (which is the main
auto-fill type - others will come soon...)

Bug: 33269702

Test: CtsAutoFillServiceTestCases pass
Test: manual verification

Change-Id: I4dcdd8419a35812bd2f15a63a5be85f8cd97bb4e
2017-02-21 11:47:33 -08:00
Andrei Stingaceanu
fc9ea84680 CalendarView Material - fix exception if date is out of range
Due to not cherry-picking this change into N_MR1 fix the
version check to reflect this.

Bug: 28019187
Test: run cts-dev -m CtsWidgetTestCases -t \
      android.widget.cts.CalendarViewTest
Change-Id: I128d25c3ed949729e2afaeefad381bfb58d89ccd
2017-02-21 11:27:03 +00:00
Andrei Stingaceanu
2c2c3eea8e Merge "AutoSize TextView (part 10) - final APIs" 2017-02-20 10:27:07 +00:00
TreeHugger Robot
a42ba85b0e Merge "Clarify extra data argument nullness." 2017-02-17 19:47:02 +00:00
Phil Weaver
d666953f57 Clarify extra data argument nullness.
Bug: 35098706
Test: Trivial change, so I just verified that it builds.
Change-Id: I234afe4f1e52ef1c4c64e44b486a539f0d46854c
2017-02-17 09:55:46 -08:00
Andrei Stingaceanu
30574766ef AutoSize TextView (part 10) - final APIs
Gets rid of setting auto-size configuration
items one by one and instead provides setter
constructs that take all the params needed
to auto-size. This version is much closer to
how this feature can be set up from XML
attributes and also provides no doubt about
validation failures.

Bug: 32221168
Bug: 34494052
Test: in attached topic CL
Change-Id: Ic70ad43d5c6739ee312ea24984534a35c49c17dc
2017-02-17 12:02:10 +00:00
TreeHugger Robot
ceb250424a Merge "Resolve pointer icon over FastScroller to arrow." 2017-02-16 21:18:42 +00:00
Vladislav Kaznacheev
11372fa466 Resolve pointer icon over FastScroller to arrow.
Currently the icon defined by the host AbsListView is displayed
over the fast scroll area.

Bug: 35424111
Test: manual
Change-Id: Ia9897a44550922f16573b97337841c3f6ae263da
2017-02-16 09:37:56 -08:00
Andrei Stingaceanu
302fe9098b Merge "TextView/LinkMovementMethod/ClickableSpan - touch up revert" 2017-02-15 14:28:55 +00:00
TreeHugger Robot
fb30f7ca28 Merge "Do not move PopupWindow when its anchor is detached" 2017-02-13 19:59:49 +00:00
Abodunrinwa Toki
bbc21401b3 Merge "TextClassifierImpl: Handle urls." 2017-02-13 17:35:18 +00:00
Abodunrinwa Toki
9b4c82a83c TextClassifierImpl: Handle urls.
This cl also updates label strings, renames an internal method,
and fixes some bugs in TextClassifierImpl caught by tests.

Test: See: I31ee94177e58c986e61e9b24c6c5816fa4b022e1
Bug: 34778263
Bug: 34922928
Change-Id: Ibf60d345d462dfc8a13dead6f01053f1ae50f35a
2017-02-13 15:00:32 +00:00
Yohei Yukawa
22dac1c8df Introduce @SoftInputModeFlags annotation
Doing this allows us to annotate integer values that should corresponds
to WindowManager.LayoutParams#softInputMode.

Test: There should be no behavior change.  RetentionPolicy.SOURCE
      annotation should change nothing in production code.
Test: checkbuild
Bug: 32784563
Bug: 35079353
Change-Id: I96300b090edce327d0515c740183abe91ded6bac
2017-02-12 16:54:16 -08:00
Andrei Stingaceanu
d834c58252 TextView/LinkMovementMethod/ClickableSpan - touch up revert
Reverts the change which adds a gesture detector in
TextView for detecting clicks on ClickableSpans. A click
is considered MotionEvent.ACTION_UP. Revert needed because
the singleTapUp refactoring has a potential to break
existing apps.

Bug: 23692690
Test: attached in the same topic
Change-Id: Ife47fd0608480130123091bc60a7e9dd1efe8785
2017-02-10 12:55:01 +00:00
Vladislav Kaznacheev
afaa932ece Do not move PopupWindow when its anchor is detached
The current PopupWindow implementation might call
the anchor view's getLocationInWindow even if the anchor
is currently detached from the window (and the location is
a meaningless (0,0)). This results in the popup jumping to
the top of the screen.

This patch is adding tracking of the anchor's attachment state.
The position is never updated while the anchor is detached.
When the anchor is re-attached, the popup position is updated.

Bug: 34853580
Test: manual (see bug)
Change-Id: Icca1b9b558a70ee3edbe6236e076d2d08a1f8f11
2017-02-09 11:43:28 -08:00
Andrei Stingaceanu
fbfead24c2 AutoSize TextView (part 9) - sanitize APIs naming
This CL is no-op (cosmetics only)
* renames autoSizeText type "xy" to "uniform"
* renames attribute "autoSizeStepSizeSet" to "autoSizePresetSizes"
* renames "AUTO_SIZE_TEXT_TYPE_XY" to "AUTO_SIZE_TEXT_TYPE_UNIFORM"
* renames public TextView#getAutoSizeTextPresetSizes() to public
  TextView#getAutoSizeTextAvailableSizes() because this method can
  return either preset sizes or computed sizes (via min/max/step)

Bug: 34923754
Bug: 32221168
Test: associated test renames in the same topic
Change-Id: Ifacccf21ca014b6c0a07322fa02b7859ee53e387
2017-02-09 15:30:02 +00:00
TreeHugger Robot
4127c138e1 Merge "FloatingToolbar: Support for menu groups." 2017-02-08 20:19:52 +00:00
Abodunrinwa Toki
5fedfb8d46 FloatingToolbar: Support for menu groups.
1. Menu groups are now separated by dividers
2. Update to menu item spacing as specified in new UX mocks
3. TextView-Editor now passes the "assist" menu as a group
4. "Share" menu reordered after "Cut/Copy/Paste" as per UX mocks update.

Test: Manual tests.
Bug: 34777048
Bug: 34777833
Change-Id: I3d435d8a38e5b146a54706f12dbf3ff629c504bf
2017-02-08 16:55:26 +00:00
Adam Powell
2ec94fde4f Merge "Provide old behavior for View#hasFocusable to old apps" 2017-02-08 16:21:06 +00:00
TreeHugger Robot
f9a55d42d2 Merge "AutoSize TextView (part 8) - APIs for predefined sizes" 2017-02-08 14:57:43 +00:00
Andrei Stingaceanu
9fe208fe6b AutoSize TextView (part 8) - APIs for predefined sizes
* getter/setter for predefined sizes
* reads and configures from XML at construction time
* fix for an ugly bug where the sizes were missing an
  entry in certain cases, e.g: min = 10; max = 20;
  step = 2 would have produced [10, 12, 14, 16, 18]
  instead of [10, 12, 14, 16, 18, 20]
* fix using getHeight()/getWidth() instead of
  untrusted getMeasuredHeight()/getMeasuredWidth()
  and move the auto-sizing triggering to
  onLayout() instead of onMeasure() (while manually
  testing discovered missing or extra pixels and
  sometimes resizing being skipped - it's all fixed
  now)
* fix using deceiving getTotalPaddingBottom()/...Top()
  and replaced with getExtendedPaddingBottom()/..Top()
  (getTotal... was removing the whitespace height but
  auto-size needs to know about it so it can fill the
  space)

Bug: 32221168
Test: attached in the same topic
      run cts-dev -m CtsWidgetTestCases -t \
      android.widget.cts.TextViewTest

Change-Id: Id5a31d0d32b2b4082af45b4bd65af8cb85bdc92e
2017-02-08 12:48:21 +00:00
Paul Duffin
ca4964ccbe Replace com.android.internal.util.Predicate with java.util.function.Predicate
Bug: 35089332
Bug: 30188076
Test: make checkbuild
Change-Id: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
2017-02-08 11:55:39 +00:00
TreeHugger Robot
bf1a0e23ae Merge "start/invalidate selection actionMode asynchronously" 2017-02-08 10:35:54 +00:00