Commit Graph

9004 Commits

Author SHA1 Message Date
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
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
George Mount
9d7658ac57 Merge "Allow fling during stretch in ListView" into sc-dev 2021-05-05 15:50:08 +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
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
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
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
TreeHugger Robot
7b0989f35d Merge "Dismiss magnifier correctly in concurrent editing scenario" into sc-dev 2021-05-03 15:44:37 +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
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
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
Yohei Yukawa
a35ebcf88e Fix stale EditorInfo upon EditText#setText()
This is a follow up to our previous CL [1], which added initial
surrounding text support into EditorInfo and let TextView support it.

What we overlooked was that calling TextView#setText() would trigger

  TextView#onCreateInputConnection()

before TextView#mText is updated to the new value.  As a result,
EditorInfo is initialized with a stale surrounding text information.

With this CL, EditorInfo will correctly be initialized with the new
text specified to TextView#setText().

One complicated thing in this CL is InputMethodManager also has some
issues about how to drop spurious

  InputMethodService#onUpdateSelection()

while InputConnection is being replaced with a new instance.  I ended
up having to introduce a hacky boolean

  Editor#mHasPendingRestartInputForSetText

to work around this in the TextView/EditText. This workaround is
expected to be removed/revisited as part of Bug 186582769.

 [1]: Ie04f2349b1157408aa8ed9044aea12ce99132cb4
      c486acc4d2

Fix: 161330778
Test: atest CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: Iee3b754eea319861b2eb955d6cc95ba13006b55e
2021-04-27 19:20:16 -07:00
TreeHugger Robot
1700fa9e5c Merge "Reduce animation completion epsilon to avoid early end." into sc-dev 2021-04-28 00:08:30 +00:00
Stevie Kideckel
cda49ca089 Merge "Fix some potential nullability issues in RemoteViews" into sc-dev 2021-04-27 20:10:27 +00:00
Stevie Kideckel
957a33fe0a Fix some potential nullability issues in RemoteViews
Test: Ran locally on device, all sample widgets still worked
Test: atest RemoteViewsTest
Bug: 185316709

Change-Id: I60c235ea196dd106325e79962e545c582a975168
2021-04-27 13:44:26 +00:00
Qi Wang
0ebb4d88a1 Merge "Validate spell checker suggestions before applying." into sc-dev 2021-04-27 06:26:43 +00:00
TreeHugger Robot
400dc92ebe Merge "Fix Magnifier position updates" into sc-dev 2021-04-26 22:27:40 +00:00
Vishnu Nair
f752c800d3 Fix Magnifier position updates
When the magnifier content moves relative to the parent surface,
it will call setPosition on the content surface control. This conflicts
with position updates called by the BlastBufferQueue adapter
causing a flicker on screen. Fix this by providing a wrapper surface
to BlastBufferQueue adapater to send buffer updates.

Fixes: 186072574
Test: Select text and see magnifier surface does not flicker or move
around

Change-Id: Idfcc06a5d90f400f69e5cbe91008a0cb59fd4646
2021-04-26 10:27:50 -07:00
Qi Wang
cfa318ee4d Validate spell checker suggestions before applying.
Fix: 185786752
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: Icf447fc3ab174bc17af0e823b830f5abef6071df
2021-04-26 10:06:37 +08:00
George Mount
e4f9d4f632 Reduce animation completion epsilon to avoid early end.
Fixes: 184892316

Changed the animation termination epsilons to make sure
that the animation doesn't end early and cause a jerky
end.

Test: visual inspection
Change-Id: I56e4ccb50cee95e713e92ffb659eff4dd026dd12
2021-04-22 16:20:25 +00:00
Chun-Yi Lee
6a213319a8 Merge "Move CtsAutoFillServiceTestCases to group presubmit-large" into sc-dev 2021-04-22 11:11:55 +00:00
Stevie Kideckel
32b16fa4fc Merge "Expose GridView/Layout APIs via @RemotableViewMethod" into sc-dev 2021-04-22 09:33:43 +00:00
easoncylee
e9f67379be Move CtsAutoFillServiceTestCases to group presubmit-large
The test config takes longer than 15mins to run. Move it to a dedicated
group for running slow presubmit Test Mapping test.

Some more context is in the referenced bug, e.g, b/174495337
The group will work exactly the same as presubmit for now.

Bug: 174654670
Bug: 174495337
Test: none
Change-Id: I946061e2c5a75b12ca370d172db32a8f7e8e8f68
2021-04-21 13:24:07 +00:00
Stevie Kideckel
9f8a7db5f9 Expose GridView/Layout APIs via @RemotableViewMethod
Bug: 185972660
Test: Built and ran locally, annotation change only

Change-Id: I85fc00ae62b124653e20fd53f9179493463933e0
2021-04-21 09:20:25 +00:00
Joanne Chung
be20ca46f6 Merge "API feedback: Translation View API refinement." into sc-dev 2021-04-21 00:29:24 +00:00
TreeHugger Robot
32e08f8b0d Merge "Revert^2 "Introduce SpellCheckerSessionParams."" into sc-dev 2021-04-20 16:45:50 +00:00
Kohsuke Yatoh
d4e3278b3e Revert^2 "Introduce SpellCheckerSessionParams."
Updated test added in commit 7000b5f89d8c43af5ccd116c1840ea89dd9f17dc

Bug: 179804789
Change-Id: I48c744815662cabcbef8e823916b1e6bba9c9b17
2021-04-20 14:28:56 +00:00
Jeff DeCew
5e7b103e14 Merge "Allow passing 0 to RemoteViews.setDimen() or setAttr()" into sc-dev 2021-04-20 13:44:38 +00:00
TreeHugger Robot
6ba89099f8 Merge "Ensure that the root view is an AppWidgetHostView in setRemoteAdapter" into sc-dev 2021-04-20 11:33:59 +00:00
Yi-yo Chiang
ea80476aa4 Merge "Revert "Introduce SpellCheckerSessionParams."" into sc-dev 2021-04-20 04:41:45 +00:00
Yi-yo Chiang
cef2817d90 Revert "Introduce SpellCheckerSessionParams."
Revert "Use SpellCheckerSessionParams in CTS."

Revert submission 14191185-ky-tsm

Reason for revert: breaks build test_suites_x86_64 b/185855437
Reverted Changes:
I724aaad15:Introduce SpellCheckerSessionParams.
I510a4cfec:Use SpellCheckerSessionParams in CTS.

Change-Id: I4173bd5bee62f02a248de69df77420c39326b9f0
2021-04-20 03:57:05 +00:00
Joanne Chung
f6a52811a1 API feedback: Translation View API refinement.
Bug: 178046780
Test: manual
Test: atest android.translation.cts.UiTranslationManagerTest
CTS-Coverage-Bug: 177960696

Change-Id: I557ca4b3b4e7324af12e81dd8b5ac8a04a17b6b8
2021-04-20 11:14:22 +08:00
Kohsuke Yatoh
93528b8f5b Merge "Introduce SpellCheckerSessionParams." into sc-dev 2021-04-20 03:06:40 +00:00
Kohsuke Yatoh
94635fcb89 Introduce SpellCheckerSessionParams.
SpellCheckerSessionParams encapsulates parameters for
TextServicesManager#newSpellCheckerSession().

Bug: 179804789
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I724aaad15b0a4bd38f6a24585c4c45cfeee5b499
2021-04-17 22:49:25 +00:00
Ahaan Ugale
7110641881 AutoTranslate: Pad view text for compatibility reasons.
Some apps operate on the view text based on layout calculations made on
the transformed text. This can cause issues (even crashes) if the
transformed text is longer than the original, as is often the case with
Translate. A previous temporary fix,
I685ae4a9752c817db81f0d736f1d746b2e4a9839, ellipsized the translated
text. This change fixes it properly by instead padding the original
text.

A followup change will make this controllable by API instead of padding
every TextView.

The en space character, U+2002, is used for the padding here. It seems
to work well in practice for multiple languages. We don't make this
configurable through API as it could make debugging harder (issues
triggered by server-side changes).

Bug: 179693024
Test: atest CtsTranslationTestCases
Test: manual - toggling between original and translated, scrolling, new
 views appearing, multiple apps
Change-Id: I9d7db5d2bc200e4042baf3267796f00cfc298f19
2021-04-16 19:38:28 -07:00
Jeff DeCew
208b1b1b69 Allow passing 0 to RemoteViews.setDimen() or setAttr()
Bug: 185488522
Test: atest RemoteViewsTest
Change-Id: I535e44a431701e68edcfaf527e326fd0e769b16a
2021-04-16 13:08:40 -04:00
Stevie Kideckel
fb2df70041 Ensure that the root view is an AppWidgetHostView in setRemoteAdapter
Bug: 185367016
Test: atest RemoteViewsFixedCollectionAdapterTest

Change-Id: I77d866157e97c4507243dbc2cd5411384f885458
2021-04-16 10:03:06 +00:00
Michel Comin Escude
219106593d Merge "Fixed and decreased isAtEquilibrium thresholds" into sc-dev 2021-04-14 18:03:18 +00:00
Joanne Chung
bef7481684 Merge "Add debug log to help to debug translation problem." into sc-dev 2021-04-14 16:27:31 +00:00
Michel Comin Escude
0ca911f5f8 Added velocity scalar and updated spring values
Updated spring values to the latest ones agreed in design. In addition,
added a velocity multiplier that only affects after it absorbs an impact
at the scroll boundary. This will help to increase the spring behavior
when we fling the content, but keeping it controlled when we pull and
release.

Bug: 183768138
Test: ran EdgeEffectTest and visual
Change-Id: I4ed7b01dd42a9a5adda637917369c349a6ae2f76
2021-04-14 03:07:53 +00:00
Michel Comin Escude
0c81801f9e Fixed and decreased isAtEquilibrium thresholds
Distance and speed were multiplied by LINEAR_STRETCH_INTENSITY which is
not directly related to speed and and distance. Moreover the velocity
threshold was a little bit high (1/0.016, wich means 62 pixels/second)
and the distance as well (1 is ok if there's no scale but since there's
some stretching the difference was being magnified).

Bug: 184892316
Test: EdgeEffectTests and visual
Change-Id: Ibd7adb16d1d00df0ab6e96132bfe96a4fa4d45dc
2021-04-13 18:50:22 -07:00
Nader Jawad
e178f50356 Merge "Adjusted interpolation and stretch intensity" into sc-dev 2021-04-13 22:11:11 +00:00
Michel Comin Escude
9ed86141f2 Adjusted interpolation and stretch intensity
Updated stretch intensity to 0.016 and added a new uniform to control
the intensity of the interpoloation

Bug: 183768138
Test: ran EdgeEffectTest and visual
Change-Id: Iac10bee5980802fffe838ed83e02b7c41dee6f71
2021-04-13 12:30:51 -07:00
Pierre Barbier de Reuille
bc9e66e108 Merge "Add attribute setters for RemoteViews" into sc-dev 2021-04-13 17:10:24 +00:00
Pierre Barbier de Reuille
11d243e01c Add attribute setters for RemoteViews
This implements go/remoteviews-attribute-setters

Bug: 184931139
Test: atest CtsWidgetTestCases:RemoteViewsTest
Change-Id: I135ab857d3a3a52bbb02ee3226e2bf723d8c916a
2021-04-13 09:49:34 +01:00
Joanne Chung
8960d6667b Add debug log to help to debug translation problem.
There are some issues the resume/finish seems not work well. The
debug flag should be enabled manually, but in the most time the
user may forget to enable it before testing. Try to enable it in the
debug rom to help debugging, we use b/182433547 to trace the disable
this check before rom release.

Bug: 182433547
Test: manual
Change-Id: I2f85a0e17f8a2b8a4b93252044cf48d739b4eca2
2021-04-13 13:58:03 +08:00