Commit Graph

8905 Commits

Author SHA1 Message Date
George Mount
21372004f1 Change targetSdk for USE_STRETCH_EDGE_EFFECT_BY_DEFAULT
We want to test the stretch EdgeEffect for all apps, not
just those that target S and higher.

Bug: 182191316
Test: None.
Change-Id: I29a46a5c9ac6bc64f0abfa8dbd4605ed7d75ea62
2021-03-17 20:54:50 +00:00
TreeHugger Robot
046c050aa6 Merge "Fix bug in EdgeEffect with glow" into sc-dev 2021-03-17 17:47:22 +00:00
TreeHugger Robot
51bf47cccf Merge "Correct recycling to take setViewId into account." into sc-dev 2021-03-17 16:47:08 +00:00
Nader Jawad
e5395838ce Merge "Update owners for EdgeEffect" am: 0ebddf5fdc am: 1693ebd5d5 am: 783410679c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1636081

Change-Id: I53e9562d40883a57de7d7c0265e4793e69ae9b3d
2021-03-17 16:08:24 +00:00
Pierre Barbier de Reuille
308a272289 Correct recycling to take setViewId into account.
Views shouldn't be recycled if the view id is changed as the identity
of the view is then altered.

Bug: 181985606
Test: atest CtsWidgetTestCases:RemoteViewsTest
Test: atest CtsWidgetTestCases:RemoteViewsRecyclingTest
Change-Id: I68415087297312eb2c1985d272be2ac535507c2a
2021-03-17 11:20:36 +00:00
George Mount
a479a3268f Fix bug in EdgeEffect with glow
Fixes: 182499389

With the glow edge effect, using the drag gesture to reduce
the edge glow could cause the glow to flip and repeat. This
was caused by the update() modifying the determined distance
during the pull when it wasn't animating.

We also force the alpha to be 0 if the pull distance is 0.

Test: manual testing
Change-Id: Iacc1df0fcb92e3380523187badf7ea62d7d19d2f
2021-03-16 20:42:17 +00:00
Nader Jawad
4f901f60e3 Merge "Updated EdgeEffect stretch distance" into sc-dev 2021-03-16 16:39:56 +00:00
Pierre Barbier de Reuille
527b38bd2a Correct config-dependent setters documentation.
Bug: 182825331
Test: N/A
Change-Id: I439ad4fc3a579ccdbb8c7530626a85de44b8daad
2021-03-16 14:15:24 +00:00
Stevie Kideckel
e1f9d6c954 Merge "Remove doc reference to system transitions." into sc-dev 2021-03-16 12:16:02 +00:00
Nader Jawad
10afe4ee42 Updated EdgeEffect stretch distance
Updated stretch constant from 0.1f to 1f
Updated distance to be maximum of width/height

Bug: 182567334
Test: Re-ran CTS tests
Change-Id: I943c7d1013cfabd86bb678fa7b408f0f97a17075
2021-03-16 06:19:07 +00:00
Nader Jawad
ddacdf59e8 Update owners for EdgeEffect
Change-Id: Ibe2c6d253cdc1c448fc405eb75a10860fe791834
2021-03-15 17:38:18 +00:00
Nader Jawad
72f70e8c81 Merge "Fixed crash in EdgeEffect after fling gesture" into sc-dev 2021-03-15 17:27:27 +00:00
Stevie Kideckel
65a7c2c56b Add API for setting a fixed list of RemoteViews on an AdapterView
Bug: 182467111
Test: Sample app trying out different combinations of views and event
listeners
Test: atest RemoteViewsFixedCollectionAdapterTest

Change-Id: Ia3fc0af0499cbfaa85e9eb1bf2a24f1e404f17a3
2021-03-15 10:39:53 +00:00
Nikita Dubrovsky
00a7febee9 Merge "Update logic for drag-and-drop URI permissions for editable TextViews" into sc-dev 2021-03-15 03:55:42 +00:00
Qi Wang
a4bd30da4e Merge "Respect sentence boundary when doing spell check." into sc-dev 2021-03-15 03:09:26 +00:00
Kohsuke Yatoh
6b22120e8f InputMethodInfo attr to suppress spell checker.
If InputMethodService declares suppressesSpellChecker="true", the system
SpellCheckerService will be disabled.

With TextView, when IMSs are switched while the user is editing,
SuggestionSpans that were previously added will not be removed even if
the next IMS declares suppressesSpellChecker="true".
This is because we don't know if the SuggestionSpans were from Spell
Checker, App, or IMS.

Bug: 153473490
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: Ia22b8758111087818beea8c07b1c173f1a94b8e4
2021-03-13 10:07:54 -08:00
Nader Jawad
5554d79f82 Fixed crash in EdgeEffect after fling gesture
Fixed issue where mDistance and mVelocity fields
would be infinite/NaN in situations where onAbsorb
is called before setSize leading to division by zero
issues.

Updated constants to be less significant
stretch

Fixes: 182567334
Test: Updated EdgeEffectTests
Change-Id: I4007b03271c6b5e79e95d5fe6c7c44e8c0869cd1
2021-03-12 20:19:23 -08:00
Nikita Dubrovsky
910746fe96 Update logic for drag-and-drop URI permissions for editable TextViews
Previously, Editor.onDrop used a try/finally block to request and
release URI permissions. This doesn't work for the case when an app
sets an OnReceiveContentListener (or subclasses TextView and overrides
the onReceiveContent() method). If using a background thread to
process the content in the custom impl for receiving content,
permissions will be revoked in the finally block before the app has
had a chance to process the URI.

With this change, when Editor requests permissions, they will be bound
to the app process and released automatically when the app process
terminates.

Bug: 181178998
Test: atest CtsWindowManagerDeviceTestCases:CrossAppDragAndDropTests
Test: Manually verified using development/samples/ReceiveContentDemo
Change-Id: I7ae38069fb741925211b42c7ff28784eb9722ce3
2021-03-12 08:08:57 -08:00
Pierre Barbier de Reuille
92bff6ee07 Merge "Implementation of go/remoteviews-recycle-added-view." into sc-dev 2021-03-12 14:07:36 +00:00
Stevie Kideckel
85d6bfb923 Merge "Recycle the TypedArray used in AnalogClock's constructor" into sc-dev 2021-03-12 11:59:00 +00:00
Pierre Barbier de Reuille
dc8a5f1a30 Implementation of go/remoteviews-recycle-added-view.
Bug: 180915613
Test: atest CtsWidgetTestCases:android.widget.cts.RemoteViewsRecyclingTest
Change-Id: Ieb383ea613e0fd3dc754ef5fe8ae3bb6bb9d1dee
2021-03-12 11:03:02 +00:00
TreeHugger Robot
a9808c3abd Merge "Update the cursor visibility correctly after dismissing popup window" into sc-dev 2021-03-12 07:30:34 +00:00
Seigo Nonaka
f36829cf57 Merge "Use getLineMax for desired text width calculation" into sc-dev 2021-03-12 02:02:45 +00:00
Joanne Chung
9b316222ff Merge "Add debug logs to help clarify the issue" into sc-dev 2021-03-11 14:03:23 +00:00
Qi Wang
4809237810 Respect sentence boundary when doing spell check.
Introduces SentenceIterator into android.widget.SpellChecker and
uses it to detect the start/end of spell check range instead of
using a fixed length.

Fix: 179125303
Fix: 179124679

Test: atest CtsInputMethodTestCases:SpellCheckerTest

Change-Id: If6dd044e24dcaa58381949c221a5f9af57a4104f
2021-03-11 20:15:16 +08:00
Joanne Chung
3cda8bd49f Add debug logs to help clarify the issue
We receive translation doesn't work issues but we don't have enough
log information to help debugging the issue. To help clarify issue

- Add more information when dumpsys activity information
- We use Log.isLoggable() to control if the debug log need to be
printed. But for the development phase, we enable print log on the
debuggable ROM, we will delete it before platform release.

Bug: 181975692
Test: manual. adb shell dumpsys activity <myactivity> --translation
(Can find dumpsys result of sample app in bug 182433547)

Change-Id: I4a9a1667a544fc4d1654c5f297d365a8288b1f4a
2021-03-11 16:34:44 +08:00
George Mount
73046dc2f6 Merge "Use spring animation for stretch overscroll" into sc-dev 2021-03-11 00:43:04 +00:00
George Mount
167dea1218 Merge "Compatibility feature USE_STRETCH_EDGE_EFFECT_BY_DEFAULT" into sc-dev 2021-03-10 23:15:21 +00:00
Seigo Nonaka
4f2bc622b4 Use getLineMax for desired text width calculation
Bug: 178205254
Test: atest TextViewTest
Change-Id: Ide45d75595571293bfa225935482d204160c6289
2021-03-09 13:38:38 -08:00
Adam He
a47c17768c Merge "Full refactor of Translation APIs." into sc-dev 2021-03-09 19:05:54 +00:00
George Mount
61324dbfcc Use spring animation for stretch overscroll
Bug: 171228096

Use the spring animation from the prototype in
EdgeEffect.

Test: manual testing for fling and recede

Change-Id: I7eec03a98f5d26153512ba402d6bb5bc5dc70ffb
2021-03-09 16:47:01 +00:00
Stevie Kideckel
5cb7f07227 Remove doc reference to system transitions.
There's no action the developer should take based on this possibility,
so there's no need to have it in the javadoc for the method.

Bug: 181551575
Test: None, change only touches javadoc
Change-Id: I571bb8c28a3831d8541e1713b0048127c3dc24a2
2021-03-09 11:13:49 +00:00
George Mount
659dc01e5b Compatibility feature USE_STRETCH_EDGE_EFFECT_BY_DEFAULT
Bug: 171228096

Added two ChangeIds for stretch overscroll:

USE_STRETCH_EDGE_EFFECT_BY_DEFAULT makes stretch overscroll
the default.

USE_STRETCH_EDGE_EFFECT_FOR_SUPPORTED makes stretch overscroll
the default for applications that use the new EdgeEffect
constructor that accepts an AttributeSet. This indicates
knowledge of stretch overscroll APIs and can be a proxy for
supporting stretch overscroll.

Test: Both flags on apps that support and don't support new api

Change-Id: If2ec832c9656116fe1aa64d33682c489abbde30f
2021-03-08 21:39:58 +00:00
TreeHugger Robot
b6d634df79 Merge "Add a way to set the View ID of the top-level view on a RemoteViews." into sc-dev 2021-03-08 08:53:12 +00:00
Adam He
59716789f4 Full refactor of Translation APIs.
* Added ViewTranslationRequest/Response
* Added TranslationRequest/ResponseValue
* Removed single TranslationData.
* Moved service.TRequest -> view.TRequest.

Bug: 176208267
Bug: 177371091
Test: atst CtsTranslationTestCases
Change-Id: I25d4bce385d64a8eb9c2a316bd6b5a23e14fb14e
2021-03-05 17:51:03 -08:00
TreeHugger Robot
a9171adcbe Merge "Correct API for new sizes in App Widgets." into sc-dev 2021-03-05 22:44:57 +00:00
Pierre Barbier de Reuille
a4f7b7b1d4 Add a way to set the View ID of the top-level view on a RemoteViews.
Bug: 181985606
Test: atest CtsWidgetTestCases:android.widget.cts.RemoteViewsTest
Change-Id: I2bcd16bef6cfa9a1461c519239dd6a31558eca64
2021-03-05 22:20:06 +00:00
Nader Jawad
6f2ee4b4a0 Merge "Wire SKSL based stretch shader to HWUI" into sc-dev 2021-03-05 03:14:55 +00:00
Pierre Barbier de Reuille
3e443e6b24 Correct API for new sizes in App Widgets.
This follow recommendations from the API council review.

Based on those recommendations: I updated the API and updated the
comments to make the function behavior clearer.

Bug: 181611658
Test: atest android.widget.cts.RemoteViewsSizeMapTest
Test: Local widget to check rendering
Change-Id: Ie9fcedbc7b18b83f6d1220f99240f264e53e3649
2021-03-04 23:27:08 +00:00
Joanne Chung
41a214c2a7 Merge "Make SelectionActionModeHelper hardcoded constants configurable." into sc-dev 2021-03-04 02:30:32 +00:00
Nader Jawad
6701a6014f Wire SKSL based stretch shader to HWUI
--Ported SKSL based stretch shader from OpenGL prototype
--Hooked up the stretch APIs in RenderNode to the stretch
shader.
--Updated RenderNode layer logic to promote the RenderNode to
a layer if there is a stretch to be applied to it in order
to feed the layer as input to the stretch shader

Bug: 179047472
Test: builds + sample overscroll stretches + updated CTS test
Change-Id: I744ff70099fe251ce07f23d067bf13444a468c08
2021-03-03 14:56:17 -08:00
Joanne Chung
a6d3ac4721 Make SelectionActionModeHelper hardcoded constants configurable.
Read the selection timeout value from ViewConfiguration,
ViewConfiguration is statically configurable by the OEM. OEMs can
set the value which works on their device before shipping it.

After privacy sync, we can make the selection context size
configurable by DeviceConfig but we need to provide a
reasonable upper bound. The value is 240 after experiment.

Bug: 169042855
Test: atest CtsTextClassifierTestCases
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest android.widget.TextViewActivityTest
Test: manual. Changes values by command and checks the values.

Change-Id: I59346fdc3b482bca586c13ba6c653d1e9b593922
2021-03-02 14:13:48 +08:00
Seigo Nonaka
0de34e9d87 Override isRestricted for preventing unexpected resource loading
Bug: 179461812
Test: atest FontResourceTest
Change-Id: Ifb731310d31b80522bc82052625716083cac9e6f
2021-03-01 19:23:10 -08:00
Lan Wei
41de37482e Update the cursor visibility correctly after dismissing popup window
The cursor visibilty should be resumed to previous without regard to
whether IME is temporarily cousming input.

Test: atest FrameworksCoreTests:SuggestionsPopupWindowTest

Bug: 179088361
Bug: 175362887

Change-Id: Ibcae7ef47d942b47c00734bd55c6712e0edc3990
2021-02-26 12:04:42 +08:00
Stevie Kideckel
e23c866186 Recycle the TypedArray used in AnalogClock's constructor
Test: Flashed to local device, AnalogClock widgets worked fine
Bug: 177997338
Change-Id: I58edf7643e8f701abc02ce1147a2ae718fde47c7
2021-02-25 15:32:27 +00:00
Pierre Barbier de Reuille
4e14c35736 Merge "Framework implementation of go/widgets-dynamic-colors" into sc-dev 2021-02-24 20:16:40 +00:00
TreeHugger Robot
e4c9e20df0 Merge "Add edge effect type accessors for views that support it" into sc-dev 2021-02-24 16:32:07 +00:00
Pierre Barbier de Reuille
4219de7ded Framework implementation of go/widgets-dynamic-colors
Bug: 179783721
Test: atest CtsWidgetTestCases:android.widget.cts.RemoteViewsThemeColorsTest
Change-Id: I622e79ed8738dc862790191bf9fcf44b0af35c8e
2021-02-24 15:13:29 +00:00
TreeHugger Robot
f6d8a8390b Merge "Update toast parameters instead of re-adding" into sc-dev 2021-02-24 00:34:02 +00:00
Stevie Kideckel
82d0290282 Merge "Add tint list/mode APIs to AnalogClock" into sc-dev 2021-02-23 22:47:59 +00:00