Commit Graph

5400 Commits

Author SHA1 Message Date
Alan Viverette
bf6d50f906 Merge "Call dispatchFinishTemporaryDetach before returning a transient view" into mnc-dev 2015-05-13 23:35:55 +00: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
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
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
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
Raph Levien
5c26876304 Merge "Expose StaticLayout.Builder publicly" into mnc-dev 2015-05-02 00:42:18 +00:00
Raph Levien
4bf4e4c801 Merge "Make Paint a required field of StaticLayout Builder" into mnc-dev 2015-05-02 00:41:51 +00:00
Yohei Yukawa
b6bec1a403 Remove unused methods/variables/fields from Editor.java.
This CL does nothing but remove unused code.

Change-Id: Ibe7c7aa1b9bdfd4117e27cb198082e307f4d68a4
2015-05-01 23:30:35 +00:00
Raph Levien
531c30c62b Expose StaticLayout.Builder publicly
Expose the new Builder pattern for creating StaticLayout. This allows
access to a number of features that have been available to TextView
through a hidden constructor. Some of these features have existed
for a while (mostly maxLines), while others are new (breakStrategy,
indents).

The builder is cleaner and has a better upgrade path than the old
pattern of lots of constructors with varying numbers of arguments.

Bug: 20190561
Change-Id: Ia3cd124825ab0cb469d22d1fc576ad26454545b8
2015-05-01 15:15:48 -07:00
Alan Viverette
da0d6a6b8a Merge "Correctly handle intercepted touch events in FastScroller" into mnc-dev 2015-05-01 18:30:26 +00:00
Alan Viverette
fb99ba895e Correctly handle intercepted touch events in FastScroller
Previously we'd return true from onIntercept and assume the DOWN event
was handled, then onTouch would return false and the host view would
receive the DOWN event. Now we consume the event in onTouch.

Bug: 19080751
Change-Id: I1bd35b4c25a0760f4248ade443d09b8ca4b71e7c
2015-05-01 10:10:15 -07:00
Yohei Yukawa
85d08f1bf8 Suggestions popup must be dismissed before device rotation.
This is a follow up CL for Ia515fc576ddf2127b2f9863cc2652aeb619fff6e
for Bug 5420741, which had basically the same goal to Bug 20158984.

The goal here is to dismiss any popup window opened by the TextView
when the device is about to be rotated.  This is important because
Window Manager and Input Method Manager Service are really sensitive
about which window is focused before and after the device is rotated.

In Ia515fc576ddf2127b2f9863cc2652aeb619fff6e, we tried to distinguish
two kinds of focus-lost. One is the true focus lost where suggestions
pop-up (if any) should be dismissed, and the other is an side effect
of showing the suggestions pop-up itself. We have used isShowingUp()
to distinguish distinguish one from the other. In short, it
indicates whether onWindowFocusChanged() is not called yet or is
called at least once.

In extract edit mode, however, it turned out that
onWindowFocusChanged() is never called (at least in recent builds).
As a result, the popup window is not dismissed when it should be.
One of the smallest solution would checking isShowingUp() only when
the target TextView is not ExtractEditText.

Adding unit test would be handled as Issue #20703391.

BUG: 5420741
BUG: 20158984
BUG: 20703391
Change-Id: I1706cf2ea0b0bdfe8894ab57fc3caa8ff12d8aab
2015-04-30 17:22:28 -07:00
Alan Viverette
80ebe0d4ec ListPopupWindow should use window layout type SUB_PANEL
Look down, back up, where are you? You're in a dialog with an
AutoCompleteTextView. What's on your screen? I have it, it's the
auto-completion results you could be seeing. Look again. The window
layout type is now TYPE_APPLICATION_SUB_PANEL and the auto-completion
results are visible.

Also adds API on ListPopupWindow to specify the window layout type
and changes the text editing handle to be type ABOVE_SUB_PANEL.

Bug: 18530738
Change-Id: Id5577c4892729920de5b73411e580e6b2b2401d0
2015-04-30 15:53:11 -07:00
Raph Levien
ebd66ca600 Make Paint a required field of StaticLayout Builder
This patch moves the Paint parameter from being an option set from
setPaint to being a required field passed into the obtain() method
of StaticLayout.Builder. Thus, it is now possible to get a valid
StaticLayout object just doing .build() on the Builder; all other
fields are optional.

This is in preparation for exposing the builder publicly, but that
is to be a separate CL.

Bug: 20190561

Change-Id: Iefd7800203004e565d068b0c76502cf7cf52d91f
2015-04-30 15:38:17 -07:00
Alan Viverette
b0f13dc4be am 68999a74: am 19b9f8ef: am 8310f87d: Merge "ActionBar SearchView\'s default hint shouldn\'t override SearchableInfo" into mnc-dev
* commit '68999a740c511abe0550c721e13580b8d041de51':
  ActionBar SearchView's default hint shouldn't override SearchableInfo
2015-04-30 16:25:24 +00:00
Alan Viverette
68999a740c am 19b9f8ef: am 8310f87d: Merge "ActionBar SearchView\'s default hint shouldn\'t override SearchableInfo" into mnc-dev
* commit '19b9f8ef3eaf392db0a993ae0d5a7a84e9d6c60f':
  ActionBar SearchView's default hint shouldn't override SearchableInfo
2015-04-30 16:21:57 +00:00
Alan Viverette
8310f87d96 Merge "ActionBar SearchView's default hint shouldn't override SearchableInfo" into mnc-dev 2015-04-30 15:59:21 +00:00
Maxim Bogatov
aba56b648f Merge "Add accessibility actions for scrolling in different directions" 2015-04-30 01:16:02 +00:00
Alan Viverette
b4004dfc84 ActionBar SearchView's default hint shouldn't override SearchableInfo
Moves the queryHint to defaultQueryHint, specifies the override order
as queryHint > SearchableInfo > defaultQueryHint.

Cleans up annotations and comments for several related methods.

Bug: 20614122
Change-Id: Ib58ec309e6814cd512df147d789ec0cd546018af
2015-04-29 16:55:42 -07:00
Abodunrinwa Toki
8020631fa4 am 45b04c1a: am 47ea8b3d: Merge "DO NOT MERGE: Update floatingtoolbar position when cursor moves." into mnc-dev
* commit '45b04c1a5ef4f21b14b40dd0c1035933188da322':
  DO NOT MERGE: Update floatingtoolbar position when cursor moves.
2015-04-29 17:43:40 +00:00
Abodunrinwa Toki
47ea8b3d6b Merge "DO NOT MERGE: Update floatingtoolbar position when cursor moves." into mnc-dev 2015-04-29 17:26:29 +00:00
Andrei Stingaceanu
da8d35cd31 am 78a4348a: am eea5a9e0: Merge "DO NOT MERGE - Minor clean up: redundant functionality in Editor and TextView." into mnc-dev
* commit '78a4348a535e530ae77c0e7777247d495596be7c':
  DO NOT MERGE - Minor clean up: redundant functionality in Editor and TextView.
2015-04-29 16:47:25 +00:00
Andrei Stingaceanu
eea5a9e0de Merge "DO NOT MERGE - Minor clean up: redundant functionality in Editor and TextView." into mnc-dev 2015-04-29 16:21:16 +00:00
Alan Viverette
2ceea2160e am 9c36ee9b: am 2ddfcc4a: Merge "Context leaks in EditText causes out of memory"
* commit '9c36ee9b4f42909c1a425322e4e2d3e86dd6edc5':
  Context leaks in EditText causes out of memory
2015-04-29 05:34:45 +00:00
Alan Viverette
9c36ee9b4f am 2ddfcc4a: Merge "Context leaks in EditText causes out of memory"
* commit '2ddfcc4ade5d6db69808a340ae54280872559ec1':
  Context leaks in EditText causes out of memory
2015-04-29 04:54:28 +00:00