Commit Graph

9137 Commits

Author SHA1 Message Date
Stevie Kideckel
47ed45e0f1 Merge "Ensure that the RemoteResponse is not empty before acting on it" into sc-dev am: cf30f5dae2 am: 380231724e am: f6428864f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14934051

Change-Id: I202838cb1ec2d770b3f66032c0eff07d5ec76e37
2021-06-11 17:01:16 +00:00
Stevie Kideckel
380231724e Merge "Ensure that the RemoteResponse is not empty before acting on it" into sc-dev am: cf30f5dae2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14934051

Change-Id: I8fc157812d6253093a2e7b6adb21ebc5b5540158
2021-06-11 16:50:17 +00:00
Stevie Kideckel
cf30f5dae2 Merge "Ensure that the RemoteResponse is not empty before acting on it" into sc-dev 2021-06-11 16:39:15 +00:00
Bernardo Rufino
bd0142df9b Merge "Expand toast javadoc to include rate limiting info." into sc-dev am: 0245b5cbce am: e9abe0092d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14916753

Change-Id: I319eb1e066e9a4eda91bc78233542cec30380abb
2021-06-11 12:53:50 +00:00
Bernardo Rufino
146d92170f Merge "Expand toast javadoc to include rate limiting info." into sc-dev am: 0245b5cbce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14916753

Change-Id: Ie57ed26801856b321ffa5c1459a5890fc10eaa9e
2021-06-11 12:38:56 +00:00
Bernardo Rufino
0245b5cbce Merge "Expand toast javadoc to include rate limiting info." into sc-dev 2021-06-11 12:28:08 +00:00
Stevie Kideckel
b72cf99044 Ensure that the RemoteResponse is not empty before acting on it
Potential NPE was added in ag/14881530

Fix: 190353630
Test: locally with sample app with and without items
Change-Id: I946b6b6719600cb638db1b15d74a8c3af6587f32
2021-06-10 09:59:01 +00:00
Ram Indani
9323126a4a Merge "Adds checks if level is set on ImageView to override the level on the Drawable in the updateDrawable" 2021-06-09 18:00:31 +00:00
Stevie Kideckel
3e07b3e9ae Merge "Fix handling for onItemClick of fixed collection items" into sc-dev am: 0e77904b02 am: 122bb69942
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881530

Change-Id: I795d1e88d221f6e1455d26305570027ac2d087b2
2021-06-09 16:15:58 +00:00
Stevie Kideckel
c4797d84c9 Merge "Fix handling for onItemClick of fixed collection items" into sc-dev am: 0e77904b02
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881530

Change-Id: I29c72adacb1ad598949984ada9ab4929e5ea1187
2021-06-09 16:02:05 +00:00
Stevie Kideckel
0e77904b02 Merge "Fix handling for onItemClick of fixed collection items" into sc-dev 2021-06-09 15:53:30 +00:00
Jan Tomljanovic
8cf456cea9 Expand toast javadoc to include rate limiting info.
Test: N/A just adding javadoc
Bug: 190468866
Change-Id: I0a1ab865f5db7a990c1a667b729df52c4735a38c
2021-06-09 10:56:22 +01:00
Stevie Kideckel
1638c911cb Merge "Schedule time ticks for the next minute when no seconds hand is present" into sc-dev am: 80aaf8817a am: 9850d44946
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881612

Change-Id: Ibdd2321b857759d2f433b76956a1b9045b0494b7
2021-06-09 09:14:51 +00:00
Stevie Kideckel
f714c2a1f4 Merge "Stop using TIME_TICK broadcast in TextClock" into sc-dev am: a0a7d15be9 am: 5edf274e6d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14899456

Change-Id: Ia53c8b6c8c75a67ed30ec2d855cd274dbea32598
2021-06-09 09:14:39 +00:00
Stevie Kideckel
bfe51b550e Merge "Schedule time ticks for the next minute when no seconds hand is present" into sc-dev am: 80aaf8817a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881612

Change-Id: I2a70b6ff64a83f71ee8a1581f362daf7741bd4a3
2021-06-09 08:47:52 +00:00
Stevie Kideckel
968d29f828 Merge "Stop using TIME_TICK broadcast in TextClock" into sc-dev am: a0a7d15be9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14899456

Change-Id: I6606dbed7263458c023410f405aad9908f42ed76
2021-06-09 08:46:52 +00:00
Stevie Kideckel
80aaf8817a Merge "Schedule time ticks for the next minute when no seconds hand is present" into sc-dev 2021-06-09 08:28:34 +00:00
Stevie Kideckel
95b804ad4f Stop using TIME_TICK broadcast in TextClock
This gets called even when the view is not visible, which is bad for
performance. I've adapted the existing tick framework to handle ticking
for minutes when there aren't seconds in the format.

I verified the correct behavior with sample apps with and without
seconds in the format, including across DST time changes.

Fix: 190467448
Test: locally with sample apps
Change-Id: I75fed5c9d162b5361c31fe22d057a007db0ce75c
2021-06-08 11:17:29 +00:00
Stevie Kideckel
c81323e390 Schedule time ticks for the next minute when no seconds hand is present
The TIME_TICK broadcast was removed as it's bad for performance to use
it while the view is not visible and adds unneeded overhead.

Instead we can use the internal handler callback scheduling method.

Bug: 190274204
Test: verified locally with app, including across DST time skip
Change-Id: I4eb5e64b16c953baf473331dc7d498de19cfdbc9
2021-06-08 08:05:36 +00:00
ramindani
5bc17839f7 Adds checks if level is set on ImageView to override the level on the Drawable in the updateDrawable
Test: verified with the tests that level is maintained on the drawable.
Change-Id: Ifef75e3108f106bb6ca6dcf6594bcca79e5428ac

BUG=129089894

Change-Id: Ic0fc1dc4d48203ef453f6b967330af60abc7b8b5
2021-06-07 17:56:13 +00:00
Stevie Kideckel
bfbe46198c Fix handling for onItemClick of fixed collection items
The onItemClick handling code assumed that the item would be nested at
least one layer deep due to the RemoteViewsAdapter adding a wrapper view
group.

Rather than add another case to that logic, I've refactored this to
traverse the view's children looking for a view with the tag. As the
tag is internal, there should only ever be one child with it and we'll
always want that one to handle the click.

Fix: 190353630
Test: locally
Test: atest RemoteViewsFixedCollectionAdapterTest
Change-Id: I22057f148d33482ad84fff592b9f7f554fa2bfad
2021-06-07 14:46:52 +00:00
George Mount
758196a7e3 Merge "Fix ListView not moving during catch" into sc-dev am: e0fa7da5aa am: 472d4ccab0 am: 2540b94973
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14829811

Change-Id: I6eb2dd8350ab8b6ad3aa1216f8adf3a008e28f2e
2021-06-04 18:58:11 +00:00
George Mount
2540b94973 Merge "Fix ListView not moving during catch" into sc-dev am: e0fa7da5aa am: 472d4ccab0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14829811

Change-Id: I0e2ea259c715930659e85b4d090a356a82fe4b7a
2021-06-04 18:42:30 +00:00
George Mount
8fdd193309 Merge "Fix ListView not moving during catch" into sc-dev am: e0fa7da5aa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14829811

Change-Id: I71ed88df300bfc8831e3900e113a854b5329e4e8
2021-06-04 18:27:19 +00:00
George Mount
60dd581ac2 Fix ListView not moving during catch
Fixes: 189294917

When a ListView has clickable items in it, the over scroll
animation "catch" wasn't properly catching. The problem was
that the over scroll animation was checked and the touch mode
was set, and the touch mode was checked later. Unfortunately,
the touch mode variable that was checked was different from
the one that was set.

Test: manual and new ListViewTest
Change-Id: Iaf9b51d028d1f14195ca38a5fd511141262487ff
2021-06-03 23:52:15 +00:00
Treehugger Robot
c96c073294 Merge "/widget/OWNERS: Change TextView to TextView*" am: df2c78d226 am: c34ef6d2df am: 8aac56ee8f am: 44e9c3609c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1721330

Change-Id: Ic13c42d7e063e35bd980ddd0d6f10552d5198b9e
2021-06-03 10:17:38 +00:00
Treehugger Robot
8aac56ee8f Merge "/widget/OWNERS: Change TextView to TextView*" am: df2c78d226 am: c34ef6d2df
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1721330

Change-Id: I0ecc013cfed3e20106faea2bcfcaf4966b910a91
2021-06-03 09:40:41 +00:00
Nader Jawad
fe8fcaace8 Merge "Updated EdgeEffect to respect accessibility settings" into sc-dev am: ced65d71ae am: 6b151ac708 am: e4c012a7a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14793545

Change-Id: I6cc9fc5e08f1ccb27c176a3e92b4cfda0f6f414f
2021-06-02 23:19:55 +00:00
Nader Jawad
7d0ed97427 Updated EdgeEffect to respect accessibility settings
Modified EdgeEffect to be disabled if the global
ValueAnimator#areAnimatorsEnabled flag is false

Fixes: 189870180
Test: Added CTS test
Change-Id: I7adb00342f6f89655719d6c5b64316fc58589e0a
2021-06-02 13:08:08 -07:00
Ahaan Ugale
d6f1da05ce Merge changes from topic "tr-anim" into sc-dev am: 27008c1123 am: 565c15a8d6 am: 2af2705bed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14661091

Change-Id: I396b6f349e72410c10890e1814866805bc239933
2021-05-28 03:30:19 +00:00
Ahaan Ugale
1cd23470b0 /widget/OWNERS: Change TextView to TextView*
Grant access to files related to TextView to the TextView owners.

Change-Id: Ib4bd2b029bc316764ef49d7944e5bee194691bbf
2021-05-27 20:16:29 +00:00
Ahaan Ugale
df75689d4d Translate: Text alpha animation on toggling translated state.
Apply a simple text alpha animation when toggling between original and
translated text. The text is fully faded out, then swapped to the new
text, then the fading is reversed.

Quick toggles are handled by ending the previous animation (which resets
the alpha value) when starting a new one. If the toggle is extremely
fast (<250ms for the currently defined animation duration), the text
stays in it's original state instead of swapping back-and-forth. This is
arguably not ideal, but anyway not worth the complexity for fixing.

There is an unhandled edge case where if the color is changed by the app
during the animation, the app's change would get overridden. It should
be rare and doesn't seem very important to fix.

Bug: 178651829
Test: atest CtsTranslationTestCases
Test: manual - across several apps, while scrolling, concurrently
 interacting with the app, concurrently closing the app, selecting text
 during the animation (with animation speed slowed down to see the
 effect).
Change-Id: I08a26de2253bb345f01186a6748b2d0ff6c2a419
2021-05-27 09:34:18 -07:00
TreeHugger Robot
94ea91221a Merge "Fix a bug in sentence detection when input is too long." into sc-dev am: 87d4c9a9ca am: fd4cb6a4bd am: de4067a73b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14674299

Change-Id: I85adf98689190991b18a24e53e2d092628e01208
2021-05-25 18:58:53 +00:00
TreeHugger Robot
f5fc0d66ae Merge "Fix a bug in SpellCheckSpan update logic." into sc-dev am: 7568c8cd9a am: 65b6f47a1c am: 9c49ef5e66
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14609923

Change-Id: I6c24521988dea14817f93482930d1f79bca511fe
2021-05-25 18:30:05 +00:00
TreeHugger Robot
87d4c9a9ca Merge "Fix a bug in sentence detection when input is too long." into sc-dev 2021-05-25 18:25:52 +00:00
TreeHugger Robot
7568c8cd9a Merge "Fix a bug in SpellCheckSpan update logic." into sc-dev 2021-05-25 18:00:58 +00:00
Stevie Kideckel
69f0d3fe50 Merge "Add a flag for the fps of the AnalogClock" into sc-dev am: ef1e1dfb44 am: 5a2a0bfc18 am: 4e292b515e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14663326

Change-Id: Id3a471f408f79537ed8aa7a5769376b83bf54b96
2021-05-25 13:21:53 +00:00
Stevie Kideckel
ef1e1dfb44 Merge "Add a flag for the fps of the AnalogClock" into sc-dev 2021-05-25 09:58:28 +00:00
George Mount
17d24b05ab Merge "Fix overscroll doesn't affect scrolling when released" into sc-dev am: ebde5e48e6 am: 95734a666f am: ad0562edf8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14681840

Change-Id: Ie15a8da1bc43631bda39f594cdec9ac44f6e48a5
2021-05-24 15:56:00 +00:00
George Mount
ebde5e48e6 Merge "Fix overscroll doesn't affect scrolling when released" into sc-dev 2021-05-24 15:19:49 +00:00
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
George Mount
d2cbe50f18 Fix overscroll doesn't affect scrolling when released
Bug: 188531406

When an EdgeEffect is flung past 0 into negative values, it
shows a stretch from the other side. To prevent this, the EdgeEffect
animation is now terminated when it reaches 0. I also made it so
that dragging to a value of 0 releases the EdgeEffect.

I also fixed the nested scrolling so that the stretch release
of ListView occurs before the onNestedPreScroll().

Test: new tests and manual testing
Change-Id: Ia20a6b96d25cf31ef143511828ddce5c33cee804
2021-05-21 18:28:23 +00: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
Qi Wang
2648035bda Fix a bug in sentence detection when input is too long.
When the unchecked length of the current sentence is too long, the
spell checker should check the first MAX_SENTENCE_LGNTH characters of
the unchecked part. In this case, detectSentenceBOundary should return
[textChangesStart, textChangeStart + MAX_SENTENCE_LENGTH)

Fix: 188875278

Test: manual test
Change-Id: I31847aed2d564f7bc1ff43c83adae3bb7c99c0d1
2021-05-21 17:58:31 +08:00