Commit Graph

9093 Commits

Author SHA1 Message Date
TreeHugger Robot
082bd2a4b9 Merge "Revert "Do not invoke textclassifier when dimissing the selection"" into sc-dev am: 2fdb6bd709 am: b9f59a5adf am: 088e171268
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14519405

Change-Id: I0c90116764a5ac6c4371ccfa6ff2446e17a8d3a3
2021-05-24 12:55:05 +00:00
TreeHugger Robot
2fdb6bd709 Merge "Revert "Do not invoke textclassifier when dimissing the selection"" into sc-dev 2021-05-24 11:48:28 +00:00
Tony Mak
c103424e3a Revert "Do not invoke textclassifier when dimissing the selection"
Reverting ag/13435448.

The bug that the change fixed was that TextView invokes classifyText
when the selection is going to be dimissed due to an ACTION_UP event.
The fix was that we only  call showFloatingToolbar() if users are
dragging the selection curosr when we get an ACTION_UP event.

QA has found a bug recently.
When user selects some text and then scrolls the TextView, we hide the
floating toolbar temporarily. When user finishes scrolling, TextView
does not reshow the toolbar immediately due to the fix.

I don't have a fix that I feel comfortable to get into S given
that we are pretty late in the process, so reverting the fix.

Some more details:
IMO, the fix should be calling showFloatingToolbar() only if
TextView has a selection(i.e. TextView.hasSelection()) when we are
processing the ACTION_UP event in updateFloatingToolbarVisibility().
Sadly, it does not work because the selection is not actually dismissed
yet when we are trying to update the visiblity of
the floating toolbar in updateFloatingToolbarVisibility().
The selection is actually dismissed when Editor.onTouchUpEvent is
called to handle the UP event, but updateFloatingToolbarVisibility() is
called before that :/

Moving around the code so that updateFloatingToolbarVisibility() is
called after Editor.onTouchEvent() may work, but I am not comfortable
to get in a risky change like this at the moment.

Reason for revert: b/187862341

Bug: 187862341

Change-Id: Ic49c6792dc86c01fcc78a4d3bc5bfd85b7772197
2021-05-24 11:47:56 +00:00
Nikita Dubrovsky
ce33dd6adc Merge "Remove verbose logcat messages in TextViewOnReceiveContentListener" into sc-dev am: 75dc1f16e3 am: 41c61e595a am: b9c3d048f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14687886

Change-Id: I8e9b751a6bc28e128e72e29d0342618e26da0cad
2021-05-23 23:47:09 +00:00
Nikita Dubrovsky
75dc1f16e3 Merge "Remove verbose logcat messages in TextViewOnReceiveContentListener" into sc-dev 2021-05-23 22:58:38 +00:00
Joanne Chung
7229007466 Merge "Refine the ViewTranslationCallback usage." into sc-dev am: cee152ee43 am: df12bfb9ff am: f14bf04771
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14186069

Change-Id: I28792837248882200481e439971b57cc32758e86
2021-05-22 08:25:51 +00:00
Nikita Dubrovsky
5175c12a13 Remove verbose logcat messages in TextViewOnReceiveContentListener
Bug: 170163502
Test: Manual
Change-Id: Ib34a4375294a2a696cbf26e110602b5de2825184
2021-05-21 16:35:13 -07:00
Joanne Chung
18b1d3bde4 Refine the ViewTranslationCallback usage.
Currently, TextView uses its default implementation even developers
uses setViewTranslationCallback() to set their customized
ViewTranslationCallback, we should only set default TextView
implementation if developers don't set it.

The onViewTranslationResponse() will call getViewTranslationCallback
instead of getting TextView default implementation directly. This can
make sure we can get the expected ViewTranslationCallback.

Bug: 183467275
Test: manual
Test: atest CtsTranslationTestCases

Change-Id: I41417140f8985aec6c80f1bca3cfba804727d5df
2021-05-21 19:11:14 +08:00
TreeHugger Robot
ee3e729371 Merge "Attaching broadcast receiver on attach/detach instead of everytime visibility changes" into sc-dev am: 27500d78b3 am: d7a005cfe5 am: c2649fd1b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14648155

Change-Id: I9fef1ade8078763b856035c39f3e98b4a82d5335
2021-05-21 01:45:14 +00:00
TreeHugger Robot
27500d78b3 Merge "Attaching broadcast receiver on attach/detach instead of everytime visibility changes" into sc-dev 2021-05-21 01:11:50 +00:00
Joanne Chung
7fafecc477 Merge "Translate TextView content description if exist" into sc-dev am: 86d3f3deae am: 15676878d8 am: cbccbd1cd9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14543285

Change-Id: Ifca78d32251c4cfee704aac6b86c11bc9d24b956
2021-05-20 06:37:58 +00:00
Joanne Chung
86d3f3deae Merge "Translate TextView content description if exist" into sc-dev 2021-05-20 06:00:56 +00:00
TreeHugger Robot
e7e7374c5c Merge "Deprecate Context#createApplicationContext" into sc-dev am: ee438f960a am: d95a9ebbfb am: 891659ba75
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14528644

Change-Id: I396eb97e5b36556757caf269b0e565459c62828b
2021-05-20 04:17:25 +00:00
George Mount
2288eebbd1 Merge "Fixes minimum date in DatePicker" into sc-dev am: 290fcdde7d am: d85a7e41c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14553791

Change-Id: I4438e06a717b80357fcd419f148016fbc8941b6a
2021-05-19 23:24:44 +00:00
Sunny Goyal
2d3879ea2d Attaching broadcast receiver on attach/detach
instead of everytime visibility changes

> Adding a broadcast receiver makes a synchronous system API call
  which can delay draw pass
> Also removing TIME_TICK broadcast, instead using an internal timer
  to aboud unnecessary calls while app is stopped

Bug: 188574817
Test: Manual
Change-Id: I37677aa40189bf4fb75e7e2372bda81ea3e6fda3
2021-05-19 12:51:15 -07:00
TreeHugger Robot
ee438f960a Merge "Deprecate Context#createApplicationContext" into sc-dev 2021-05-19 15:35:09 +00:00
Ryan Mitchell
c54ebba25b Deprecate Context#createApplicationContext
If an application caches an ApplicationInfo and uses it to call
Context#createApplicationContext, the app will not get the most recent
version of the overlays for that application. To make things worse, the
LoadedApk stored in ActivityThread#mResourcePackages is updated using
the old ApplicationInfo causing further uses of the cached LoadedApk to
return outdated information.

Deprecate Context#createApplicationContext, convert all internal uses
to Context#createPackageContext(String packageName, ...) and log
whenever any one calls Context#createApplicationContext with an
outdated ApplicationInfo to detect debug issues in using old infos.

Bug: 188059515
Test: change wallpaper and observe widgets get reloaded with most
      recent overlays
Change-Id: I2aeefa8c0e66264859109975a54c4f73f76ad710
2021-05-18 09:07:58 -07:00
George Mount
290fcdde7d Merge "Fixes minimum date in DatePicker" into sc-dev 2021-05-17 20:50:56 +00:00
Joanne Chung
9753899a97 Translate TextView content description if exist
Screen reader(Talkback) will read content description first if the
developers set. We only translate TextView text, this may cause the
screen reader will not read the translated text if the developers set
content description.

To fix the issue, we also send the content description to translate.
When the translated text is shown, we also set content description
with translated content description and reset to original content
description if show original text.

Bug: 187134784
Test: atest CtsTranslationTestCases
Change-Id: I6986384260627a0539780b7293d47666c442d852
2021-05-17 14:05:52 +08:00
George Mount
4f2b9ad2bd Fixes minimum date in DatePicker
Fixes: 158448787

When the day is earlier in than the minimum date, but
the year is later, then the year is changed, the date
gets set to a day that is earlier than the minimum date.
This CL ensures that the year change can't bring the
date outside of the range of minimum to maximum dates.

Test: manual testing
Change-Id: I0034bd513275267ecf9554f673533852e68dd854
2021-05-14 20:23:37 +00:00
Stevie Kideckel
34728341f2 Merge "Performance/jank improvements to AnalogClock" into sc-dev am: 9a0e124b1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14487521

Change-Id: I2d2573363e627afb36009f11b300f4d08e5490ef
2021-05-12 21:49:54 +00:00
Stevie Kideckel
4a787a1839 Performance/jank improvements to AnalogClock
This addresses rounding of the seconds hand fraction to avoid
advancing by inconsistent amounts.

It also moves to a less janky 30FPS update rate.

This also optimizes seconds ticking to only schedule callbacks as needed
and avoids spurious updates to the content description.

Also, potential NPE fix and dead code removed.

Bug: 186099601
Test: Local testing with sample app
Change-Id: I771b4c3f1d18f7836cd42202810a1495d25a9db5
2021-05-12 16:55:25 +00:00
Lucy Chang
53b8cf32a9 Merge "Don't send AccessibilityEent if text is unchanged" 2021-05-12 06:48:21 +00:00
Nikita Dubrovsky
2f9684b65b Merge "Make drop consistent with paste for multiple text items in a ClipData" into sc-dev am: 4b2ab9bba3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14455023

Change-Id: I729c08eb540e4618388e48897507226e84a96c6b
2021-05-07 16:58:09 +00:00
Nikita Dubrovsky
4b2ab9bba3 Merge "Make drop consistent with paste for multiple text items in a ClipData" into sc-dev 2021-05-07 16:57:02 +00:00
Pierre Barbier de Reuille
66b91b4a27 Merge "Save/restore view states when reapplying RemoteViews for color changes" into sc-dev am: 6d82bd39e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14294133

Change-Id: Ia13bc70ef250cf3356cae421eb97b3b100909efa
2021-05-06 19:00:18 +00:00
Pierre Barbier de Reuille
6d82bd39e7 Merge "Save/restore view states when reapplying RemoteViews for color changes" into sc-dev 2021-05-06 18:54:54 +00:00
Nikita Dubrovsky
e480958234 Make drop consistent with paste for multiple text items in a ClipData
A ClipData can contain multiple items, for example:
```
ClipData clip = ClipData.newPlainText("label", "ONE");
clip.addItem(new ClipData.Item("TWO"));
clip.addItem(new ClipData.Item("THREE"));
```

When a clip like this is pasted, the TextView impl inserts a newline
between each item. When the same clip is inserted via drag-and-drop,
no newlines are inserted.

This change makes the behavior of drop and paste consistent by updating
drop to match the paste behavior (since pasting has been around longer
and is more common).

Bug: 187428338
Test: atest CtsWidgetTestCases:TextViewReceiveContentTest
Change-Id: I08f30e619b858a4586ab9b4ed287be28b218231e
2021-05-06 11:50:52 -07:00
Yinglei Wang
bb5482d835 Merge "Use state description of "in progress" for indeterminte ProgressBar" 2021-05-06 17:43:17 +00:00
yingleiw
bc45cab1f2 Use state description of "in progress" for indeterminte ProgressBar
When a ProgressBar is set to indeterminate, we assign a default
state description of "in progress" to AccessibilityNodeInfo. We
only assign default state description to AccessibilityNodeInfo,
but not to View. If the developer
sets a custom state description through either View API or
AccessibilityNodeInfo API, the custom state description will
be used for both indeterminate and determinate progressbar instead
of default ones.

We put the "in progress" in state description instead of content
description to prevent accessibility services like talkback from
automatically assigning a state description when the state description
is null or empty.

Fix: b/182582617

Test: tested manually with a material linear indeterminate progressbar
with talkback. It says "In progress, progress bar".
Unit tests added.

Change-Id: I24477622bf8992f80a19b8df3a6032bac7f9d5bd
2021-05-05 21:07:48 -07:00
George Mount
fd308c1823 Merge "Allow fling during stretch in ListView" into sc-dev am: 9d7658ac57
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14392463

Change-Id: I6b4ec30213c0f36ed2a7dce944b9e5fde96de4e8
2021-05-05 15:56:24 +00:00
George Mount
9d7658ac57 Merge "Allow fling during stretch in ListView" into sc-dev 2021-05-05 15:50:08 +00:00
Nader Jawad
af62127679 Merge "Update hole punch logic in HWUI" into sc-dev am: 603d612707
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14244206

Change-Id: I25572446223bf7266c05d6442e0415065f774a83
2021-05-05 03:05:11 +00:00
Nader Jawad
603d612707 Merge "Update hole punch logic in HWUI" into sc-dev 2021-05-05 02:59:18 +00:00
Stevie Kideckel
691ff96db6 Save/restore view states when reapplying RemoteViews for color changes
This ensures that adapters have their caches filles and other benefits
such as lists maintaining their scroll positions

Bug: 183503469
Test: validated with local app that service is not called on drag for
colors changing and that flicker is removed

Change-Id: I043d1d7a547b012f7a12eb555b35854a9bb7109b
2021-05-04 23:18:45 +01:00
George Mount
d317ef65a8 Allow fling during stretch in ListView
Bug: 186430321

ListView should accept a fling while stretching.

Test: New test
Test: manual testing
Change-Id: I67221e06818d9953882e16d1c72f2d9e6b191ebb
2021-05-04 15:15:10 +00:00
Nader Jawad
b00eba7319 Merge changes from topic "fling_after_pull" into sc-dev am: d8f57c7cf3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14414739

Change-Id: I2805d99d8c6cd011e906ad676fa70795f4366c1f
2021-05-04 04:47:05 +00:00
George Mount
930d7b4eb7 Remove edge effect type from the API. am: b1aee44bea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14390423

Change-Id: If4f4c564adbcd2cc6d455f8224ad930cb6f07d4d
2021-05-04 04:46:58 +00:00
Nader Jawad
197743ff9c Update hole punch logic in HWUI
--Updated HWUI holepunch logic for SurfaceView to
also apply the stretch to the hole punch
--Updated RenderNode callbacks to also include
an offset from the ancestor RenderNode that also
has a stretch configured on it
--Added new test activity to verify hole punch
logic

Bug: 179047472
Test: manual
Change-Id: Ibbaf8248a31839ba9dc352ecb9fef54e1276918e
2021-05-03 18:08:47 -07:00
George Mount
b1aee44bea Remove edge effect type from the API.
Fixes: 186758538

Relnote: "Removes edge effect type from the API -- EdgeEffect now
supports only stretch edge effect for all applications."

Test: existing tests, modified to work with stretch
Change-Id: Iec7a9d4a0316ff3ba7297c4565bb881a1adcf949
2021-05-03 22:45:10 +00:00
George Mount
07406f3642 Allow EdgeEffect to fling during pull
Bug: 186430321

EdgeEffect was restarting the fling from the start if onAbsorb()
was called after onPullDistance(). This CL does not reset
the distance in onAbsorb().

Test: new test
Change-Id: I0657059c275f42cfe229a3aaa8bf37c87e0394f1
2021-05-03 22:45:10 +00:00
TreeHugger Robot
c406acdd79 Merge "Dismiss magnifier correctly in concurrent editing scenario" into sc-dev am: 7b0989f35d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14344156

Change-Id: I2391b5f3cec2b19ecfe5745107732a57133f3979
2021-05-03 16:01:42 +00:00
TreeHugger Robot
7b0989f35d Merge "Dismiss magnifier correctly in concurrent editing scenario" into sc-dev 2021-05-03 15:44:37 +00:00
George Mount
9cfa6895e7 Merge "Fling while overscrolled: ScrollView/HorizontalScrollView" into sc-dev am: ee5ed9dfaa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14356490

Change-Id: Iab93e6773a9d9685a0568e2f6841ed4f2aac71ce
2021-04-29 23:17:14 +00:00
George Mount
02843213c0 Fling while overscrolled: ScrollView/HorizontalScrollView
Bug: 186430321

ScrollView and HorizontalScrollView was not allowing a fling
effect while overscrolling. This adds the ability to fling
while overscrolling.

Test: new test
Test: manual ApiDemos
Change-Id: Iebd402ff0f5b6f16518ecc5403e085cb58de5976
2021-04-29 20:37:56 +00:00
George Mount
509448d1d6 Merge "Allow intercept touch event while animating edge glow." into sc-dev am: a4b222f48d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14342255

Change-Id: Ibb7ee93abdf93f161dc72a47b4a6163799990912
2021-04-29 15:28:15 +00:00
George Mount
a4b222f48d Merge "Allow intercept touch event while animating edge glow." into sc-dev 2021-04-29 15:21:51 +00:00
Mihai Popa
d32571e9b5 Dismiss magnifier correctly in concurrent editing scenario
Fixes: 186505600
Test: manual testing
Change-Id: I864f03e976be92c232f51a576043cb49731cda26
2021-04-29 11:04:59 +00:00
TreeHugger Robot
49aa2dfb05 Merge "Fix stale EditorInfo upon EditText#setText()" into sc-dev am: 7c9d3192de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14334694

Change-Id: I3d18a1b6e6417dd0ac71dc7595f98181fadf6307
2021-04-29 02:45:15 +00:00
George Mount
109e474959 Allow intercept touch event while animating edge glow.
Bug: 185906621

During overscroll animation, there is no need to call
disallowInterceptTouchEvents(). This removed the
call so that parents can intercept touch events.

Test: Ia9ac6d81a5b60222f489ea87f31ecba0c1d48cea
Test: manual testing

Change-Id: Ie5d9428d95b86d7a976c2f3c519547151a45cec5
2021-04-28 21:47:12 +00:00