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
Test: verified with the tests that level is maintained on the drawable.
Change-Id: Ifef75e3108f106bb6ca6dcf6594bcca79e5428ac
BUG=129089894
Change-Id: Ic0fc1dc4d48203ef453f6b967330af60abc7b8b5
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
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
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
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
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