Commit Graph

5420 Commits

Author SHA1 Message Date
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
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
Dan Sandler
a22a380fbb Add Icon support to ImageView.
ImageView.setImageIcon() is remotable, so you can also call
RemoteViews.setImageViewIcon().

Bug: 18568715
Change-Id: I456cfa65102e1983d3392d822584d154a6cd761a
2015-05-13 23:50:39 -04:00
Alan Viverette
bf6d50f906 Merge "Call dispatchFinishTemporaryDetach before returning a transient view" into mnc-dev 2015-05-13 23:35:55 +00:00
Keisuke Kuroyanagi
0138e4c7f8 Track difference between touch and word in x coordinate.
After a handle is snapped to the word, the difference was
tracked in offset. It can break grapheme clusters, ignores
character width, and makes it difficult to select text near
line breaks.

Bug: 21005599
Change-Id: I42402a377670c7e3c6d6e6583744d085ae52bba2
2015-05-13 16:28:29 -07:00
Mady Mellor
21623faa44 Merge "Fix issue where handle is in front of word rather than end of word" into mnc-dev 2015-05-13 17:34:13 +00:00
Mady Mellor
2e577d2e1c Fix difficulty grabbing handles for small selections
The gravity for the handles pushes them to the outside of the touch target
square, causing the touch target to overlap for both of them when close
together. This CL swaps the gravity so that the touch target does not
overlap when the handles are close.

Bug: 20065564
Change-Id: I4d14e7076ac779c5f4a0a603d6348ba6dc7c7b4c
2015-05-13 07:15:17 -07:00
Roozbeh Pournader
0ca0f58000 Merge "Add hyphenationFrequency attribute to TextView and StaticLayout." into mnc-dev 2015-05-12 22:59:47 +00:00
Roozbeh Pournader
95c7a13f2a Add hyphenationFrequency attribute to TextView and StaticLayout.
This patch adds plumbing to TextView and StaticLayout to control the
frequency of automatic hyphenation used in laying out paragraphs.

Bug: 21038249
Change-Id: Ib45de190eb0a1ed738e69fd61f2b39561b11aec7
2015-05-12 14:56:57 -07:00
Mady Mellor
58c9087137 Fix issue where handle is in front of word rather than end of word
Previous getWordEnd and getWordStart functions would return a boundary
rather than a word end / start boundary in some cases. This behavior is
most evident when moving between short lines -- the handle would go to
the next boundary rather than the word end on the next line (and the
start handle would go to the word end rather than the word start on
the prev line).

This CL ensures that word or punctuation boundaries are returned and moves
most of the punctuation boundary logic into WordIterator since it makes
a bit more sense there.

Bug: 21030788
Change-Id: I96c6aff7f2c213aa3c4f66ac87ca913ca16fd347
2015-05-12 11:09:37 -07:00
Chris Craik
6a49ddef62 Revert "Fix build - Revert "Revert "Use default constructor to get anti-aliasing"""
Fix import

This reverts commit 7ed1431c83.

Change-Id: Id93eba3ed1d47a90384ba20dea6f74d78755792b
2015-05-12 10:44:30 -07:00
Chris Craik
7ed1431c83 Fix build - Revert "Revert "Use default constructor to get anti-aliasing""
This reverts commit dfe0a66cec.

Change-Id: I58a1bae649a284f3d3b6213064d903ea7fcf185a
2015-05-12 17:22:22 +00:00
Chris Craik
dfe0a66cec Revert "Use default constructor to get anti-aliasing"
bug:20948129

This reverts commit 58fc522a69.

Change-Id: Iddeccb4ad15b843bb3e610bd3673a0c7abc1bf46
2015-05-12 16:36:49 +00:00
Andrei Stingaceanu
eeb9afc78f Fix: replace terminates extract mode (floating toolbar)
Moved the replace action to be triggered from the TextView
rather than the Editor. Previously the ExtractedEditText
was calling the TextView.onTextContextMenuItem which did
not hold an entry for replace and thus was returning
false.

Note: this CL does not fix the extracted mode being
(randomly) terminated when edit actions are pressed. This
is still under investigation.

Bug: 20930071
Change-Id: I71f87418f040f6860fe7723e4cd731c298cf3c5f
2015-05-12 12:54:25 +01:00
Clara Bayarri
c12e4e468f Merge "Fix Floating toolbar is not refreshed when dragging insertion handle" into mnc-dev 2015-05-12 09:06:06 +00:00
Svet Ganov
8c7f700a59 Add permission meta-state flags to support grant/revoke permission policy.
We now maintain a mata-state with each permission in the form of flags
specyfying the policy for this permission. This enables support of the
following use cases:

1. The user denies a permission with prejudice in which case an app cannot
   request the permission at runtime. If an app requests such a permssion
   it gets a denial unless the user grants the permission from settings.

2. A legacy app with disabled app-ops being upgraded to support runtime
   permissions. The disabled app ops are converted to permission revocations.
   The app ops manager is a part of the activity manger which sits on top
   of the package manager, hence the latter cannot have a dependency on the
   former. To avoid this the package installer which is the global
   permission managment authority marks the permission as revoked on
   upgrade and the package manager revokes it on upgrade.

3. A device policy fixing a permission in a granted or revoked state. This
   additional information is folded in the meta-state flags and neither
   apps can request such permissions if revoked not the user can change
   the permission state in the UI.

Change-Id: I443e8a7bb94bfcb4ff6003d158e1408c26149811
2015-05-11 17:13:57 -07:00
Clara Bayarri
1baed51603 Fix Floating toolbar is not refreshed when dragging insertion handle
Bug: 20922753
Change-Id: Iaee310ee0b8593df4d7846c2676e2c70011d0657
2015-05-11 15:29:16 +01:00
Alan Viverette
f659a56c30 Merge "Replace usages of deprecated version of TextView.setTextAppearance()" into mnc-dev 2015-05-09 00:20:04 +00:00
Alan Viverette
bb98ebd6b1 Replace usages of deprecated version of TextView.setTextAppearance()
Change-Id: Ie501affe2e3a275d3172ce8ed584ba1cd5494da8
2015-05-08 17:17:44 -07:00
Mady Mellor
db9629eec4 Merge "Fix: Hard to modify multi-line selection." into mnc-dev 2015-05-08 21:45:36 +00:00
Dianne Hackborn
ed9af066b2 Merge "Fix issue #20655182: API Review: ViewAssistStructure" into mnc-dev 2015-05-08 20:42:12 +00:00
Keisuke Kuroyanagi
50a927cdd1 Fix: Hard to modify multi-line selection.
mTouchWordOffset was not appropriately updated when a
selection is modified across multiple lines.

Bug: 20650838
Change-Id: I46f5393970dc8d806719467bac489feac0fbe1a5
2015-05-07 19:30:30 -07:00
Siva Velusamy
94a6d15ede Use new hierarchy viewer protocol in all View subclasses
A previous CL introduced a new way of encoding view properties for
use by heirarchy viewer. This CL updates all views using the old
@ExportedProperty annotation to use this new method. The older
mechanism will be removed in a subsequent CL.

Change-Id: I6cc23b90cd9da1c6ce89b4caffe54874db203452
2015-05-07 18:44:21 -07:00
Dianne Hackborn
49b043f37d Fix issue #20655182: API Review: ViewAssistStructure
Fix the various view assist related APIs.

Also remove the blockAssist view attribute, and instead use
the window's FLAG_SECURE to drive blocking of the entire
hierarchy (which is semantically correct, and will protect
existing apps that have already indicated they need it).

Change-Id: I6beebc86b202809cba0a356cae9607d8d0fb5e78
2015-05-07 16:30:52 -07:00
Chet Haase
c1125dedfc Merge "Disable ActionBar animations pending more involved fix" into mnc-dev 2015-05-07 22:00:18 +00:00
Mady Mellor
a18df8d6c7 Merge "Consider punctuation treatment when selecting text." into mnc-dev 2015-05-07 21:59:39 +00:00
Chet Haase
d96c87eb64 Disable ActionBar animations pending more involved fix
Recycling of ActionBar items can cause problems with the current
ActionBar animations, as the system animates views that represent both
pre- and post-layout changes, sometimes causing opposit animations to
run on the same view, resulting in unpredictable effect slike views
remaining invisible.

This 'fix' is a workaround to disable item animations pending a more
complete and robust fix that involves a more involved system of view
recycling that would avoid recycling views that are currently being used
in animations.

Issue #20538912 Menu missing in Downloads app

Change-Id: I7b1d3baf94378e4788f868801a452c6583353842
2015-05-07 21:59:26 +00:00
Keisuke Kuroyanagi
636a0da805 Merge "Fix: A part of grapheme cluster can be selected." into mnc-dev 2015-05-07 21:37:50 +00:00
Mady Mellor
6fc03e6523 Merge "Revert "Text selection - Don't select vertical white space"" into mnc-dev 2015-05-07 21:13:43 +00:00
Mady Mellor
6c7b4ad690 Consider punctuation treatment when selecting text.
This treats punctuation as "words", so groups of punctuation will be
selected together, i.e. "Hmm... yay!!!" would be treated as four words:
Hmm-...-yay-!!!

Bug: 19950062
Change-Id: Ic9514c524092734fad1abdf19a736bfa1406157b
2015-05-07 21:05:36 +00:00
Mady Mellor
6a6126834e Revert "Text selection - Don't select vertical white space"
This reverts commit b9bbbb1d97.

Bug: 20653654
Change-Id: Id96409ac17783bd1e7055913f14de8741d0f9caf
2015-05-07 21:03:57 +00:00
Alan Viverette
c8bfc68cdd Only resize list popup if it's still attached to a window
We can't rely on ListPopupWindow.dismiss() to get called before the popup
is removed, for example when the activity hosting the popup is finished,
but we can easily ensure that the popup is still attached to a window.

Bug: 20831507
Change-Id: I9dcaa46e68df3f2b301cf299fa64d460c7e177fd
2015-05-07 13:00:25 -07:00
Alan Viverette
c73a1aaa90 Call dispatchFinishTemporaryDetach before returning a transient view
ListView caches transient state views for reuse during layout, which calls
dispatchStartTemporaryDetach() before caching the view. This should always
be followed by a corresponding dispatchFinishTemporaryDetach() before
removing the view from the cache and returning it for reuse. While this
was the case for other types of cached views, we missed this call for
views placed in one of the two transient view caches.

Bug: 17387206
Change-Id: I840ed1338b1bc623dcb77c8b42d2fb6bf646de2e
2015-05-07 11:06:47 -07:00
Andrei Stingaceanu
77b9c388c9 Fix floating toolbar popping frequently after Replace/Copy
Invalidate the LAST_CUT_OR_COPY_TIME when text changes. Reflect
this in the variable names. Fixes the selection mode without
selection (PASTE|SELECT_ALL) toggling when changing text in the
15 sec window this mode has to show.

Bug: 20440790
Change-Id: Ie7ea55916e1633ed4981654c6d80168b1247bc35
2015-05-07 10:18:22 +01:00
Adam Powell
6711f3b34c Move PhoneWindow and friends back into internal package
PhoneWindow, PhoneLayoutInflater and PhoneFallbackEventHandler decided
to @hide out over in the android.view package after the policy jar was
disbanded. Give them a more appropriate home over in framework that
doesn't imply that they should be accessed from other internal layers
of abstraction.

Bug 19606548

Change-Id: Id07b791d178fa447010b49b24726b52208838e88
2015-05-06 15:57:09 -07:00
Alan Viverette
4d5c20c613 Merge "ListPopupWindow should use window layout type SUB_PANEL" into mnc-dev 2015-05-06 17:24:31 +00:00
Prerepa Viswanadham
d1808401ca Merge changes from topic 'mwd-merge-050415' into mnc-dev
* changes:
  Merge commit 'b6f59f4' into master_merge
  Merge commit 'f6db0ce' into master_merge
  Merge commit '17455a3' into master_merge
  Merge commit 'b4d5b32' into master_merge
  Merge commit 'a1a2fa7' into master_merge
  Merge commit '8dfdb98' into master_merge
  Merge commit 'eba66c3' into master_merge
2015-05-05 01:06:38 +00:00