Commit Graph

7323 Commits

Author SHA1 Message Date
TreeHugger Robot
b0a22a168c Merge "Enable Smart Select Animation by default" 2017-08-14 21:44:44 +00:00
Chet Haase
f5a87f7058 Merge "Document existing immutable behavior of ArrayAdapter" 2017-08-14 20:16:48 +00:00
Petar Šegina
e2f826387e Enable Smart Select Animation by default
Test: manual - build and verify the Smart Select Animation works in the
single-line case

Change-Id: Ic6e657c6ee06852644b02f14b9547a2b8bcf9860
2017-08-14 18:55:43 +01:00
Petar Šegina
855396d37a Don't run Smart Select Animation on multiple lines
This behavior is currently broken due to the format of the rectangles
returned by Layout::getSelection. Let's disable the animation in
multiline scenarios until this behavior is fixed.

Test: manual - enable Smart Select flag and test over single and
multiple lines
Change-Id: Id0c49a0d69a8f2bdb449cfc8f0ed43e529f41cc1
2017-08-14 18:55:12 +01:00
Petar Šegina
701ba333f6 Add animation for Semantic Lift
Test: manual - trigger smart select in a TextView
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I2b147a9cc4cbb79118bb78d948bac76a63cf4253
2017-08-11 12:19:53 +01:00
Abodunrinwa Toki
d762f32201 Merge "Fix failing Framework TextView tests." 2017-08-10 15:31:54 +00:00
Chet Haase
b7c6a5d7e9 Document existing immutable behavior of ArrayAdapter
Various methods on ArrayAdapter throw exceptions if run on an adapter
created with one of the varargs constructors. This is because those contructors
create an Arrays.ArrayList, which does not allow modification. It is not
worth changing the existing behavior, but it is worth making the behavior
clearer in the docs.

Bug: 63802412  ArrayAdapter crashes when calling clear() directly after constructor
Test: docs-only fix. Verified with unit test that the docs apply correctly to the
newly-documented methods. Built the docs target successfully.

Change-Id: I75ae233879cc7db10853f93d78625a00675594b2
2017-08-09 20:03:56 +00:00
Abodunrinwa Toki
4a056a5895 Fix failing Framework TextView tests.
. Fix TextViewActivityTest.testToolbarAndInsertionHandle
 . Suppress TextViewActivityMouseTest

Bug: 29591177
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityMouseTest
Change-Id: I51edcf4d7e4f179a8b02316cc1cb6314b209baad
2017-08-09 15:34:13 +01:00
TreeHugger Robot
0591b8ccc5 Merge "Fix monkey bug when focus change before layout" 2017-08-07 15:02:53 +00:00
Jeff Sharkey
1fb3a312e7 Merge "Fix broken javadocs." into oc-mr1-dev am: b79eb54d36
am: 1ad38fe278

Change-Id: I21266d20be036196dbeddb9c4366d641ab1b68a8
2017-08-06 17:00:09 +00:00
Jeff Sharkey
67f9d5070a Fix broken javadocs.
Bug: 64337634
Test: make -j32 doc-comment-check-docs
Change-Id: I20fdd3dcddef09111d35946c41c596c7689effa6
2017-08-06 07:37:08 -06:00
TreeHugger Robot
b186823314 Merge "Improve TextView.onMeasure() for multiline text." 2017-08-04 19:24:01 +00:00
Seigo Nonaka
917748ef50 Improve TextView.onMeasure() for multiline text.
Previously, measures all paragraph for deciding view width.
However, in case AT_MOST measurment, we can stop calculating measure if
the measured paragraph already exceeds the upper limit.

Bug: 64389125
Test: bit CtsWidgetTestCases:*
Test: CorePerfTest. Here is a result before and after this patch.

Before:
INSTRUMENTATION_STATUS: measure_AtMost_median=50332114
INSTRUMENTATION_STATUS: measure_Exactly_median=28276317
INSTRUMENTATION_STATUS: measure_Unspecified_median=50193036

After:
INSTRUMENTATION_STATUS: measure_AtMost_median=28475187
INSTRUMENTATION_STATUS: measure_Exactly_median=26944710
INSTRUMENTATION_STATUS: measure_Unspecified_median=50880088

Change-Id: I2a39eb39817a8f845c4fa2e174a905a2d057096e
2017-08-04 17:21:06 +00:00
George Mount
45362a6b72 Fix monkey bug when focus change before layout
Bug 64359848

Monkey found a divide-by-zero error caused by the width not set
when focus was changed before layout. This CL just ensures that
there is no divide by zero by selecting the first row/column.

Test: manually launched Date Picker and it didn't crash
Change-Id: Id6dd12cd20b052af71ab980c8a694020ea679e7c
2017-08-04 10:17:36 -07:00
Andrei Stingaceanu
b969b3eb98 Merge "AutoSize TextView - fix transformation method" into oc-mr1-dev am: 8719c2a8e6
am: 45d18e2834

Change-Id: Ie161f8b1065791c1523f981a955561d810417097
2017-08-04 13:32:21 +00:00
Andrei Stingaceanu
8719c2a8e6 Merge "AutoSize TextView - fix transformation method" into oc-mr1-dev 2017-08-04 13:08:40 +00:00
TreeHugger Robot
680a74c056 Merge "Refactor TextView TextAppearance attributes reading" 2017-08-04 07:58:00 +00:00
Siyamed Sinir
8b7053dd45 Merge "Fix EditText cursor when line spacing is set" 2017-08-01 22:37:55 +00:00
Clara Bayarri
d2781160f1 Refactor TextView TextAppearance attributes reading
Attributes that can appear in a TextAppearance are read in 3
different places inside TextView:
- Within the TextAppearance in the constructor
- Within the Style in the constructor
- Within setTextAppearance

This change simplifies the attribute reading code so it only
happens in one place. Note the way TextView reads these attributes
is first populating them from the TextAppearance and then allowing
them to be overriden by the style. The same is accomplished here.

For testing purposes and for API consistency, this change also adds
the missing APIs
- isAllCaps
- isElegantTextHeight

Bug: 64053645
Test: bit CtsWidgetTestCases:.TextViewTest
Change-Id: Iad6c1c6515992a51020c656edabea4e2927572f3
2017-08-01 17:12:01 +01:00
Sergey Vasilinets
ee73c957a5 Merge "Revert "Revert "Update overscroll and toast UI""" into oc-dr1-dev am: 2cf8f91637 am: 3c9c422d33
am: 98e73b856a

Change-Id: I633ca5e543781eb86f25fe82c9bae91e7af7979e
2017-07-28 23:08:13 +00:00
Sergey Vasilinets
3c9c422d33 Merge "Revert "Revert "Update overscroll and toast UI""" into oc-dr1-dev
am: 2cf8f91637

Change-Id: Ia0f4dc6193776e0b37eb7e2d2048918510cae535
2017-07-28 22:02:14 +00:00
Sergey Vasilinets
2cf8f91637 Merge "Revert "Revert "Update overscroll and toast UI""" into oc-dr1-dev 2017-07-28 21:46:43 +00:00
TreeHugger Robot
4ecf2de06b Merge "Remove secondary bidi cursor" 2017-07-27 23:58:07 +00:00
Sergey Vasilinets
ebfaca5246 Revert "Revert "Update overscroll and toast UI""
This reverts commit 45c493f2c2.

Change-Id: Idefc8e1b6f954def7ef4cdf08b687042a6091a0d
2017-07-27 23:29:34 +00:00
Roozbeh Pournader
9c13307c38 Remove secondary bidi cursor
The double bidi cursor is not user friendly. Almost no native speaker
of bidi languages likes the double cursor.

Now we always show one cursor.

Change-Id: I249befaf70630bef435c8db9039e8aacf233bf7c
Fixes: 63542996
Test: Manual (no more double cursors, bidi editing feels OK)
Test: bit CtsTextTestCases:*
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.text.
Test: bit FrameworksCoreTests:android.widget.EditorCursorTest
Test: bit FrameworksCoreTests:android.widget.TextViewTest
2017-07-27 11:58:42 -07:00
Andrei Stingaceanu
6e82029a0f AutoSize TextView - fix transformation method
AutoSize now takes the text transformation method into
account when measuring the view.

Bug: 63889588
Test: cts-tradefed run cts-dev -m CtsWidgetTestCases -t
android.widget.cts.TextViewTest#testAutoSizeCallers_setTransformationMethod

Change-Id: I52f4bf6ea2f45342efa04b742a9debdac69f9c4c
2017-07-27 10:03:33 +00:00
Felipe Leme
83a8429dd7 Merge "Move cursor to end of text when autofilling." into oc-mr1-dev am: de499f469f
am: 453f2a60fa

Change-Id: If94c356c3a814c800285057bff95dac0ebe3e13b
2017-07-27 05:10:51 +00:00
Aurimas Liutikas
ba9dddc08c Merge "Revert "Update overscroll and toast UI"" into oc-dr1-dev am: 0aadeed536 am: 4d5a1ff81c
am: 3a95583d2a

Change-Id: I49fccc9953bc26febafe2b57cec5bc13c56f0c23
2017-07-27 00:02:59 +00:00
Aurimas Liutikas
3a95583d2a Merge "Revert "Update overscroll and toast UI"" into oc-dr1-dev am: 0aadeed536
am: 4d5a1ff81c

Change-Id: Id0158fe95811436fccda10bf270a2e8d550dcdec
2017-07-26 23:00:57 +00:00
Aurimas Liutikas
0aadeed536 Merge "Revert "Update overscroll and toast UI"" into oc-dr1-dev 2017-07-26 22:36:59 +00:00
Aurimas Liutikas
45c493f2c2 Revert "Update overscroll and toast UI"
This change broke android.uirendering.cts.testclasses.EdgeEffectTests.

This reverts commit 6085f8a16b.

Bug: 64085792

Change-Id: I70ccebebb54dabf1ec0ee5002adca93e44104a1e
2017-07-26 22:24:21 +00:00
Siyamed Sinir
a60b59d1cc Fix EditText cursor when line spacing is set
Test: bit FrameworksCoreTests:android.widget.TextViewTest
Test: bit FrameworksCoreTests:android.widget.EditorCursorTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest

Bug: 30870806
Change-Id: I54f014b06af328c3e9a9c4ddb5a3348a26e290c2
2017-07-26 11:12:53 -07:00
Chet Haase
fd7cfd1a5a Merge "Update overscroll and toast UI" into oc-dr1-dev am: 1c31f9653f am: 36fa7f4eec
am: 832407ab96

Change-Id: I28bab5cb9f3f45a8583f86db75b9f266d074ee62
2017-07-26 06:08:06 +00:00
Chet Haase
36fa7f4eec Merge "Update overscroll and toast UI" into oc-dr1-dev
am: 1c31f9653f

Change-Id: Ib76daf28d94791f0c525aa1dcc57939ac60050c9
2017-07-26 05:47:47 +00:00
Chet Haase
1c31f9653f Merge "Update overscroll and toast UI" into oc-dr1-dev 2017-07-26 05:40:41 +00:00
Chet Haase
6085f8a16b Update overscroll and toast UI
Overscroll updates:
Same shape, but smaller radius (doesn't come as far into the view)
and more translucent (max 15% instead of 50%). Overall, more subtle.

Toast updates:
Light background, smaller, dark font, closer to the bottom of the
container.

Test: manual unit tests. Also:
cts test ToastTest for toast changes
cts test EdgeEffectTests for EdgeEffect changes (adding some tests to
known-failures for now, due to brittle golden-image failures - see
CL ag/2596621)
Bug: 30563264  Refresh toast visuals for Android ODR
Bug: 63010438  Tweaks to overscroll animation
Change-Id: I0fac6322b0b81d030c8d174852c134211290bbea
2017-07-26 05:40:02 +00:00
Felipe Leme
2e58b1672e Move cursor to end of text when autofilling.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testAutofillMovesCursorToTheEnd
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 62669787

Change-Id: I70a583c71057804334e86ed3f7dd2aca8da20922
2017-07-25 10:37:02 -07:00
Andrei Stingaceanu
1244815e8f Remove @hide from ViewGroup debug methods
Allow developers to easily add their own debugging info
when developing custom ViewGroups.

Bug: 30117235
Test: tests still pass
Change-Id: Ia83005b4dc727c7b959a50e7b0130582f6e89762
2017-07-25 10:00:21 +00:00
TreeHugger Robot
1e2df08ade Merge "Define constants for ellipsize values" 2017-07-24 21:24:38 +00:00
Roozbeh Pournader
3f9cfa77d8 Define constants for ellipsize values
Also remove an already-done TODO item.

Test: bit CtsTextTestCases:*
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest
Test: bit CtsWidgetTestCases:android.widget.cts.CheckedTextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.AutoCompleteTextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.MultiAutoCompleteTextViewTest
Test: adb shell am instrument -w -e package android.text com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I0c91ac3ad4ab5794c1e36f1f5e576d52acad66b2
2017-07-24 10:05:59 -07:00
Siyamed Sinir
967805ca47 Merge "Handle long text for share/cut/copy operations." 2017-07-21 18:07:07 +00:00
Siyamed Sinir
ce3b05abc0 Handle long text for share/cut/copy operations.
When TextView or EditText contains text that is larger than the
total parcelable limit, some of the FloatingToolbar operations would
crash.

This CL changes the behavior as follows:
- Show a toast message if cut or copy operation fails because it cannot
  set the primary clip.
- Trim the text for share and process_text actions
- A simple app with an EditText and a long text in it, would not open
since Autofill value was being sent over IPC. Trimmed the text that is
sent for Autofill feature.
- Trim the value send to accessibility services

Test: bit CtsWidgetTestCases:.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewTest
Test: bit FrameworksCoreTests:android.text.TextUtilsTest
Test: Manual sample app test

Bug: 8013261
Change-Id: Ia0df6b4eb4c13071a1bf75cedac7241c7239663c
2017-07-20 15:01:18 -07:00
Siyamed Sinir
5b522e204c Merge "Update TextView ApiDoc for lineSpacing attributes" 2017-07-20 15:26:51 +00:00
Siyamed Sinir
7f9b0909f9 Update TextView ApiDoc for lineSpacing attributes
lineSpacing attributes are not applied for last lines of a text. Update
ApiDocs accordingly.

Test: none
Bug: 30508784
Change-Id: I83593d0b57f717deb90ac8d589673b61358bc914
2017-07-19 18:20:07 -07:00
Selim Cinek
8ffa981686 Merge "Reducing bitmap sizes in notifications" into oc-dr1-dev 2017-07-19 23:41:44 +00:00
Selim Cinek
15733d1f85 Reducing bitmap sizes in notifications
Bitmap sizes could be arbitrary large when they were sent
over to the system. We're now reducing them to reasonable
sizes.s

Also fixed that notification bitmaps were not put into
ashmem anymore since it got lost in a refactor.

Test: code inspection
Bug: 62319200
Merged-In: I87db7656e749666b9eab1f67fd497f155c407e18
Change-Id: I87db7656e749666b9eab1f67fd497f155c407e18
2017-07-19 18:06:09 +00:00
Selim Cinek
d0426628f6 Reducing bitmap sizes in notifications
Bitmap sizes could be arbitrary large when they were sent
over to the system. We're now reducing them to reasonable
sizes.s

Also fixed that notification bitmaps were not put into
ashmem anymore since it got lost in a refactor.

Test: code inspection
Bug: 62319200
Change-Id: I87db7656e749666b9eab1f67fd497f155c407e18
2017-07-19 11:05:26 -07:00
TreeHugger Robot
e38db1b9be Merge "Fix calculation of RelativeLayout width in RTL mode" 2017-07-14 21:10:57 +00:00
TreeHugger Robot
41db50cd25 Merge "Disable smart sharing for password fields." 2017-07-14 20:21:59 +00:00
Abodunrinwa Toki
76b51dc450 Disable smart sharing for password fields.
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Bug: 62340817
Change-Id: Ifbf2c39d9f304251adc8c4acdf1b4fd6914011d8
2017-07-14 18:31:04 +01:00