Commit Graph

6520 Commits

Author SHA1 Message Date
Alan Viverette
ac21e56f63 Add note about density scaling behavior to setImageURI
Bug: 27327999
Change-Id: I1e348a1fbda20fff9575261df7097fbd46381383
2016-10-11 23:32:10 +00:00
Alan Viverette
0d2a46b733 Scale bitmap shaders for target density
Also fixes progress bar sample tile to reflect density and ensures
that ProgressBar.tileify() clones inner drawables into the correct
density.

Bug: 31841123
Test: BitmapDrawableTest#testPreloadDensity()
Test: ThemeHostTest
Test: Visual inspection of ApiDemos
Change-Id: I9dcb9817d8d91d61ff0215987247e9e7fb089c46
2016-10-07 16:23:32 -04:00
Kevin Hufnagle
971696f632 docs: Added min/max values and descriptions for alpha getter/setter in ImageView am: bdb308a059
am: c012a7ed7a

Change-Id: Ib2c868e86e516ae2a2f92e4e26a8c0113237557a
2016-09-27 00:08:50 +00:00
Kevin Hufnagle
c012a7ed7a docs: Added min/max values and descriptions for alpha getter/setter in ImageView
am: bdb308a059

Change-Id: Ida297f581f7177cd92ec4157a1b735c91d2e26a4
2016-09-26 23:37:36 +00:00
Kevin Hufnagle
bdb308a059 docs: Added min/max values and descriptions for alpha getter/setter
in ImageView

Bug: 12644483
Change-Id: I269d63b50412ecea5269acb99fc09c8110e404b4
2016-09-23 15:54:42 -07:00
Mark Lu
d1bb5fad4e docs: Add param info to TextView.setTextColor am: 193879a8b6
am: 544e899559

Change-Id: Ic4506ceaf5c34c93b3d937137f9a4756508ff189
2016-09-23 22:25:17 +00:00
Mark Lu
544e899559 docs: Add param info to TextView.setTextColor
am: 193879a8b6

Change-Id: I5b157858dd056b2510486ad7546ab74e1287005c
2016-09-23 22:16:37 +00:00
Mark Lu
7df8927691 Merge "docs: Add param info to TextView.setTextColor" into nyc-dev 2016-09-23 22:09:34 +00:00
Mark Lu
a744c8c25a docs: Mention SwitchCompat in Switch and toggle documentation am: 3404032dfc
am: 902fb28784

Change-Id: I67ad867bdad8634437fe6779e027001355bbc6ae
2016-09-23 21:58:21 +00:00
Mark Lu
902fb28784 docs: Mention SwitchCompat in Switch and toggle documentation
am: 3404032dfc

Change-Id: I1df8dd7f48f095a93aaff120b0f86e2ccc6467fd
2016-09-23 21:52:30 +00:00
Alan Viverette
8817aa9339 Allow developer to override Material-style modes in picker dialogs
A recent fix prevented developers from specifying Holo-style mode when
displaying a date or time picker dialog. This CL also cleans up unused
code in TimePickerDialog and documents how themeResId will be used.

Adds hidden @TestApi methods for use in CTS tests. These may be made
public later, but it's too late in MR1 for API changes.

Bug: 31586821
Test: Ice2e203983769f1ea1cfa93105eb97b6fa5176b9
Change-Id: I1b7512b7647ddd7ab987beac2c0aef4fe7cc16bc
2016-09-22 11:16:22 -04:00
TreeHugger Robot
a4e2b2a1c1 Merge "Cancel pending selection before filtering input" into nyc-mr1-dev 2016-09-12 21:57:15 +00:00
Rob Carr
33c879fe14 Merge "PopupWindow: Don't ignore top decorations in getMaxAvailableHeight." into nyc-mr1-dev 2016-09-12 18:43:42 +00:00
TreeHugger Robot
fceb3598f9 Merge "Fix SearchView measure for UNSPECIFIED height." into nyc-mr1-dev 2016-09-10 00:18:51 +00:00
Aurimas Liutikas
f6a50be25c Fix SearchView measure for UNSPECIFIED height.
Previously it would almost always force SearchView to become 0
when height mode was UNSPECIFIED.

Bug: 31302290
Change-Id: Icd2116b84951b1b967666147dbc5762d996408e6
2016-09-09 15:32:55 -07:00
Robert Carr
701d73084d PopupWindow: Don't ignore top decorations in getMaxAvailableHeight.
getMaxAvailableHeight is ignoring the top insets, while
findDropDownPosition is not. This is causing getMaxAvailableHeight
to return a fits above position that findDropDownPosition will think
is too large.

Bug: 31048766
Change-Id: Ifa57cb4ebe0944c701a6f38b58d4f144d8b9199c
2016-09-09 12:00:19 -07:00
Alan Viverette
57fe701ddf Cancel pending selection before filtering input
There may be a pending selection from a previous filter() call, but the
current filter() call may return an empty string without posting a new
pending selection.

Bug: 31049172
Change-Id: I2cb88b3283a3705b6c85d61f26951c35d2b0acd2
2016-09-09 14:29:35 -04:00
Svet Ganov
6367e4ed30 [DO NOT MERGE] Remove toast window immediately
To address a security issue where a toast window can be
used by an app to overlay other apps without a permission
we now allow legacy apps to be able to put at most one
toast window on the screen to prevent adding the same
window over and over again to go around the new restriction
that toast windows are always removed after a timeout.
This change ensures that Toast removes its window immediately.

bug:31340854

Change-Id: Ia7f90844eb64b583321103d090e4407038b41547
(cherry picked from commit 1777c91f8f)
2016-09-08 23:12:11 +00:00
Svetoslav Ganov
aa07653d2e Prevent apps to overlay other apps via toast windows
It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.

Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.

Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.

We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.

bug:30150688

Change-Id: Ia1dae626bd9e22541be46edb072aa288eb1ae414
2016-09-02 14:00:07 -07:00
Mark Lu
3404032dfc docs: Mention SwitchCompat in Switch and toggle documentation
Bug: 19574556
Change-Id: I2ebb504b144a442d90cfdf6ab4b407726a3b896f
2016-09-02 10:13:17 -07:00
Rob Carr
8330a91def Merge "PopupWindow: Gravity fixes." into nyc-mr1-dev 2016-08-31 19:21:52 +00:00
Mark Lu
193879a8b6 docs: Add param info to TextView.setTextColor
Bug: 6617101
2016-08-30 17:36:52 -07:00
Adam Powell
fd86f7fdfd Fixes for ImageView drawable visibility dispatch
am: 06f9eb8b62

Change-Id: I8b7d8c73f0a718963a191fd5460517e5a7445974
2016-08-27 01:19:28 +00:00
Alan Viverette
c328f042a6 Set up view state before attaching, jump drawables if needed
View attachment calls jumpDrawablesToCurrentState(), so the view state
needs to be set up prior to attachment. For views that are already
attached but are being moved to a new position, manually jump.

Cleans up comments in methods that were modified.

Bug: 29978498
Change-Id: Ica27b2c60ad7ee98b9d1e4912c4f8b8c248af88d
(cherry picked from commit 26489e1688)
2016-08-27 01:17:22 +00:00
Adam Powell
06f9eb8b62 Fixes for ImageView drawable visibility dispatch
Some apps rely on their drawables not getting not-visible hints via
setVisible when the window visibility changes. This manifests as
additional animations, such as crossfading from placeholders when the
window becomes visible again.

Apps should be able to handle this case in the future now that we have
more detailed reporting via onVisibilityAggregated, but to keep
existing apps working as-is, ImageView now operates in a compatibility
mode for targetSdkVersion < N and will only dispatch visibility
signals based on the same triggers used in M. New apps get the more
detailed signals.

Fix a bug where window visibility dispatch via onVisibilityAggregated
would double-dispatch "not visible" when the window is transitioning
from GONE => INVISIBLE or INVISIBLE => GONE.

Make the growing set of compatibility check fields in ImageView
static, matching the pattern from View.

Bug 30216207

Change-Id: I88875260bf6aaa23687c7d51353de8d633383531
2016-08-26 22:59:39 +00:00
Adam Powell
a35c182637 Always report visibility to new ImageView drawables
am: 37b44dd592

Change-Id: Ib8e1cc5d3ee91aae74875cc70fda9d8d4104892e
2016-08-24 23:12:27 +00:00
Adam Powell
37b44dd592 Always report visibility to new ImageView drawables
Fix a regression where some drawables would not be correctly updated
with their visibility state if set while an ImageView was not attached
to a window.

Bug 30216207

Change-Id: Ia30326a78168141c8f85bad9c782710f965623b7
2016-08-24 22:57:09 +00:00
Alan Viverette
16b8941dba Merge "Clean up VideoView, SurfaceView constructors" into nyc-mr1-dev 2016-08-24 18:17:04 +00:00
Alan Viverette
4e32b47c48 Merge "Constrain input hour and minute to valid range" into nyc-mr1-dev 2016-08-24 18:17:04 +00:00
Robert Carr
085160612d PopupWindow: Gravity fixes.
First we restore the M semantics with respect
to DISPLAY_CLIP_VERTICAL, which we only applied
for drop downs, and omitted in the case of
showAtLocation. Further, we fix an error where
user specified gravity from showAtLocation is
erased when calling update() by storing the
gravity and including it in computeGravity().

Bug: 30445010
Bug: 30965176
Change-Id: I28a081e1237a8b41f2444717e0db21ef4181507b
2016-08-23 10:20:00 -07:00
Rob Carr
b19915bea8 Merge "PopupWindow: Be more consistent about Gravity calculation." into nyc-mr1-dev 2016-08-22 20:47:10 +00:00
Alan Viverette
a770530e12 Announce the date for accessibility using EMMMMdy format
Which for en_US would be something like "Friday August 5th 2016" but may
be re-ordered for other locales. Dates are hard.

Bug: 30682782
Change-Id: I015d293526592add27ce8fada12cd58bcc274ccf
2016-08-17 12:46:59 -04:00
TreeHugger Robot
75f7bfdc7a Merge "Use localized hour when announcing selection for accessibility" into nyc-mr1-dev 2016-08-10 21:55:30 +00:00
Robert Carr
798fb79866 PopupWindow: Be more consistent about Gravity calculation.
Currently we are only appending the DISPLAY_CLIP_VERTICAL
if the API user happens to call update() after showAsDropDown().
This fixes that behavior, and fixes a RTL issue (START v. LEFT).
Unblocks a CTS test I am working on.

Bug: 30578621
Change-Id: Ibf838544d453986b66eb223e2ac0f7d909fe5630
(cherry picked from commit 8367c50972)
2016-08-08 20:35:17 +00:00
Alan Viverette
47be54bb78 Use symmetric conditions for advertising and performing ACTION_SCROLL
Bug: 30186372
Change-Id: Ieea0cd539049990ffa98edabb2a7b026445dd14a
2016-08-05 16:48:19 -04:00
Alan Viverette
66a8562c58 Use localized hour when announcing selection for accessibility
Bug: 30451273
Change-Id: I04276dc12d479ff5336799ebb32ff4cf5d66068a
2016-08-04 13:24:14 -04:00
Alan Viverette
f0ac2ba9f4 Constrain input hour and minute to valid range
This is consistent with the legacy spinner implementation.

Bug: 30570390
Change-Id: I14fb1363b410b2f56ead01e0b632efb8f7508268
2016-08-04 13:23:33 -04:00
Alan Viverette
768ca7d19b Clean up VideoView, SurfaceView constructors
Also cleans up VideoView fields. No functional changes.

Bug: 30600463
Change-Id: I42241e376006c328695d46d63f7fdeda409f1a67
2016-08-04 09:54:14 -04:00
Yigit Boyar
2dd20a61e9 Target API check for margin params fix
Prior to N, our widgets were not converting MarginLayoutParams
properly between ViewGroups. The fix intrudced some issues in
older apps as the broken conversion code would hide developer
errors. This CL guards the change with a target API check so
that we don't affect older apps.

Bug: 30378230
Change-Id: I215281d261b553c3b4cedcd29ea0a861df809471
2016-08-02 11:27:18 -07:00
Svetoslav Ganov
a2f247e6a6 Merge "Revert "Prevent apps to overlay other apps via toast windows"" into nyc-mr1-dev 2016-08-02 01:56:10 +00:00
Svetoslav Ganov
2fc661a453 Revert "Prevent apps to overlay other apps via toast windows"
bug:30150688

This reverts commit dc24f937b0.

Change-Id: Id7e8ddbf82ab426f55a5296791f1e8ebb61514bc
2016-08-02 01:55:01 +00:00
Alan Viverette
7dd40cd411 Merge "Adjust touch progress offset to account for changes to AbsSeekBar" into nyc-mr1-dev 2016-08-01 20:53:50 +00:00
Alan Viverette
1d33c3f3a3 Adjust touch progress offset to account for changes to AbsSeekBar
Previously AbsSeekBar always rounded up, which resulted in poor handling
of touches near the edge of a progress value. We fixed this but forgot
to adjust RatingBar for the new behavior.

Bug: 30558586
Change-Id: I634fa7a0b98568093e16279ef5a80abe08d2e2fe
2016-08-01 15:14:05 -04:00
Svet Ganov
dc24f937b0 Prevent apps to overlay other apps via toast windows
It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.

Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.

Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.

We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.

bug:30150688

Change-Id: Icc8f8dbd060762ae1a7b1720e96c5afdb8aff3fd
2016-08-01 11:46:02 -07:00
Michael Kwan
744be16ffa Add titles to PreferenceFragments and PreferenceScreens for watches.
Preferences lack a title on watch type devices due to lack of ActionBar
support. A custom ListView was added to use a custom wrapper adapter to
add a persistent header view at the top of the ListView that developers
would not be able to remove via the ListView API.

Bug: 27962897
Change-Id: I6bccecf85592d9507e0c7a04c9a035617001e9ef
2016-07-26 10:57:56 -07:00
Alan Viverette
48c5f38b34 Merge "Ensure forwarding listener target is long-clickable" into nyc-mr1-dev 2016-07-22 21:09:37 +00:00
TreeHugger Robot
0ff47b64cd Merge changes Idd0b38b4,I511356a8 into nyc-mr1-dev
* changes:
  Fixed a bug where the fade in from dark would not work properly
  Changed the appearance of fullscreen intent notifications again
2016-07-22 19:20:49 +00:00
Selim Cinek
981962e6ad Changed the appearance of fullscreen intent notifications again
Change-Id: I511356a8dc0fe253541c625fb7b43ed0c7bafaca
Fixes: 28269355
2016-07-22 12:13:11 -07:00
Alan Viverette
123db917b2 Merge "Better docs for ImageView legacy tint" into nyc-mr1-dev 2016-07-22 02:50:40 +00:00
Yigit Boyar
93652f20f2 Merge "Resolve ListView children's RTL properties when added" into nyc-mr1-dev 2016-07-21 21:56:56 +00:00