Commit Graph

7389 Commits

Author SHA1 Message Date
Alan Viverette
dda510800a Merge "Handle null left and right tab strip drawables" into oc-mr1-dev am: 286c7db342
am: 7dbf5b032b

Change-Id: I5c3f616276f1f68a134c48f886cc43d282400415
2017-09-21 01:46:55 +00:00
TreeHugger Robot
286c7db342 Merge "Handle null left and right tab strip drawables" into oc-mr1-dev 2017-09-20 13:59:05 +00:00
TreeHugger Robot
d4f7c5bc19 Merge "ActivityOptions.set/getLaunchStackId() be gone!" 2017-09-20 00:09:09 +00:00
Wale Ogunwale
0568aed2af ActivityOptions.set/getLaunchStackId() be gone!
Removed ActivityOptions.set/getLaunchStackId() and replacement
ActivityOptions.set/getWindowingMode() and set/getActivityType()

Test: Existing tests pass.
Test: go/wm-smoke
Bug: 64146578
Change-Id: Ifc1c35f7b13c335cdf1a1694208e9fe0aea0c1fa
2017-09-19 10:36:52 -07:00
Clara Bayarri
a26be3c97c Fix crash in TextView#setHint
Bug: 65821360
Test: bit CtsWidgetTestCases:TimePickerTest
Change-Id: I1ee279691d73f173064d98f6e7d5d5fbd483f682
2017-09-18 15:05:02 +01:00
Alan Viverette
00e9401e00 Handle null left and right tab strip drawables
Change-Id: I7a44fadc33a05c884e81d9bbb12e868937ab95f3
Fixes: 65726084
Test: bit CtsWidgetTestCases:.TabWidgetTest\#testStripDrawables
2017-09-15 16:59:15 -04:00
Jan Althaus
019389a638 New metrics fields for selection logs
Changes that affect logging:
- Switched to new category/actions/fields that are used exclusively by
  selection logging.
- Action types are now logged in the tron type (the information that was
  previously in the field could be derived from other fields).
- Entity types are now logged in the tron sub type.
- Delta time from previous event is now zero for first event (was time
  since epoch).
- The smart select model version is now written for all events after
  smart select has run. (i.e. better support for analysis based on
  terminal events alone)
- Restoring the logging removed in ag/2901629.

Internal only changes:
- Made debug statement conditional on DEBUG_LOG_ENABLED.
- Reduced logging tag length to fit into 23char limit.

Bug: 64914512
Test: Manually tested that logs are correct. Will follow up with automated tests.
Merged-In: If12daa2f206fb42be53587decbe2c4abfd689f41
Change-Id: Iec0f6cf1f9f2efdc8518133cf8551cd96b095ad8
2017-09-15 18:17:57 +02:00
TreeHugger Robot
a2dfc3cc68 Merge "New metrics fields for selection logs" 2017-09-15 15:54:59 +00:00
Clara Bayarri
e128408553 Merge "Fix hint text updates in Extracted text mode" 2017-09-15 15:21:06 +00:00
Clara Bayarri
d8c5e7fc41 Fix hint text updates in Extracted text mode
Updates to the hint on a TextView were not notified to the
ExtractEditText, so there was no way it could know to update.
This change pipes through the hint value when the extracted
mode becomes visible and informs it of changes.

The Editor#reportExtractedText method has been refactored to
be more readable. Note that checks on whether the content
changed are done in the two places in the code that already
called this method, and we explicitely don't want to check
contents when there is a hint change.

Bug: 63980155
Bug: 65691495
Test: bit CtsWidgetTestCases:.TextViewTest
Change-Id: I357dd5c74b61d149cf8612d1f52c7118ec70c696
2017-09-15 12:19:29 +01:00
Alan Viverette
f91ebf5433 Merge "Use correct date pattern for displaying year in DatePicker" into oc-mr1-dev am: c668bc0d92
am: 5b8476637d

Change-Id: I5b1063b5b787f814ef78d55f6f5868dfb21c4f9d
2017-09-15 11:19:07 +00:00
Jan Althaus
786a39dfa5 New metrics fields for selection logs
Changes that affect logging:
- Switched to new category/actions/fields that are used exclusively by
  selection logging.
- Action types are now logged in the tron type (the information that was
  previously in the field could be derived from other fields).
- Entity types are now logged in the tron sub type.
- Delta time from previous event is now zero for first event (was time
  since epoch).
- The smart select model version is now written for all events after
  smart select has run. (i.e. better support for analysis based on
  terminal events alone)
- Restoring the logging removed in ag/2901629.

Internal only changes:
- Made debug statement conditional on DEBUG_LOG_ENABLED.
- Reduced logging tag length to fit into 23char limit.

Bug: 64914512
Test: Manually tested that logs are correct. Will follow up with automated tests.
Change-Id: If12daa2f206fb42be53587decbe2c4abfd689f41
2017-09-15 10:41:16 +02:00
Siyamed Sinir
390a4d6cd5 Merge "Fix maxLines/lines properties for BoringLayout" into oc-mr1-dev am: ae90cfccee
am: 273dcbf053

Change-Id: Ic03051c0a9d491337d9606e082ad83ecb61bd1c7
2017-09-15 05:32:10 +00:00
TreeHugger Robot
c668bc0d92 Merge "Use correct date pattern for displaying year in DatePicker" into oc-mr1-dev 2017-09-14 21:49:43 +00:00
Siyamed Sinir
dcb33f1618 Fix maxLines/lines properties for BoringLayout
Line height calculation with maxLines set to zero displayed a single
line when BoringLayout was used. This CL fixes it to show zero lines.

Test: Added related CTS tests to TextViewTest and EditTextText
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest

Bug: 65435738
Change-Id: Ic21eb50b31666b2dcc2398278010fa072ea1ff67
2017-09-13 09:05:53 +00:00
Abodunrinwa Toki
89bda32771 Log the "change selected text" gesture.
This logs when the selected text is changed e.g. by typing on
the hard or soft keyboard.

Bug: 64914512
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Merged-In: I82b3b2157856c607d08a82c0a3d9fb938af4c06a
Change-Id: I82b3b2157856c607d08a82c0a3d9fb938af4c06a
2017-09-12 14:04:42 +01:00
Abodunrinwa Toki
78940eb859 Log the "change selected text" gesture.
This logs when the selected text is changed e.g. by typing on
the hard or soft keyboard.

Bug: 64914512
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I82b3b2157856c607d08a82c0a3d9fb938af4c06a
2017-09-12 13:53:04 +01:00
TreeHugger Robot
33e9e7d5e6 Merge "Fix smart selection logging bugs." 2017-09-12 11:00:04 +00:00
Petar Šegina
c975213ddb Merge "Enable smart select animation for multiline scenarios" 2017-09-12 10:24:35 +00:00
Petar Šegina
02b345725b Merge "Filter out empty and unnecessary rectangles" 2017-09-12 10:23:36 +00:00
Abodunrinwa Toki
cd2497b534 Fix smart selection logging bugs.
- Fix count with selection start index inside a word
- Properly handle whitespace characters
- Set the model version tag

Bug: 64914512
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: Manually tested that logs are correct. Will follow up with automated tests.
Merged-In: Ib73b52ebce999f2cb6e5734e556cd09e47c89a29
Change-Id: Ib73b52ebce999f2cb6e5734e556cd09e47c89a29
2017-09-12 00:20:40 +01:00
Evan Rosky
a0cff8b547 Merge "Fixed some small keyboard nav bugs (TabHost, directional focus)" into oc-mr1-dev am: c8b91ecbae
am: 2e7e7a9960

Change-Id: I4843d0b8409909d9b0c1af2950321918adc722bb
2017-09-11 21:24:01 +00:00
Evan Rosky
c8b91ecbae Merge "Fixed some small keyboard nav bugs (TabHost, directional focus)" into oc-mr1-dev 2017-09-11 20:25:50 +00:00
Sunny Goyal
f4b3cbc273 Merge "Adding a copy constructor for RemoteViews" 2017-09-11 19:40:58 +00:00
Andrei Stingaceanu
160d23ece3 Merge "TextView longpress 2 haptic feedback fix" into oc-mr1-dev am: 04b6095082
am: ddb8ced959

Change-Id: Id1ebf69c0f3c94f5c505c2bbe2f2dc52cb342fbf
2017-09-11 17:55:39 +00:00
Abodunrinwa Toki
d62a86e64c Fix smart selection logging bugs.
- Fix count with selection start index inside a word
- Properly handle whitespace characters
- Set the model version tag

Bug: 64914512
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: Manually tested that logs are correct. Will follow up with automated tests.
Change-Id: Ib73b52ebce999f2cb6e5734e556cd09e47c89a29
2017-09-11 18:23:44 +01:00
Petar Šegina
ba1b8566e4 Filter out empty and unnecessary rectangles
Layout::getSelection will sometimes give us rectangles which are
redundant - specifically, those with dimension zero and those that may
already be contained in some other rectangles. In order to keep the
smart select animation simple and in line with what the user would
visually expect, we remove these rectangles.

Test: manual - verify smart select animation over multiple lines
Test: bit FrameworksCoreTests:android.widget.SelectionActionModeHelperTest
Change-Id: Ia4406d9505366245609b44e3ec3743f84820ba0a
2017-09-11 15:41:12 +01:00
Petar Šegina
9b5b70cf20 Enable smart select animation for multiline scenarios
Test: manual - verify that smart select works when the selection spans
multiple lines

Change-Id: I7a8113559560dc4657c36c66c6059a44d03bf1ae
2017-09-11 15:38:22 +01:00
Andrei Stingaceanu
4303f22535 TextView longpress 2 haptic feedback fix
TextView#performLongClick() calls View#performLongClick which
calls View#performLongClickInternal() which, if handled, performs
the longpress haptic feedback and returns handled. TextView
looks at this return value and if it is true then makes another
call to perform longpress haptic feedback. Remove the duplicate
call in TextView as the one in the parent (View) is sufficient.

Bug: 65397911
Test: manual
Change-Id: Ic73a86637486d5382b63f1c1b37783e238452841
2017-09-08 11:18:56 +00:00
TreeHugger Robot
5b730ba2a0 Merge "Emit text direction with selection rectangle" 2017-09-07 13:02:22 +00:00
Sunny Goyal
56333a872a Adding a copy constructor for RemoteViews
Copying a remoteView will not longer mutate the original views

Simplifying bitmap cache and memory measurement for remoteViews. A
remoteView tree will have a common bitmapCache, and hence ite memory
estimate would be same as the total bytes allocated to all the bitmaps.

Bug: 62629395
Test: am instrument -w -e class android.widget.RemoteViewsTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I7ea6ce476f19f425431ed01ef22cc97764626230
2017-09-06 08:54:33 -07:00
Petar Šegina
b92c539232 Emit text direction with selection rectangle
In order to properly perform the smart select animation on right-to-left
and mixed text, we need the information about the direction of the text
that is present below the selection rectangle.

Test: manual - verify selection still works and that the generated
directions match the directions of the text on the screen
Test: bit FrameworksCoreTests:android.text.LayoutTest

Change-Id: I564ee2db59ab583c9bff807ad0d0dfeacaf1386f
2017-09-06 15:58:38 +01:00
Petar Šegina
5ab7bb242e Draw SmartSelectSprite in TextView
Instead of the SmartSelectSprite drawing its contents into a View's
ViewOverlay, the SmartSelectSprite can now be drawn on any Canvas. In
order to perform the smart select animation, it is now the TextView that
performs the actual drawing.

Since the TextView can adjust the canvas for its padding and offset,
there is no more need to manually transform the selection rectangles, so
that part can be removed.

Test: manual - verify smart select animation still works
Change-Id: Ibaccf59fd44d5701e6f37d6b4fa97f2b05fd77cc
2017-09-06 14:26:28 +01:00
Abodunrinwa Toki
7c5df649d7 Merge "Delete old TEXT_SELECTION_MENU_ITEM_ASSIST logs." into oc-mr1-dev am: f28b8a8de3
am: 48063322b4

Change-Id: I23f8204732f1f166aacf10d5d147bd3f21025c6b
2017-09-05 16:51:19 +00:00
Abodunrinwa Toki
fadd4288df Delete old TEXT_SELECTION_MENU_ITEM_ASSIST logs.
This field is now being used for new smart selection logging.
See: Icc9d5b542140bdb01b2ad4211048bd83eae2ce83

Bug: 64914512
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsAccessibilityServiceTestCases:android.accessibilityservice.cts.AccessibilityTextTraversalTest
Change-Id: If1ce8ca038b089500cd7adb9a146330abe909407
2017-09-05 14:19:52 +01:00
Abodunrinwa Toki
5ddd3ed855 TextView text selection interaction logging.
TODO: Log typing over selection

Bug: 64914512
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsAccessibilityServiceTestCases:android.accessibilityservice.cts.AccessibilityTextTraversalTest

Merged-In: Icc9d5b542140bdb01b2ad4211048bd83eae2ce83
Change-Id: Icc9d5b542140bdb01b2ad4211048bd83eae2ce83
2017-09-04 20:47:40 +01:00
Abodunrinwa Toki
57ec6ea1bb TextView text selection interaction logging.
TODO: Log typing over selection

Bug: 64914512
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit
CtsAccessibilityServiceTestCases:android.accessibilityservice.cts.AccessibilityTextTraversalTest

Change-Id: Icc9d5b542140bdb01b2ad4211048bd83eae2ce83
2017-09-04 20:40:07 +01:00
Petar Šegina
aee97ac902 Improve and simplify final polygon drawing
The final step of the smart select animation, drawing the outline of all
the rectangles, was not working properly in cases where the rectangles
would touch or intersect, which we cannot guarantee that they won't.

Instead of the previous implementation, we now rely on Path to create
the outline of the rectangles, making much of the code simpler.

Now the polygon generation should work in the general case, which is one
of the prerequisites in getting the smart select animation to work
properly in multiline scenarios.

Test: manual - test the smart select animation with various rectangle
sets
        (100, 100, 500, 500), (300, 300, 700, 700)
        (100, 100, 500, 500), (500, 100, 900, 500)
        (100, 100, 500, 500), (500, 300, 900, 700)
        (100, 100, 500, 500), (300, 300, 700, 500), (200, 500, 400, 700)

Change-Id: I51dd72e18c5efe36df734aa62ab47d57a5946399
2017-09-01 11:57:37 +01:00
TreeHugger Robot
95fc70bcec Merge "Changing RemoteViews to using MethodHandles instead of relection" 2017-08-31 20:11:00 +00:00
TreeHugger Robot
25706748aa Merge "Improve rectangle direction generation" 2017-08-31 18:05:23 +00:00
Sunny Goyal
271e32270b Changing RemoteViews to using MethodHandles instead of relection
Test: am instrument -w -e class android.widget.RemoteViewsTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I1c1eb58d863e1196a38fadb15e08ad2fdcff1d4d
2017-08-31 17:35:13 +00:00
Petar Šegina
7272925026 Improve rectangle direction generation
The previous solution didn't take into account that the source rectangle
might be at either end of the selection, thus giving it the wrong
direction of CENTER, while it should have been RIGHT or LEFT.

Test: manual - verify that the rectangles expand properly in a smart
select animation when there are multiple rectangles and the source is
not in the center - e.g. a multiline case with the selection starting on
the first line

Change-Id: Id18ab8f9918e74a576503620dae2f7cdd593fb0e
2017-08-31 17:17:00 +01:00
Petar Šegina
0d37b1a71d Rename roundPercentage to roundRatio
Test: manual - verify smart select animation still works
Change-Id: Ic63236a47563b2daef57eeb52dd4fdbbb2cb1780
2017-08-31 15:03:18 +01:00
TreeHugger Robot
119ce2e2b6 Merge "Replace manual insetting with .inset()" 2017-08-31 13:27:59 +00:00
Petar Šegina
2dff78610a Replace manual insetting with .inset()
Test: manual - verify smart selection animation still works
Change-Id: Iea13ec8962777863121f49f47a13425bb0cc7d42
2017-08-31 12:13:12 +01:00
Petar Šegina
bd54bcbcfb Merge "Do not round corners on tall selection rectangles" 2017-08-31 11:05:10 +00:00
Daichi Hirono
b890523f4b Check LayoutParam before clearing recycled state.
If header view / footer view is added to ListView before setting
adapter, the ListView regards the item count is zero even it has header
/ footer views.

Thus ListView invokes resetList(), and it invokes clearRecycledState() for
header / footer views. But in this method, there is no guarantee the
views has proper layout param.

The CL adds guard to check if the layout param is correct or not. If the
view does not have proepr layout param, it should do nothing because the
view has not been added to the ListView, and the LayoutParam will be
updated when ListView invokes obtainView for the view.

Bug: 65035699
Test: CTS ListViewTest
Change-Id: I4449d4bbcdba8e7cc10ec64d711f937a0f3375ca
2017-08-28 13:26:38 +09:00
Roozbeh Pournader
2be7eff3a4 Merge "Use fallback-based line spacing in TextView etc" 2017-08-24 19:24:06 +00:00
Roozbeh Pournader
612e67323f Merge "Add a builder for DynamicLayout and switch TextView to it" 2017-08-24 17:39:14 +00:00
Roozbeh Pournader
5caf5a690f Use fallback-based line spacing in TextView etc
In TextView and Switch, version-gate the use of
setUseLineSpacingFromFallbacks() to apps targeting Android P and
later for backward compatibility.

In internal widgets, ImageFloatingTextView and SubtitleView, always
turn it on, since there is no backward compatibility concerns.

Bug: 28963299
Test: bit CtsWidgetTestCases:android.widget.cts.CheckedTextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest
Test: bit CtsWidgetTestCases:android.widget.cts.SwitchTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewTest
Change-Id: Icfe4e71ba26bbc6755ba12ddab72e6bf20b3ce25
2017-08-23 17:41:06 -07:00