Commit Graph

5966 Commits

Author SHA1 Message Date
Alan Viverette
2b4dc11566 Animate radial time picker selector during hour/minute transition
Also propagates XML attrs from time picker to radial view during
construction, which allows the hour colors & etc. to be changed
inline without needing to set the timePickerStyle theme attribute.

Bug: 20333885
Change-Id: Ib42b9f5b93b5d6ce1dcbaa05f99cef40c9f9a9d3
2015-10-02 15:29:43 -04:00
Toni Barzic
e9889bf372 Forward SeekBarPreference key events to seekBar view
This is to ensure that seek bar progress gets properly updated,
and that progress changes reported by the seek bar are marked as
coming from user.

BUG=24416333
BUG=20049245

Change-Id: I0a48c8eae1528937024ca54720cac91c7d21b0b9
2015-09-30 10:22:06 -07:00
Toni Barzic
7c082caf65 Merge "Mark progress updates from AbsSeekBar.trackTouchEvent as from user" 2015-09-30 17:08:01 +00:00
Seigo Nonaka
f03d7994bd Merge "Reduce the number of TextAppearanceSpan objects for highlighting." 2015-09-30 04:39:26 +00:00
Toni Barzic
deb2ad56ea Mark progress updates from AbsSeekBar.trackTouchEvent as from user
Looks like this one was missed in Iafa32538b4f92705c4c1ca2a02145c078add2532
when setProgress(int, boolean) went from setProgress(progress, fromUser) to
setProgress(progress, animate)

BUG=24416333

Change-Id: Id22f4d67986a24c907f61e22866ae43ffdfe79b8
2015-09-29 15:52:49 -07:00
Alan Viverette
b854d07a1a Unhide PopupWindow.getMaxAvailableHeight(View, int, boolean)
Bug: 24394572
Change-Id: If66fa0178ed0d8c8d78e286a8b928ad88d6e90fa
2015-09-28 16:12:18 -04:00
Oren Blasberg
b8c7ef5eaf Merge "Make context menus show as popup menus." 2015-09-25 21:09:18 +00:00
Oren Blasberg
ed3912692f Make context menus show as popup menus.
This means that right-clicking/long pressing on a view that is registered for
context menu will show the context menu as a popup menu instead.

Bug: 20016398
Change-Id: I96fea60435fff2f981d288521f490f8ff24ada15
2015-09-25 12:01:01 -07:00
Gus Prevas
efca0aa919 am 3197cd36: am 41110261: am b17d1e5e: Merge "Adds an option to override RemoteViews transition." into cw-e-dev
* commit '3197cd36fef11b1fdd59bdd341f65f9f2364ed2a':
  Adds an option to override RemoteViews transition.
2015-09-25 18:59:45 +00:00
Gus Prevas
3197cd36fe am 41110261: am b17d1e5e: Merge "Adds an option to override RemoteViews transition." into cw-e-dev
* commit '41110261bb4f9f733b579b3dc26d3d6de5642ef5':
  Adds an option to override RemoteViews transition.
2015-09-25 18:09:41 +00:00
Gus Prevas
1ed322b123 Adds an option to override RemoteViews transition.
This change adds a configuration option,
"config_overrideRemoteViewsActivityTransition", which is false by
default and true on watches.  If it's true, when a RemoteViews
is clicked, it will use a new attribute on the active window animation
style, "activityOpenRemoteViewsEnterAnimation", to determine
the entry transition to use, instead of the current hard-coded
default.

Bug: 23534750
Change-Id: I91e92804a663ab71a3e46c3430fa579b87cc7931
2015-09-25 13:10:52 -04:00
Oren Blasberg
8f3976c875 Merge "Cascading submenus: Fix a few small issues." 2015-09-24 20:59:44 +00:00
Oren Blasberg
734320d06b Cascading submenus: Fix a few small issues.
1. Open submenus now disappear instantly rather than fading out when
mouse hovers over a non-submenu item.

2. When a submenu is opened on hover, the item that was hovered now
will remain selected instead of being deselected.

3. Fix an issue where if the same chain of submenus was opened more
than once, the submenus could open in a different direction each
time. To fix, we keep track of the direction of opening along the way
and make sure to reset the preferred direction when a submenu is
closed.

Bug: 20127825
Change-Id: I99972cce4ddabe316c5148f1dd79a5d7b3e64b87
2015-09-24 13:36:15 -07:00
Alan Viverette
ed49b02abc Merge "End switch thumb animator if it's been started" 2015-09-23 20:05:35 +00:00
Alan Viverette
ee20d7799f End switch thumb animator if it's been started
Running implies that it's been started and the animation has actually
begun, which is not true if we call start() and then immediately try
to jump state.

Bug: 24273164
Change-Id: I7f8d856dbe925679dad082f1e28d8936ac2b04db
2015-09-23 14:23:21 -04:00
Alan Viverette
9477229fe8 Merge "Smooth progress bar animations" 2015-09-23 14:07:11 +00:00
Alan Viverette
a64ed3bf8c Smooth progress bar animations
Removes smooth progress bar hack from volume dialog.

Bug: 23566299
Change-Id: Iafa32538b4f92705c4c1ca2a02145c078add2532
2015-09-23 10:01:45 -04:00
Alan Viverette
7b9bfaf784 Merge "Add accessor methods for Toolbar title margins" 2015-09-17 14:07:42 +00:00
Oren Blasberg
ca33b3547c Merge "Cascading popup menus: open submenu on mouse hover." 2015-09-16 20:59:11 +00:00
Oren Blasberg
23087be779 Cascading popup menus: open submenu on mouse hover.
When the cascading feature is enabled, users can mouseover a
submenu item in a popup menu to expand and open the new submenu
(after a short timeout). Similarly, if a user mouseovers a
different menu item in the original menu, the submenu gets closed
(again, after a short timeout).

This should complete the implementation of cascading submenu
functionality.

Also fix two other issues:

(1) Update some oudated code in PopupMenu that was still opening
the submenu when a user clicks on a submenu item; this
responsibility now lives within the MenuPopupHelper's delegate
MenuPopup class, so it doesn't need to live in PopupMenu anymore.

(2) Fix an issue where icons would be force-set on a submenu when they
should not be. Instead, decide whether to show icons in a submenu
based on whether to show them in the top level menu, as intended.

Bug: 20127825
Change-Id: Ia46852c7f99436065ab4bc234de94dffc0019666
2015-09-16 13:47:03 -07:00
Alan Viverette
8de78eba5d Merge "Ensure AM/PM buttons are at least 48x48dp" 2015-09-16 19:34:22 +00:00
Alan Viverette
f86bbd04b9 Ensure AM/PM buttons are at least 48x48dp
Also cleans up imports.

Bug: 24057304
Change-Id: I95e8e7c49247bcf51aabcb656d76c0bfa0f0865c
2015-09-16 14:19:21 -04:00
Doris Liu
29a526695a Merge "Fix Spinner not restoring selection when set to GONE" 2015-09-16 16:45:12 +00:00
Alan Viverette
4db9d1b48b Add accessor methods for Toolbar title margins
Also adds missing attrs to public.xml so they can be documented, adds
attr refs to Toolbar class docs. Many accessor methods still missing,
but those can be added in subsequent CLs.

Bug: 23719889
Change-Id: I09eeef65141d4af77c8813e8fac5f89bead47597
2015-09-15 16:21:16 -04:00
Alan Viverette
92539d5c75 Avoid OOBE when AbsListView layout is out of sync with adapter
Views are not synchronized with adapter state until a layout pass
occurs, which may cause an OOBE if a list item is removed and an
accessibility node is obtained before the next layout pass.

This CL caches the item's enabled state on the bound view's layout
params, which allows us to avoid relying on the adapter to populate
accessibility nodes. It also aborts actions if the target position
is no longer valid.

Updates the documentation on AdapterView to reflect that the result
of getPositionForView() may not be synchronized with the adapter.

Bug: 23943664
Change-Id: Ic79eaa2e26bec9cd8d90fdab434271bc4f3d8a68
2015-09-14 10:49:25 -04:00
Doris Liu
b7714ae157 Fix Spinner not restoring selection when set to GONE
This CL restores the selected position when AdapterView
gets restored, rather than wait until the next measure/layout
pass to do it. After the change, even when the AdapterView
is set to GONE (i.e. no measure/layout pass), the selection
will still be kept up to date.

Bug: 23619366

Change-Id: I09a31b6e2a61ca0edf129af8fe634b83784f9167
2015-09-11 18:03:28 -07:00
Alan Viverette
f9a75e1a84 am 7914680e: am 58c483fc: am 62b94c35: Merge "Avoid OOBE when AbsListView layout is out of sync with adapter" into mnc-dr-dev
* commit '7914680e1ec319f50cb99b6c761aace56fc6e3ed':
  Avoid OOBE when AbsListView layout is out of sync with adapter
2015-09-11 23:30:34 +00:00
Oren Blasberg
96b22a98ce Merge "Add Cascading submenus implementation." 2015-09-10 16:58:01 +00:00
Oren Blasberg
8e12f8df07 Add Cascading submenus implementation.
This change adds a new Cascading implementation of MenuPopup. When
enabled, submenus will show up in a cascading side by side fashion
when opened next to popup menus.

Bug: 20127825
Change-Id: Ie3c797fb5dbada7521cd93dc4171950af2be2ff7
2015-09-10 09:54:17 -07:00
Alan Viverette
a84dda54e4 Avoid OOBE when AbsListView layout is out of sync with adapter
Views are not synchronized with adapter state until a layout pass
occurs, which may cause an OOBE if a list item is removed and an
accessibility node is obtained before the next layout pass.

This CL caches the item's enabled state on the bound view's layout
params, which allows us to avoid relying on the adapter to populate
accessibility nodes. It also aborts actions if the target position
is no longer valid.

Updates the documentation on AdapterView to reflect that the result
of getPositionForView() may not be synchronized with the adapter.

Bug: 23943664
Change-Id: I90ca946bead1d87a179eab1c2f482a54bcce9c38
2015-09-10 15:17:11 +00:00
Alan Viverette
ad0020f807 Invalidate when Drawable.setState() returns true
Ensures views that manage drawables follow the contract set forth in
the Drawable.setState() documentation.

Bug: 23792020
Change-Id: I4e5a449cd6535487873fd8443da50555c38e8ed9
2015-09-04 10:10:42 -04:00
Oren Blasberg
b23976efdd MenuPopupHelper: Factor out a MenuPopup interface.
Move much of the responsibility into implementations of this interface.
Delegate functionality to it where appropriate.
Provide a standard (non-cascading) implementation for this interface.

This CL should have NO BEHAVIOR CHANGES.

A follow-up CL will provide a cascading implementation, whereby a
config variable will enable submenus to open side by side with their
parent menus. That CL will be the first with functional/ actual behavior
changes.

Bug: 20127825
Change-Id: Iecac2d340dd8750ebe4e99162d447c9411f09227
2015-09-02 11:52:24 -07:00
Roozbeh Pournader
008d6d034e Merge "Add LocaleList support to Paint and TextView." 2015-09-01 21:14:11 +00:00
Roozbeh Pournader
a23748a9ff Add LocaleList support to Paint and TextView.
This keeps the existing single-locale APIs working (and adds
parameter annotations to them), while adding an API for setting and
getting the whole locale list.  At the moment, the implementation
ignores the actual data in the locale list except for its primary
locale.

Also add a method to LocaleList to return the system's default locale
list. (Currently a one-member list just containing the system
default locale.)

Change-Id: Icea9d164ddae51f50dd71e18b5d91c96f233b8b8
2015-09-01 14:12:40 -07:00
Oren Blasberg
6b49d30034 Merge "Pull out widget helpers into their own classes." 2015-09-01 21:11:04 +00:00
Oren Blasberg
f44d90b5c2 Pull out widget helpers into their own classes.
This is in service of desktop-style submenus. Follow up CLs will make
use of the newly independent classes. MOST of the changes in this CL
are simply moving code from one place to another. Below are
descriptions of the new files added:

DropDownListView:
Decouple this from ListPopupWindow, so other "menu popup"
implementations [forthcoming] may make use of it.
This class is UNCHANGED except for the addition of the
setListSelectionHidden method.

ForwardingListener:
Decouple this from ListPopupWindow, so that other clients of this
listener can expect a more general ShowableListMenu rather than a
concrete ListPopupWindow.  This will be useful later when we want to
use something other than ListPopupWindow to show a menu.
This class is UNCHANGED, except for (1) using the getListView() on
popup rather than accessing its mDropDownList member, and (2)
replacing ListPopupWindow return values with ShowableListMenu.

MenuAdapter:
Decouple from MenuPopupHelper so it may be used by forthcoming "menu
popup" implementations rather than just by MenuPopupHelper itself.
This class is UNCHANGED.

ShowableListMenu:
A new interface to encapsulate a menu that can be shown or hidden.
This will be implemented by both ListPopupWindow and a forthcoming
"menu popup" class.

Bug: 20127825
Change-Id: I565b444d25e966ff8b8c6ceac7be8de56a9116df
2015-08-31 14:29:34 -07:00
Deepanshu Gupta
88db51084b Merge "Switch SimpleDateFormat to icu version" 2015-08-28 15:54:11 +00:00
Alan Viverette
798253e190 Expose password text to accessibility services, if requested
Otherwise, exposes the hint or the result of whatever transformation
method is set. This is consistent with what is displayed visually.

Bug: 23568127
Change-Id: Ib5c7fe78fb3b58feb36f0314638345bd40e401ab
2015-08-27 14:53:48 -04:00
Alan Viverette
bd1d652f37 am 8d8c53df: am 76c73ae4: am 12874d2d: am b9b57225: am 95137857: Merge "Avoid NPE when getPositionForView() is called on detached view" into mnc-dev
* commit '8d8c53df26ac29fa3c6df782eb49e8d50683a1dd':
  Avoid NPE when getPositionForView() is called on detached view
2015-08-26 21:23:45 +00:00
Alan Viverette
8d8c53df26 am 76c73ae4: am 12874d2d: am b9b57225: am 95137857: Merge "Avoid NPE when getPositionForView() is called on detached view" into mnc-dev
* commit '76c73ae495fe9bad5ed51b96cd8e509dbb8de46f':
  Avoid NPE when getPositionForView() is called on detached view
2015-08-26 21:13:04 +00:00
Seigo Nonaka
2041ffb8b5 Merge "Introduce simple SuggestionsPopupWindowTest." 2015-08-26 21:06:58 +00:00
Alan Viverette
898c7045e0 Avoid NPE when getPositionForView() is called on detached view
Bug: 23557674
Change-Id: I76cb5f06081b2ac4c8f535df8d1a0aee17d2bb20
2015-08-26 15:22:09 -04:00
Alan Viverette
40e1df34a9 Correctly distribute weight to pre-measured zero-dimension views
Previously, the measurements obtained from LinearLayout when using
EXACTLY and AT_MOST modes would be different even if the resulting
height was the same. This was the result of non-EXACTLY measurement
accounting for the size of zero-dimension views and then redistrib-
uting space as though they had initally been set as AT_MOST, whereas
EXACTLY would always redistribute space as though they had initially
been set as zero-dimension.

Makes perfect sense, right?

This CL updates non-EXACTLY measurement to always calculate the
minimum dimensions requested by zero-dimension views, but then to
redistribute the space according to weight.

Bug: 22810327
Change-Id: Iba8a3d26f2724e5fa9a30457119b4564eb285edb
2015-08-25 16:50:27 -04:00
Alan Viverette
e188fcc283 Merge "Pass Resources when loading ImageView source from stream" 2015-08-25 17:50:29 +00:00
Alan Viverette
8c0a4d0f8b Merge "Clean up ImageView" 2015-08-25 17:40:02 +00:00
Alan Viverette
270a34280e Pass Resources when loading ImageView source from stream
Only targets >M since developers may have already had workarounds in
place or been relying on the incorrect behavior.

Bug: 23383805
Change-Id: Ifa69b204b10b8084cf6486e41d5393969e197826
2015-08-25 13:25:16 -04:00
Alan Viverette
6aa92d1cfa Clean up ImageView
Refactors ImageView to use LOG_TAG constant, fixes indentation, trailing
whitespace, uses of final. No functional changes.

Change-Id: I9e67d9a152e1c6d646719afa5010c45868db9c6f
2015-08-25 13:19:25 -04:00
Alan Viverette
53b165ea54 Hide SearchView icon when no drawable set
Bug: 23511899
Change-Id: Ic2a4622f905779fc713482c60706c727274f9be5
2015-08-25 12:33:01 -04:00
Seigo Nonaka
a60160b30b Introduce simple SuggestionsPopupWindowTest.
This CL introduces very simple test case for SuggestionPopupWindow.
I'm going to introduce more test cases for complex scenario once this
approach is accepted, e.g. multiple suggestion span and misspelled flag.

This CL is a part of groundwork for Bug 15347319 and no user visible
change is intended with this CL.

Bug: 15347319
Change-Id: Idf166cbecb3e33be213e4104cf1afd827906f2ad
2015-08-20 12:03:20 -07:00
Seigo Nonaka
bffbd3090a Reduce the number of TextAppearanceSpan objects for highlighting.
This CL removes unnecessary TextAppearanceSpan objects creation.

The hightlight text appearance of all suggestion items in popup window
are the same, so it is not make much sense to create TextAppearanceSpan
objects for each suggestion item.

This CL is a part of groundwork for Bug 15347319 and no user visible
change is intended with this CL.

Bug: 15347319
Change-Id: Ibad2e9842a76611a34187a3c942bae4ff7ea355f
2015-08-19 01:53:55 +00:00