Allows you to use the (deprecated) AnalogClock widget to
display times other than the current system clock time.
While we're at it, update the AnalogClock widget assets to
contemporary vector drawables.
Bug: 177962166
Test: atest AnalogClockTest
Change-Id: I69e9e89b8f42030e910086ee79bb5a447a00bb84
Bug: 192465706
Stretch overscroll was allowing pull distances beyond 1, but
the effect only applied until 1. This meant that as the stretch
relaxed, it would appear stopped at 1 until it dropped below 1.
This CL does two things. First, it limits the pull distance
to 1, so that if it is pulled beyond 1, the distance remains
1 and the spring will immediately retract from 1 with onRelease().
Second, when the fling hits 1, it stops the fling animation and
immediately begins retracting from a velocity of 0.
Test: new tests and manual testing for visual effect
Test: I23cd8990fff24dbef36a93c16c115948d774a557
Change-Id: I06f1533aed0ce24756c535789fdcc7e99c5bfb9b
This reverts commit cb5a80ea57.
Reason for revert: Was not the cause of the test failure
Fixes: 186622527
Test: atest FrameworksCoreTests:ContextTest
Change-Id: I705854f080200f0465d94a7754e710f05a3ec92c
Notify Content Capture with the text changed event when deselected.
Bug: 184311217
Test: manual
1.long press trigger selection, event is sent.
2.drag selection indicators, send event after the drag is done.
3.deselecting, event is sent.
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I3d05b8e798bfb5b213817b36f163aab0a688bdf4
We enable the logs dump in debug rom, we should only dump logs when
the debug flag is on.
Bug: 182433547
Test: Make sure the flag is disable after test and enable during test.
Change-Id: I0a719ee9c545b4e66f3414d7f57f3d959004071e
Also, handle this config value being set to 0 by hiding the seconds hand
and ticking once per minute.
Bug: 191269485
Test: locally
Change-Id: Ib2b705437d570d46328174d618ec0de6193212ca
Fixes: 190475978
Damped spring animations asymptotically approach their destinations.
The final pixels can take many frames to complete, but stopping them
means that we get a disruptive jump in those final pixels.
This CL detects when the edge effect animation is close to the finish and
completes the animation with a linear velocity that matches a
common velocity at 8 pixels distant. This means that the animation
terminates quicker so that touch events directed at the contents
after the animation completes (e.g. taps) can interact with the contents
soon.
The CL also adjusts the delta for detecting zero in the stretch
animation as it was jumping by a pixel or more at the end of an otherwise
smooth animation.
Test: manual testing for the visual effect
Change-Id: Ie249b0265c5c5939b597668d5afe4f76d0430821
The fail will only be found in the release build, we put the return
in the wrong place.
Bug: 189359744
Test: local disable flag and TextViewTranslationTest pass.
Change-Id: Idd377145b3757abaf528a90a25b6c73e9940f9f8
The ContentCapture service is interested in the selection changes.
When the selection was changed, notifies a text changed event to
ContentCapture.
Bug: 184311217
Test: manual
1.long press trigger selection, event is sent.
2.drag selection indicators, send event after the drag is done.
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ie45f617b132bc240b6cf61ee7ebc3041275f1694
Keep onTranslationResponse() only to save TranslationResponse. We can
move set TransformationMethod logic to TextViewTranslationCallback.
With the current implementation, if the developers overrides
onTranslationResponse(), they don't have a chance to use the TextView
default ViewTranslationCallback implementation because they don't set
the TranslationTransformation, they must implement their solution. If
we move logic to TextViewViewTranslationCallback and the developers
only overrides onTranslationResponse(), they still have a chance to
use the default TextViewViewTranslationCallback if the developers set
the TranslationResponse for View.
Bug: 178353965
Test: manual to make sure translation still works.
Test: atest CtsTranslationTestCases
Change-Id: Iada7f3efbbc7705ecf962c78e275ed942816707f
Sending the notification from the InputConnection layer reduces the
number of events that are handled (merged) by ContentCapture. We are
also able to handle composing span being removed; at the TextView layer,
we cannot do that as we don't know if the composing span will be added
back, which happens on typing).
Bug: 184311217
Test: manual - append chars, delete chars, replace text, move cursor to
composing text, move cursor to remove composing span, drag cursor
Test: atest android.contentcaptureservice.cts.LoginActivityTest
Change-Id: I0e9d153cf7ba2734f38cb1b6044eb7b670fb34ad
Potential NPE was added in ag/14881530
Fix: 190353630
Test: locally with sample app with and without items
Change-Id: I946b6b6719600cb638db1b15d74a8c3af6587f32
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
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
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
AccessibilityManager is used to send an a11y event when the Toast is
shown, so unregister the client after it's shown
Test: Track clients in A11yManagerService before and after
multiple toasts are shown with adb shell dumpsys accessibility,
atest ToastUITest
Bug: 189010828
Change-Id: Ie4759d2f67ab9e3149d44169b812d8ec2316c266
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
Modified EdgeEffect to be disabled if the global
ValueAnimator#areAnimatorsEnabled flag is false
Fixes: 189870180
Test: Added CTS test
Change-Id: I7adb00342f6f89655719d6c5b64316fc58589e0a
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
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