Commit Graph

8840 Commits

Author SHA1 Message Date
Pierre Barbier de Reuille
574718564e Merge "Framework changes for go/widget-size-specification" into sc-dev 2021-02-17 00:34:18 +00:00
TreeHugger Robot
6c9f4850fb Merge "ScrollView and HorizontalScrollView stretch overscroll" into sc-dev 2021-02-17 00:30:32 +00:00
Pierre Barbier de Reuille
d7541b8990 Framework changes for go/widget-size-specification
Update the framework to:

1 - Allow creating RemoteViews with a mapping from size to layouts
2 - Use the closes sized layout in any given situation
3 - Allow the launher to specify the current size when inflating a
    remote views

Bug: 179025145
Test: atest android.widget.cts.RemoteViewsSizeMapTest
Change-Id: Icf98d01bd0cf8b48c47555a1af6acb498b46b1a4
2021-02-16 21:24:11 +00:00
TreeHugger Robot
b399995df7 Merge "Placeholder implementation of stretch overscroll using offset" into sc-dev 2021-02-16 17:47:50 +00:00
Oli Lan
0e588cc322 Merge "Add ClipDescription method to determine if the clip is styled text." into sc-dev 2021-02-15 16:14:15 +00:00
George Mount
97f04fe7d3 ScrollView and HorizontalScrollView stretch overscroll
Bug: 178807038

Modify ScrollView and HorizontalScrollView to support
stretch overscroll.

Test: I18820794f2511ff4b7df1c5c6a9d7a2d5fafeaa0
Change-Id: I1370b702ce7331269744033c6acb61b84519c853
2021-02-12 21:12:07 +00:00
George Mount
f1de89b16c Placeholder implementation of stretch overscroll using offset
Temporarily use an offset RenderEffect for the stretch overscroll.
This makes it possible to visually validate the effect and start
writing CTS tests to ensure it is functioning.

Bug: 178807038
Test: Iab32812bfa626ae6932f52c1a9af78069b5dc6ac
Change-Id: I5b0da0e669d36f4149cd58b4b3aff149a1fa7e14
2021-02-11 23:17:16 +00:00
TreeHugger Robot
5febe8f633 Merge "Clean up: Remove mIsSentenceSpellCheckSupported since it is always true." into sc-dev 2021-02-11 20:14:47 +00:00
George Mount
0901fc33f7 Update the EdgeEffect API
Bug: 178807038

EdgeEffect adds getDistance() to allow the developer to
determine how much of the pull was consumed by the EdgeEffect.
onPullDistance() is similar to onPull() except that it returns
the consumed pull distance.
A new constructor was added to allow EdgeEffect attributes to
apply to Views.

Test: I7f6d6153c1a5bc714ad1935ae0c78907e6839547
Change-Id: Ie29b081cb34af0219287bd1702fea8d273a78d74
2021-02-10 21:23:15 +00:00
TreeHugger Robot
36192d4044 Merge "Update Toast visuals + motion" into sc-dev 2021-02-10 20:53:07 +00:00
TreeHugger Robot
0177fad845 Merge "Add edgeEffectType attribute and type property" into sc-dev 2021-02-10 17:57:54 +00:00
Beverly
75a4033db8 Update Toast visuals + motion
Puts Toast style/animation changes behind a FeatureFlag

Toasts can be added via Toast APIs OR legacy apps can add the
window directly. Because toast windows can be added directly by legacy
apps, DisplayPolicy.java requires that toast windows are removed
after TOAST_WINDOW_TIMEOUT.  This also means Toast windows added via
the Toast APIs are subject to this timeout. Therefore, this CL also
increases the timeout by 600ms to account for SystemUI's in/out
toast animations.

Bug: 169587378
Test: atest ToastUITest
Test: manual, rotate device while toast is showing
Change-Id: Ib17655c253f4ec4f7018cc5f7939b88a50ea5014
Merged-In: Ib17655c253f4ec4f7018cc5f7939b88a50ea5014
2021-02-10 17:08:51 +00:00
George Mount
ba1c4c4e30 Add edgeEffectType attribute and type property
Bug: 178807038

This adds the edgeEffectType property and
type attribute. These will be used to
enable stretchy edge effect for overscroll.

Merged-In: I16f20b36d9a15c08e0a37f98572ef9c9f8fbc88f
Test: new CTS test for setting/retrieving the effect type.
Test: Ic363f71d241649d15faa86434516457e62b261f4
Change-Id: I16f20b36d9a15c08e0a37f98572ef9c9f8fbc88f
2021-02-10 15:48:02 +00:00
Oli Lan
4d5c48d988 Add ClipDescription method to determine if the clip is styled text.
This adds a new method to ClipDescription to allow callers to
determine if the associated ClipData is styled text, without
accessing the ClipData directly.

This information is used by editors such as TextView or WebView
when they show a selection toolbar, in order to determine if a
"Paste as plain text" option should be shown. Currently, ClipData
must be accessed in order to do this, so a clipboard access
occurs whenever text is selected.

Avoiding these clipboard accesses is desirable because a user-visible
message may in future be shown whenever ClipData is accessed
(see b/167676460), which may cause user confusion.

Bug: 167660455
Test: new tests added to ClipDescriptionTest in CTS
Change-Id: I48bea4d11a68b198d60016b364a3cfa0b0bf277e
2021-02-10 10:06:05 +00:00
Stevie Kideckel
2d2d20741b Add a RemoteViews API for outline corner radii
Bug: 179478275
Test: built test app to use APIs, atest
Change-Id: I0da0f3fcb5d01f9e94e75f2fc17494bb7902ac7f
2021-02-08 15:17:38 +00:00
TreeHugger Robot
3ae84f530b Merge "Rename InputConnecton#setImeTemporarilyConsumesInput" into sc-dev 2021-02-07 03:13:55 +00:00
TreeHugger Robot
4b0a9bd7dd Merge "Make EditorInfo.internalImeOptions parcelable." into sc-dev 2021-02-06 04:53:22 +00:00
Stevie Kideckel
ae11a1abcf Merge "Enable use of of CompoundButtons in RemoteViews" into sc-dev 2021-02-05 22:18:25 +00:00
Lan Wei
66b21086e3 Rename InputConnecton#setImeTemporarilyConsumesInput
Rename InputConnecton#setImeTemporarilyConsumesInput as InputConnecton#setImeConsumesInput

Bug: 175362887
Bug: 179143513
Test: atest FrameworksCoreTests:TextViewTest
Test: atest CtsWidgetTestCases:TextViewTest

Change-Id: I8ac1ea4d53f747b0086ed415ff90793dfc6155bc
2021-02-05 12:16:22 +08:00
Steven Kideckel
c42edd69f9 Enable use of of CompoundButtons in RemoteViews
This change adds @RemoteView and @RemotableViewMethod to the relevant
views we'd like to enable. New APIs have been added to set Icons in
CompooundButton and Switch.

onCheckedChange support will be added in a follow-up CL.

CompoundButton.setChecked and RadioGroup.check aren't directly remotable
since RemoteViews will need to control those calls directly to ensure
that any onCheckedChange listeners aren't triggered by RemoteViews
actions.

Bug: 179245670
Test: manual, atest
Change-Id: I85e2aee62cf39ed008d9c9c1fece813293841fbd
2021-02-03 23:00:24 +00:00
Stevie Kideckel
ac2f0dbe00 Merge "Add support for time zones to AnalogClock" into sc-dev 2021-02-03 18:47:22 +00:00
TreeHugger Robot
e503bf9dd7 Merge changes from topics "remoteview_resources_setters_sc", "remoteview_resources_setters_sc2" into sc-dev
* changes:
  New setters extracting values from complex unit dimensions.
  Refactoring the reflection actions to prepare for a third one.
  New setters extracting values from resources for RemoteViews.
2021-02-03 14:31:28 +00:00
Tony Mak
2b2f788072 Merge "Do not invoke textclassifier when dimissing the selection" into sc-dev 2021-02-03 12:28:14 +00:00
Chenxi Ni
d825375fcc Clean up: Remove mIsSentenceSpellCheckSupported since it is always true.
Bug: 179223118
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: Ic47a6aee5fb29a9549ecd72c5a5a6aea889ad74b
2021-02-03 15:03:15 +08:00
Steven Kideckel
b9184b44a0 Add support for time zones to AnalogClock
The format, attribute and method names are analogous to the existing
APIs in TextClock.

Bug: 177997338
Test: Manual: wrote a local app that uses time zones from XML and
RemoteViews.setString, including with null/invalid values

Change-Id: Ic40c1c6846e923475b7c26e5ec2912786e046c96
2021-02-02 18:56:56 +00:00
Stevie Kideckel
dfeb40318e Merge "Add support for seconds hand to AnalogClock" into sc-dev 2021-02-02 15:43:22 +00:00
Steven Kideckel
7556f48861 Add support for seconds hand to AnalogClock
Bug: 177997338
Test: manual - wrote app to use runtime apis
Change-Id: I05b3ebb19598a4f1d605f9ba62005aaab733666d
Merged-In: I05b3ebb19598a4f1d605f9ba62005aaab733666d
2021-02-02 00:42:03 +00:00
Pierre Barbier de Reuille
24ffac5ccd New setters extracting values from complex unit dimensions.
These new setters allow defining configuration dependent values at
runtime (to some extend) in a way that is currently not possible.

See go/widgets-configuration-setters for details

Bug: 178591376
Test: atest android.widget.cts.RemoteViewsTest
Change-Id: I5a1582b4fa7f70ad8d922c72f773fe254ef2f9ff
2021-02-01 21:26:26 +00:00
Pierre Barbier de Reuille
2a98cf0f64 Refactoring the reflection actions to prepare for a third one.
This creates a base class to resolve the method and split the part
determining the value for the parameter.

Bug: 178591376
Test: atest android.widget.cts.RemoteViewsTest
Change-Id: I95b6e6bc56d4c1968fefe4976de03cedfdb9b6a4
2021-02-01 21:26:04 +00:00
Pierre Barbier de Reuille
3aa4b1994e New setters extracting values from resources for RemoteViews.
These new setters allow defining configuration dependent values at
runtime (to some extend) in a way that is currently not possible.

See go/widgets-configuration-setters for details

Bug: 178591376
Test: atest android.widget.cts.RemoteViewsTest
Change-Id: I31c24e6e7bb67df7896f8117a9999f0c1edb8e1a
2021-02-01 17:18:28 +00:00
Chenxi Ni
821234c8dd Fix InputConnection#performSpellCheck logic:
- Change to trigger full content spell check when calling InputConnection#performSpellCheck.
 - When calling InputConnection#performSpellCheck, forces to do spell check even user is editing the word.

Bug: 177947314
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Test: Manually test the add to dictionary case with Gboard
Change-Id: I4f7c2e638e517fe91776ef0a285ee20e4cdc9a92
2021-02-01 17:49:16 +08:00
Taran Singh
2b4bd4c6fb Make EditorInfo.internalImeOptions parcelable.
Followup to I5a5e73e1dec776665f28a7e2eb091b555198001b.
internalImeOptions field should be parcelable.

Fix: 157870379
Test: Manually using steps in bug
Change-Id: I12b442b8b2d8cf83aa4cc789133b42251ad2c191
2021-01-29 16:29:04 +00:00
Tony Mak
90e8a19f7c Do not invoke textclassifier when dimissing the selection
Problem: When dismissing the selection by clicking the TextView,
invalidateActionModeAsync is called to ask text classifier to
generate a new smart action for the selected text. It is not necessary
because the selection is going to be dismissed.

Cause:
To update the smart action chip when a user adjusts the selection
span by dragging the selection handle, we call showFloatingToolbar()
when we get an ACTION_UP event. The problem is that we also get
an ACTION_UP event when user dismisses the seletion by clicking
the textview. In that case, we don't need to update the smart action
chip or show the floating toolbar.

Solution:
Only call ShowFloatingToolbar() when we get an ACTION_UP and also
the user is modifying the selection/insertion curosr.

Test: Added a test in TextViewIntegrationTest.
Test: Manual. Input a long phone number. Change the selection span to
select fewer digits. Click "Call" and check the prefilled number.
Test: Manual. Drag the insertion curosr(w EditText), floating toolbar is
reshown when lifting the finger.

Fixes: 169042542

Change-Id: Ic398a8521d99218b14689fe0668adc22e6b143c5
2021-01-29 13:19:53 +00:00
Joanne Chung
a5fa9bc0f7 Add initial View's APIs for auto translation
The initial APIs for auto translation flow. The implementation of
sending request and dealing spans will on the follow up changes.

Bug: 172969740
Test: manual build pass. Use a sample app to call api get expected
result.

Change-Id: Ief45190026e6205ff18366c1aaba8f424a4df00c
2021-01-25 18:57:14 +08:00
Kohsuke Yatoh
93d47b0487 Add supportedAttributes param for spell checker.
Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I22f4a59a0c8ccb43f799351062f9fabca42403cd
2021-01-20 20:06:12 +00:00
Treehugger Robot
da1039a992 Merge "AbsSeekBar: Fix growRect computation" am: e1f0416a17 am: 48b3ec73d9 am: e577801dbf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1550782

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic443e0e5839239339b190b6775229058f648b856
2021-01-19 22:58:02 +00:00
Treehugger Robot
e577801dbf Merge "AbsSeekBar: Fix growRect computation" am: e1f0416a17 am: 48b3ec73d9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1550782

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8c779db0fcf2090ed6e6e624ad91279eaad19bf3
2021-01-19 22:44:04 +00:00
Adrian Roos
c5ce225fdf AbsSeekBar: Fix growRect computation
Fixes an issue with the growRectTo computation where if the
difference between the current and target size wasn't an even
number, the resulting rect would not actually have the correct
size.

Also, asserts using the thumb bounds, rather than the view
bounds in case the thumb is not perfectly centered within the
view due to rounding errors on odd densities.

Fixes: 173872859
Test: atest AbsSeekBarTest
Change-Id: Ib2b81a91ba8feeb6743a4e4a588d6116d231eb8d
2021-01-18 10:50:52 +00:00
Nikita Dubrovsky
3b59bf746e Merge "Enable Content Capture for ImageViews by default" 2021-01-15 21:56:54 +00:00
Nikita Dubrovsky
98fcc0850d Enable Content Capture for ImageViews by default
Bug: 167712713
Test: atest CtsWidgetTestCases:ImageViewTest
Test: Manual
Change-Id: I5a77f5e19d6021e799c5fe13c4c9b71c039ff8dc
2021-01-14 21:33:14 -08:00
Jeff DeCew
b1e9252d65 Merge changes from topic "decorate_custom_notifs"
* changes:
  Improve RemoteViews to simplify notification view hierarchy.
  Fully custom view notifications now receive minimal decoration when targeting S.
2021-01-11 21:48:22 +00:00
Nikita Dubrovsky
19d37240a5 Merge "Add MIME types to ViewStructure and autofill/cc ViewNode classes" 2021-01-11 21:17:53 +00:00
Nikita Dubrovsky
e8f7c4ba7c Add MIME types to ViewStructure and autofill/cc ViewNode classes
Bug: 168253885
Test: atest FrameworksCoreTests:TextViewOnReceiveContentTest
Test: Manual
CTS-Coverage-Bug: 170893906
Change-Id: Iac8f73a7a022f20f59ecef9be89e3189ca106e4c
2021-01-11 20:57:48 +00:00
TreeHugger Robot
08a80b3208 Merge "[Magnifier-77] Show it on long press selection" 2021-01-11 19:05:34 +00:00
Jeff DeCew
cb189d4630 Improve RemoteViews to simplify notification view hierarchy.
Test: manual
Change-Id: Iab1579a3e992a53f1e44ff7236511d1093de048f
2021-01-08 17:01:11 -05:00
Jeff DeCew
7946e72910 Annotate method arguments with type annotations
Fixes: 176818261
Test: n/a
Change-Id: If8196c2e86ba7c6b35e3b96cc73191598bab6c8e
2021-01-08 21:05:09 +00:00
Mihai Popa
c9471655ee [Magnifier-77] Show it on long press selection
Before this CL, the TextView magnifier was shown when selecting text,
but only when a selection handle was explicitly grabbed. This CL also enables
the magnifier when selection is performed by dragging after long press.

Bug: 119819194
Change-Id: I9546023723ef9ff84dbc6ca4c8fe5642c66a0146
Test: manual testing
2021-01-08 18:25:23 +00:00
Jeff DeCew
7ccbcf1713 Merge "Fill out RemoteViews methods for editing LayoutParams." 2021-01-08 14:53:47 +00:00
TreeHugger Robot
8fc190c6fc Merge "IME API: InputConnecton#setImeTemporarilyConsumesInput(boolean)" 2021-01-08 07:20:49 +00:00
Lan Wei
30fe6aa964 IME API: InputConnecton#setImeTemporarilyConsumesInput(boolean)
Add API to set IME will temporarily consumes the input, for
this case, the cursor will be invisible in the app.

Bug: 175362887
Test: atest FrameworksCoreTests:TextViewTest
Test: atest CtsWidgetTestCases:TextViewTest

Change-Id: Ic04cacfd73f1f4cb254bb16caf6b04c00c91a318
2021-01-08 09:23:55 +08:00