Commit Graph

5455 Commits

Author SHA1 Message Date
Clara Bayarri
a0b77dd5e2 Merge "Fix TextView ActionMode overflow finishes the ActionMode" into mnc-dev 2015-06-02 01:15:50 +00:00
Clara Bayarri
d63a177670 Merge "Make Text Selection Action Mode secondary items IF_ROOM" into mnc-dev 2015-06-02 01:15:03 +00:00
Jorim Jaggi
03a7c4c6d4 Fix shared drawable state
Not calling mutate here had a side-effect making the icon in the
status bar untintable in SysUI.

Bug: 21566007
Change-Id: Ifb78c81ba7f04d496f14031ef635a6e964e6280e
2015-06-01 23:59:00 +00:00
Alan Viverette
b0f94ae5d2 Merge "Always send VIEW_CLICKED event from AdapterView.performItemClick()" into mnc-dev 2015-06-01 23:52:36 +00:00
Alan Viverette
376c32f268 Always send VIEW_CLICKED event from AdapterView.performItemClick()
This makes it consistent with View.performClick().

Bug: 19574976
Change-Id: I00b222d56aa6fac03c2e6ead0604ee2ff3a6969d
2015-06-01 16:41:42 -07:00
Alan Viverette
e0e5c1cf19 Merge "Clean up AbsListView constructor" into mnc-dev 2015-06-01 21:56:36 +00:00
Alan Viverette
7eceda3020 Clean up AbsListView constructor
Change-Id: I5ebe0074849228e5c7fd629df6d1055c867debc8
2015-06-01 10:47:29 -07:00
Alan Viverette
7b2f86488c Don't ignore explicit dividerHeight of 0 specified in XML
Also minor cleanup and adding annotations.

Bug: 21420748
Change-Id: I89edcd3ce423ad75a4028bebf0dcd828b9619c15
2015-06-01 10:30:21 -07:00
Alan Viverette
db2911321b Merge "Replace PNG-based seekbar thumb animation with AVD" into mnc-dev 2015-05-29 22:51:04 +00:00
Alan Viverette
87e1938be8 Replace PNG-based seekbar thumb animation with AVD
Adds optical inset support for VectorDrawable and GradientDrawable.

Bug: 19944181
Change-Id: I9df04d9fe17ad858413e7f93694bf37ee2c43c85
2015-05-29 15:12:14 -07:00
James Cook
63b6320af4 Merge "assist: Fix reported colors/styles for TextView/Switch" into mnc-dev 2015-05-29 17:30:23 +00:00
Clara Bayarri
a447937dd3 Fix TextView ActionMode overflow finishes the ActionMode
stopSelectionActionMode() was called within hideCursors, and this
gets called in many scenarios. One of them is onWindowFocusChanged,
which is triggered when the user clicks the overflow icon in the
action bar. Removed the action mode call from this use case.

Bug: 21267270
Change-Id: I1cd359e87de67141627e25d2ec520fc91303a48d
2015-05-29 16:33:35 +01:00
Clara Bayarri
aee243b825 Make Text Selection Action Mode secondary items IF_ROOM
The fact that they were all ALWAYS caused the ActionBar version
of the ActionMode to show truncated text to try and fit them all.

In an ideal case we will always have a Floating ActionMode, but
the client can explicitely change this and hence we should fallback
gracefully.

Additionally, remove the SHOW_AS_ACTION_WITH_TEXT flags as we
removed the icons from the items anyway.

Bug: 21264711
Change-Id: I13a9aafd0fc6f6642d3a4a3399f71e739a1dce8d
2015-05-29 16:33:35 +01:00
James Cook
5cfaae4aae assist: Fix reported colors/styles for TextView/Switch
Changes to the data provided to AssistStructure:
* Text foreground color is correct even if the view has not yet been
painted.
* Text background color is now always 1 (TEXT_COLOR_UNDEFINED) for a
TextView, as it has no separate concept of background color.
* Switch now reports the text size/color/style of the label text
(usually user visible) rather than the on/off text on the button
itself (usually hidden in Material, and not usually revelant when
visible).

Bug: 21080375
Change-Id: I7e15f68d89510a76cab76031c2c8ca6ca3f32435
2015-05-28 15:52:44 -07:00
Doris Liu
c81c082628 Fix ScrollView's EdgeEffect to respect clipToPadding flag
bug: 19126514
Change-Id: I21fe4fd3e2f1240ee31c51f9deac7f285ffe2408
2015-05-28 13:29:44 -07:00
Andrei Stingaceanu
373816ef1f Stop showing both the floating toolbar and suggestions
The selection mode without selection (PASTE|SELECT_ALL)
pops up along the suggestion popup if we tap on a word
within 15sec of the most recent cut/copy/textChanged
operation. Fix this by making suggestion popup take
precedence.

Also moved the invalidation of the text changed time
into the handleTextChanged() which fixes the selection
mode starting once after the text has changed.

NOTE: Subsequent clicks on non-suggestion spans will
still trigger the selection mode without selection if
within the defined timeframe.

Bug: 20443325
Change-Id: If2726e2c965e77e82ef7b847cf352d4426205bdc
2015-05-28 11:26:28 +01:00
Alan Viverette
9123e666bb Merge "Update cached child enabled state before selector state" into mnc-dev 2015-05-26 22:27:31 +00:00
Keisuke Kuroyanagi
1733bd3def Merge "Fix: Insertion handle can be moved just by tapping." into mnc-dev 2015-05-22 02:28:26 +00:00
Keisuke Kuroyanagi
27a6361234 Merge "Fix: Crash when modifying text while using drag accelerator." into mnc-dev 2015-05-21 04:07:57 +00:00
Mady Mellor
b300d31bf1 Merge "Text selection: fix some issues with drag accelerator" into mnc-dev 2015-05-20 18:05:32 +00:00
Mady Mellor
3244a66336 Merge "Fix selection handles on older API versions" into mnc-dev 2015-05-20 17:09:13 +00:00
Mady Mellor
7a93644d5e Text selection: fix some issues with drag accelerator
Couple of overlapping issues that this CL fixes. The major change is to
offset the selection vertically this is similar to how the handles work
already (i.e. touch target is below what's being selected), and still
allows the user to see the selection start / end without covering it with
their finger.

This change fixes multiple issues:
1) Previously to ensure the finger wasn't covering the selection a
   preceding or following offset was taken, this made it difficult to
   select certain words and it made text on the edge of the screen hard
   to select (b/21098345 and b/19965619)
2) The use of preceding and following on the word iterator was not correct
   allowing grapheme clusters to be split, now the offset is calculated
   with getWordStart/End which respect grapheme clusters (b/21045116)

Bug: 21098345
Bug: 21045116
Bug: 19965619
Change-Id: Id8392426cce20ad0ff47a4279c92f6ed1b0ad30e
2015-05-20 10:05:52 -07:00
Andrei Stingaceanu
8c44e74524 Merge "Landscape extracted mode - floating toolbar interference" into mnc-dev 2015-05-20 09:32:50 +00:00
Andrei Stingaceanu
975a8d0f4d Landscape extracted mode - floating toolbar interference
In landscape do not allow starting selection modes if the
extracted mode has not yet started. Also remove the single
tap selection delayed runnable.

This allows for a smooth transition (as in no floating
toolbar artifacts) into extracted mode. Also fixes
(more as in hides) the double selections.

Bug: 20930071
Change-Id: Idb9c375dc25777761b11ca17ccfd9f5eedc642b4
2015-05-20 10:31:19 +01:00
Abodunrinwa Toki
1f21d2a8b1 Merge "Hide floating toolbar when user interacts with screen." into mnc-dev 2015-05-19 14:06:46 +00:00
Abodunrinwa Toki
fd3a3a1163 Hide floating toolbar when user interacts with screen.
- Adds an ActionMode.snooze(int) API.
- Clients call this to hide the floating toolbar on DOWN touch event.
- This is called repeatedly as a snooze timeout will re-show the
  toolbar.
- ActionMode.snooze(0) will "wake" the toolbar, reshowing it.
- Clients call this to re-show the toolbar on UP touch event.
- This CL also adds code to hide the toolbar when the "content rect"
  is changing.

Bug: 20148125
Change-Id: If5a9a15f72c73cad8ca01a4328a58570b3e29f66
2015-05-19 14:25:39 +01:00
Clara Bayarri
e94561ecbc Merge "Fix Cancelling a text action activity deletes the selected text" into mnc-dev 2015-05-19 10:42:20 +00:00
Alan Viverette
a19ab347be Update cached child enabled state before selector state
We reference the cached enabled state from the selector state update
code, so we need to ensure it is accurate first.

Bug: 20121334
Change-Id: I5859e9e8c594e1ba64ec9f001f47c2a6ea311c4f
2015-05-18 13:20:52 -07:00
Keisuke Kuroyanagi
bc89a5ce34 Fix: Insertion handle can be moved just by tapping.
Horizontal poistion is passed to updatePosition() without
adding getHorizontalOffset(). The position is wrong for the
insertion handle; thus, the handle is moved just by tapping
on it.

Bug: 20923263
Change-Id: Ie867ebd9e6b682057b73373fefb7b2baf45caef9
2015-05-18 14:49:29 +09:00
Keisuke Kuroyanagi
259292ff3d Fix: Crash when modifying text while using drag accelerator.
Drag accelerator state was not cleared when the text was
modified; thus, mStartOffset could point to an invalid offset.

Bug: 21178876
Change-Id: Ic9b47375bab321fbc573e8a81e3fadf60309da78
2015-05-18 14:15:32 +09:00
Keisuke Kuroyanagi
e20b22feb3 Merge "Fix: Drag handle isn't updated after crossing bidi boundary." into mnc-dev 2015-05-18 04:57:09 +00:00
Keisuke Kuroyanagi
33f81ac108 Fix: Drag handle isn't updated after crossing bidi boundary.
mDrawable is updated, but it was not re-drawn properly.
postInvalidate() should be called when the drawable is
updated.

Bug: 21141841
Change-Id: Icb3ddf18d05285ffa8758a9be256482d594ab8ed
2015-05-18 13:56:06 +09:00
Mady Mellor
709386f501 Fix selection handles on older API versions
The new assets didn't have the same padding on the edges as assets on older
versions. The adjustments to the getHotspotX code for the new assets broke
how the handles on older API versions were placed.

This CL updates the assets to have the same padding (i.e. handleWidth / 2
on each side of the handle and changes the getHotspotX methods for this.

Bug: 20829391
Change-Id: If7e466d200ef7757831bc763c3c3ce4a8bbf63fc
2015-05-15 15:51:47 -07:00
Alan Viverette
bd51b4d0b9 Return correct year in DayPickerPagerAdapter.getYearForPosition()
Previously it wasn't offsetting the position by the min date's month,
so it would be off by a year if the min date wasn't in January. Also
now updates button visibility whenever the ViewPager's range changes.

Bug: 21203303
Change-Id: Id7a41a4fa48843943c744fb0fecd4bebb798cee5
2015-05-15 14:18:44 -07:00
Mady Mellor
21417a0d50 Merge "Text selection: Fix moving by character when should move by word" into mnc-dev 2015-05-15 17:56:59 +00:00
Mady Mellor
c25d6c22bb Merge "Fix difficulty grabbing handles for small selections" into mnc-dev 2015-05-15 17:56:57 +00:00
Alan Viverette
617da41e8c Merge "Update button visibility as a final step in DayPickerView construction" into mnc-dev 2015-05-15 16:44:23 +00:00
Clara Bayarri
5b7665a1f2 Fix Cancelling a text action activity deletes the selected text
The implementation of onActivityResult in TextView did not check the
result code, hence treating the cancelled activity result as a
replacement by empty text.

Also added tests to catch this case and basic usage.

Bug: 21183019
Change-Id: Ibdafe89474dd69c5b70c67ec98fed46656f9fdcf
2015-05-15 16:32:50 +01:00
Alan Viverette
b12172ef47 Update button visibility as a final step in DayPickerView construction
Previously it was only updated when the page was turned, but that listener
isn't called until the user turns the page.

Bug: 20701637
Change-Id: I06faf59660cda0e19d57766f4afd141e4a389b18
2015-05-14 14:24:36 -07:00
Mady Mellor
81fa3e8966 Text selection: Fix moving by character when should move by word
The code to restrict handles from crossing did not respect moving by
word or by character. This CL checks the offset to see if it's crossing,
and if it is, it restricts it to the line of the other handle and proceeds
with determining the "actual" offset based on the activated
mode by word / by char).

There is also still a check to ensure that one character is selected
after the mode as adjusted the offset.

Bug: 21114827
Change-Id: Idac699ef2eb5d313e77d44b5064c03ff84e0fb88
2015-05-14 09:22:59 -07:00
Andrei Stingaceanu
fae270c108 Editor: enable double tap for selection after cut/copy.
* detect double tap in the TextView and pass it to Editor.
* add a timer (with getDoubleTapTimeout) for executing the
  single tap job in Editor.
* if double tap is detected then cancel the single tap job.

This way one tap shows the toolbar if within the timeframe
and two taps select the word and show the toolbar.

Bug: 20442587
Change-Id: I0a117939c896fcb13669346e30c9c48d319576dd
2015-05-14 16:11:07 +01:00
Andrei Stingaceanu
35c550c854 Fix: text selection bubbles move along with the text
Always hide the selection cursor when showing the
insertion cursor.

Bug: 19857679
Change-Id: I549552fa5026e60f94900364b8194217e0de4b4a
2015-05-14 14:30:18 +01:00
Wojciech Staszkiewicz
be752b1f28 Merge "Pass charset to XmlPullParser.setInput instead of null" into mnc-dev 2015-05-14 10:27:24 +00:00
Andrei Stingaceanu
c398adf81c Merge "Fix floating toolbar popping frequently after Replace/Copy" into mnc-dev 2015-05-14 10:23:09 +00:00
Andrei Stingaceanu
78e2f07e81 Merge "Fix: replace terminates extract mode (floating toolbar)" into mnc-dev 2015-05-14 09:33:58 +00:00
Wojciech Staszkiewicz
9e9e2e73c6 Pass charset to XmlPullParser.setInput instead of null
Passing null to XmlPullParser.setInput forces it to do additional
work, which can be easily avoided if we know the charset beforehand.

bug: b/20849543

Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
2015-05-14 10:24:34 +01:00
Chris Banes
e695bb8a28 Fix build; doc link in ImageView
Change-Id: Ie3057fc2b920f71ff89eee0d3577d21d0e9930c3
2015-05-14 10:12:20 +01:00
Deepanshu Gupta
e646022429 Merge "Revert "Call dispatchFinishTemporaryDetach before returning a transient view"" into mnc-dev 2015-05-14 04:52:59 +00:00
Keisuke Kuroyanagi
0433488daa Merge "Track difference between touch and word in x coordinate." into mnc-dev 2015-05-14 04:26:21 +00:00
Deepanshu Gupta
5987e553c2 Revert "Call dispatchFinishTemporaryDetach before returning a transient view"
This reverts commit c73a1aaa90. The change
causes an NPE when rendering ListViews.
2015-05-13 21:25:57 -07:00