Commit Graph

8471 Commits

Author SHA1 Message Date
Shu Chen
2c591e8c6b Merge "Makes sure the magnifier source bounds doesn't beyond the surface." into rvc-dev 2020-02-27 11:47:13 +00:00
Sunny Goyal
c444b514bf Removing possible user defined strings from bugreport view-dump
Bug: 64101886
Test: Verified build
Change-Id: Ifad98a268fc17a2e1572ca3e0962a89447083294
2020-02-25 10:00:37 -08:00
Shu Chen
d06b330767 Makes sure the magnifier source bounds doesn't beyond the surface.
Test: locally verified.
Bug: 150122887
Change-Id: I3df94f0f073197f4a321faac24fa222f9dbb1674
2020-02-24 22:53:59 +08:00
Nikita Dubrovsky
72a7f8a7b3 Merge changes from topic "cursor-control-flags"
* changes:
  Allow setting defaults for DeviceConfig flags plumbed via settings
  Use DeviceConfig flags for cursor drag and insertion handle gestures
2020-02-20 04:23:20 +00:00
Shu Chen
c54b3fad76 Merge "Supports dynamic height for the new magnifier." 2020-02-20 00:43:39 +00:00
Nikita Dubrovsky
37f4c72a28 Merge "Update cursor drag to snap the finger position to the handle + add slop" 2020-02-19 21:18:13 +00:00
Nikita Dubrovsky
9e139179d7 Allow setting defaults for DeviceConfig flags plumbed via settings
Bug: 149790259
Test: Manually
Change-Id: Ie456cf27edab204dfc028023c6364a11b7e5de48
2020-02-19 12:19:53 -08:00
Nikita Dubrovsky
7c583592a8 Update cursor drag to snap the finger position to the handle + add slop
When dragging the cursor...

1) If the touch moves slightly above or below the current line, we keep
moving the cursor along the same line without jumping up and down across
lines.

2) When the drag motion moves downward, jumping to the lower line is
delayed to allow the user's touch to snap to the cursor's handle. Once
the touch is over the handle, we position the cursor above the user's
actual touch (offset such that the finger remains over the handle rather
than on top of the cursor vertical bar). This improves the visibility of
the cursor and the text underneath.

Bug: 148116165
Test: Manually and ran automated tests
  atest FrameworksCoreTests:EditorCursorDragTest
  atest FrameworksCoreTests:TextViewActivityTest
  atest FrameworksCoreTests:TextViewActivityMouseTest
Change-Id: I88432cbc5a7f1a47cd35866f2001d51d3f66828b
2020-02-19 11:36:24 -08:00
Dieter Hsu
3ef9003e18 Merge "Refresh new extra data AccessibilityNodeInfo.ExtraRenderingInfo" 2020-02-19 17:05:34 +00:00
Shu Chen
d931a4763f Supports dynamic height for the new magnifier.
And also limits the pre-magnified line height:
 - If the text line height is too big, don't show the magnifier.
 - If the text line height is too small, enlarges the zoom factor so
   that the magnified text can be seen clearly.

Bug: 77791703, 148181186
Test: locally verified.
Change-Id: I4cf56e0a54fda6b23dafe153040fe5ba206f5f1f
2020-02-19 09:17:01 +08:00
Nikita Dubrovsky
ac919b0e83 Use DeviceConfig flags for cursor drag and insertion handle gestures
Bug: 149751656
Test: Manually and ran automated tests
  atest FrameworksCoreTests:TextViewActivityTest
  atest FrameworksCoreTests:EditorCursorDragTest
Change-Id: I431dd7c13b573d7acd9ce20e16a6476370202b5f
2020-02-18 14:58:52 -08:00
TreeHugger Robot
1031e06adf Merge "Remove more deferTransactionUntilSurface calls" 2020-02-18 21:09:50 +00:00
Robert Carr
f2f84f5f27 Remove more deferTransactionUntilSurface calls
These won't work with the BLAST adapter since the Surface isn't
known to the server side. We just convert them in to the other
variant of defer transaction calls.

Bug: 146598493
Bug: 149251083
Test: Existing tests pass
Change-Id: I34fc4bb90114bae8b0d9ffdee5c91a2371e5c240
2020-02-18 11:08:52 -08:00
Dieter Hsu
f1273c4fca Refresh new extra data AccessibilityNodeInfo.ExtraRenderingInfo
Bug: 136404500
Test: atest AccessibilityTextActionTest AccessibilityNodeInfoTest
Change-Id: Ib1a8556d662d31ffbf3366e1482588ba058530cd
2020-02-18 12:18:52 +08:00
Yuichiro Hanada
ed54866ba6 Fix TextView.shouldAdvanceFocusOnTab().
EditorInfo.TYPE_TEXT_FLAG_{IME_,}MULTI_LINE are outside of
EditorInfo.TYPE_MASK_VARIATION.
It causes shouldAdvanceFocusOnTab return true always.

Bug: 37066224
Test: manual - Tab key on multiline text input inserts a tab character.
Test: atest TextViewTest#testKeyNavigation
Change-Id: I913cda40206d1c39e6844ff1be38e069488df4f4
2020-02-14 16:00:13 +09:00
Shu Chen
523d33f1e1 Fixes the opacity value for the insertion handle to range {0..255}.
Bug: 149523168
Test: locally verified.
Change-Id: I53c4be59e128a6451a9d8c847ee9d5fd295659ab
2020-02-14 01:17:10 +00:00
Shu Chen
5ec64751ac FISHEYE_RAMP_WIDTH should be in DP instead of pixels.
Test: locally verified.
Change-Id: I3938761b51d4ebb84b6bfb67aef72bc85911f163
2020-02-12 10:12:13 +08:00
Shu Chen
7948993c49 Merge "Limits the left/right bounds of the magnified text content within the textview." 2020-02-12 01:21:27 +00:00
Shu Chen
3cdd8e53b4 Merge "Don't show magnifier with animation for the new fisheye magnifier." 2020-02-12 01:09:17 +00:00
Shu Chen
2596513c60 Merge "Use the line height to adjust the Y coordinate for touch through." 2020-02-12 01:08:59 +00:00
Shu Chen
51520d1fd1 Limits the left/right bounds of the magnified text content within the
textview.

Test: locally verified.
Bug: 148988709
Change-Id: I255de87a602ad39fd05c9b87f44e1c1ba5b3e244
2020-02-11 20:36:40 +08:00
Shu Chen
af86a485b3 Use the line height to adjust the Y coordinate for touch through.
Originally it uses the text height from the font metrics which is wrong
when the spanned text is smaller than the font metrics.

Test: locally verified.
Bug: 149287208
Change-Id: I91a87200e477faece543a8890aeccd5b7eed9f0b
2020-02-11 19:53:56 +08:00
Bernardo Rufino
663a13b134 Merge "Return null for getWindowParams() on system-rendered toasts" 2020-02-11 11:10:10 +00:00
Bernardo Rufino
f5b271fb4c Merge "Mark getView() with @Nullable" 2020-02-08 00:28:37 +00:00
TreeHugger Robot
aab0c36259 Merge "Providing new accessibilityNode action" 2020-02-07 17:31:57 +00:00
Bernardo Rufino
7f01ff915b Return null for getWindowParams() on system-rendered toasts
Bug: 144754526
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
Change-Id: I768424ab157d64cfc922cd307ffcc688a6ab6de3
2020-02-07 11:23:58 +00:00
Bernardo Rufino
b609468572 Mark getView() with @Nullable
Since they can return null.

Test: Builds
Bug: 144754526
Change-Id: I46a517584d5862fc09764a9f03ac5e2603e98957
2020-02-07 10:19:53 +00:00
Shu Chen
59bccf2a70 Don't show magnifier with animation for the new fisheye magnifier.
The new fisheye magnifier is showed inline on the text.
It doens't make sense to have an animation when switching lines
vertically.

Test: locally verfiied.
Bug: 149058653
Change-Id: I36b6894f6954a8adf5a3097ebb7a5c5def292d07
2020-02-07 11:17:29 +08:00
Jacky Kao
a3419bab91 Providing new accessibilityNode action
Removed this constant variable, TextView.ACCESSIBILITY_ACTION_IME_ENTER,
and added more description for new accessibility action,
ACTION_IME_ENTER.

Bug: 139380257
Test: a11y CTS tests & unit tests
Change-Id: I929262aa0046640aafe36a2dc2a8896ee7cab9ff
2020-02-07 07:30:57 +08:00
Bernardo Rufino
e481352792 Add Toast logs and update docs
Some methods should not be called on text toasts rendered by the system
UI, adding logging and updating docs. Check go/toast-block-design for
details.

Bug: 128611929
Bug: 144754526
Test: Builds
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
Change-Id: I282288afd0be604b2fdaa1348f09fc59e8f33d98
2020-02-06 17:19:23 +00:00
Bernardo Rufino
2f167d3823 Don't block app-rendered text toast on apps with targetSdk < 30
We've decided to gate the text toast move on targetSdk due to an app
crash (b/148438364) but decided not to gate the background custom toast
block (in NMS) on targetSdk temporarily to gather dogfood and DP
feedback. This meant that app-rendered text toasts (which are only
possible for apps with targetSdk < 30) were being blocked in NMS since
they were being considered custom toasts.

This brings back the boolean inside Toast class that differentiates
between custom and text toasts for apps with targetSdk < 30, since both
are app-rendered in this case. This code won't be present on final
version and is temporary to gather feedback on dogfood and DP, since
almost no app currently targets SDK 30+. We'll gate both changes (the
system UI move and the bg custom toast block) on targetSdk later on.

Bug: 148761979
Bug: 148794147
Bug: 144754526
Test: Verify that, while on the background:
      App with       | Custom toast | Text toast
      targetSdk < 30 |      Blocked |    Allowed
      targetSdk 30+  |      Blocked |    Allowed
Test: atest android.widget.cts.ToastTest android.widget.cts29.ToastTest
            LegacyToastTest

Change-Id: Id529028bc463034cd2f64a6f2f97e71bc6ea7c36
2020-02-06 10:11:34 +00:00
TreeHugger Robot
9ade0418a6 Merge "Add @Deprecated tag to Toast.getView()" 2020-02-06 05:08:53 +00:00
Shu Chen
b2ebfecce5 Merge "Use the line height for the magnifier source height." 2020-02-06 04:55:09 +00:00
Yinglei Wang
04c84989d3 Merge "Fix TYPE_VIEW_SCROLLED event in AsListView and ListView" 2020-02-05 21:11:56 +00:00
Bernardo Rufino
54ec64b8f9 Add @Deprecated tag to Toast.getView()
For some reason I had added @deprecated inside javadocs but forgot to
add @Deprecated to the method on ag/10117117. Repo-hooks only
warned me now that touched that method for something unrelated.
Curiously even api/current.txt in that CL has the method marked as
@Deprecated.

Bug: 128611929
Bug: 144754526
Test: Builds
Change-Id: I8e4a58ae5ba2204aaced6d7a83746b17573a8c97
2020-02-05 20:30:01 +00:00
Svetoslav Ganov
3e2213e035 Merge "Providing new accessibilityNode action" 2020-02-05 03:45:32 +00:00
Shu Chen
09ce0f1a23 Use the line height for the magnifier source height.
And excludes the line spacing when calculating the manifier Y
coordinate.

Test: m -j & manually tested.
Bug: 148737626
Change-Id: Ib592187da4f39e9e30bd3c0e6958e56901910728
2020-02-05 08:06:45 +08:00
yingleiw
9407e393f9 Fix TYPE_VIEW_SCROLLED event in AsListView and ListView
We should always send TYPE_VIEW_SCROLLED event when scroll. This applies
to ACTION_SHOW_ON_SCREEN. And we also need the scroll event when the
first visible item and last visibile item don't change.

Fix: 147907655, 147282475

Test: tested b/147282475 is fixed (this bug is not related to
ACTION_SHOW_ON_SCREEN, it is the scroll forward action).

Change-Id: I2069dc3ee692042ff87867db9837e85ac1d8dd26
2020-02-04 13:33:49 -08:00
Shu Chen
130a79646f Supports flexible config for mimic fisheye via drawBitmapMesh.
Original logic applies a 4x6 mesh for the fisheye effect.
Due to the mesh width is an integer, the ramp width cannot be adjusted,
instead, it is calculated based on the zoom and mesh width.
e.g. zoom = 1.5, mesh width = 4, the ramp width must be 0.125x of width.
That causes the inflexibility of adjusting the ramp width for potential
UX experiments.

This cl breaks the original pixel copied bitmap into 3 parts.
 - For the middle part, it just be drew scaled to the middle of magnifier.
 - For the left/right parts, it applies a 1x6 mesh to mimic the fisheye.
Because the mesh only applies the left/right parts, the ramp width can
be configured separately.

Test: m -j & manually tested.
Bug: 148763951
Change-Id: I7afe7e4b8d006b2b3a46513eadfea9fa8bf0515f
2020-02-03 17:05:02 +08:00
Bernardo Rufino
944121a8d3 Gate CHANGE_TEXT_TOASTS_IN_THE_SYSTEM on targetSdk 30+
Bug: 148438364
Bug: 144152069
Bug: 144754526
Bug: 128611929
Test: atest android.widget.cts29.ToastTest
Test: Verify com.commsource.beautyplus doesn't crash when sharing photo
      (details on b/148438364)

Change-Id: Iea3ffd69c3fd217b993d89020b7ec6c3c32cea15
2020-01-29 22:24:45 +00:00
TreeHugger Robot
e428a2cc04 Merge "Deprecate Canvas.EdgeType" 2020-01-28 18:13:01 +00:00
Bernardo Rufino
ab338ac42c Move text toast creation to system UI
In order to do that, NotificationManager now calls
StatusBar.showToast(), which is in SystemUI. StatusBar then calls a new
component, ToastUI, which is responsible for rendering the toast. The
code for rendering the toast was extracted from the Toast class, so it
should behave identically.

Also refactored the code a bit on NotificationManagerService, creating
two children of ToastRecord (one for custom, other for text toasts).

The change is gated in Toast class in this CL, but it's also gated on
the system server, so apps can't circumvent the background block.

Bug: 128611929
Bug: 144754526
Test: atest android.widget.cts.ToastTest
Merged-In: Id0021cdc6f72f41b55ff1c5a4f09ae7687586460
Change-Id: Id0021cdc6f72f41b55ff1c5a4f09ae7687586460
2020-01-27 11:13:27 +00:00
TreeHugger Robot
8fe9f64271 Merge "Fix the wrong calculation for the line bounds when showing the new magnifier." 2020-01-24 01:30:37 +00:00
Leon Scroggins III
2410b90e06 Deprecate Canvas.EdgeType
Bug: 129694386
Test: No change in behavior, no new tests

EdgeType is only used as a parameter to quickReject, but it is always
ignored. Deprecate it and the existing quickReject methods. Add new
versions of quickReject without EdgeType parameters. Switch clients to
the new versions.

Change-Id: Id932f10915a8c4959fe0e85f507ce7fd2da8a576
2020-01-23 20:43:34 +00:00
Tiger Huang
527244459c Window Manager Flag Migration (12/n)
- Unhide new APIs
- MaxInsets -> InsetsIgnoringVisibility
- Deprecate SystemUI flags
- Deprecate some other stuff

Bug: 118118435
Test: Build, CTS coming soon
Change-Id: I0a0cbdb48258b3779d536668b59e8c88f3c96d18
Exempt-From-Owner-Approval: Trivial rename
2020-01-23 14:11:39 +01:00
TreeHugger Robot
62a96a11f8 Merge "Add surrounding text to EditorInfo to speed up IME startup" 2020-01-23 06:45:34 +00:00
Shu Chen
5b14fb5ea3 Fix the wrong calculation for the line bounds when showing the new
magnifier.

Test: manually verified.
Bug: 148187517
Change-Id: I956aa78d7a10152300c5eb28be87f145a525093a
2020-01-23 13:15:18 +08:00
Yinglei Wang
51683fa8fa Merge "Set stateDescription during ProgressBar initialization" 2020-01-23 03:12:13 +00:00
Chris.CC Lee
c486acc4d2 Add surrounding text to EditorInfo to speed up IME startup
Previously when IMEs want to get initial input text for advanced
prediction featues, it will take up to three IPC calls. Once we provide
the initial text in the EditorInfo object, it would be available right
after the input connection setup and no IPC overheads will be
introduced.

Bug: 122691437
Test: atest FrameworksCoreTests:TextViewTest
Test: atest FrameworksCoreTests:EditorInfoTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsInputMethodTestCases:EditorInfoTest
Change-Id: Ie04f2349b1157408aa8ed9044aea12ce99132cb4
2020-01-23 02:28:52 +00:00
yingleiw
20852a15ef Set stateDescription during ProgressBar initialization
onProgressRefresh() is only called when the progress changes. So we should set
stateDescription during initialization.

Test: tested with talkback test app. Without this change, the
stateDescription is not available when we focus on the seekbar. After
the change, the stateDescription is avaiable.

Change-Id: I56071ed28e6917c6bd14162884b10440c6955751
2020-01-22 15:27:57 -08:00