OSDN Git Service

Add animation and positional stability to intent chooser UI
authorAdam Powell <adamp@google.com>
Mon, 28 Sep 2015 17:45:00 +0000 (10:45 -0700)
committerAdam Powell <adamp@google.com>
Fri, 2 Oct 2015 19:37:29 +0000 (19:37 +0000)
commit63b31698452dbc36f6258c980d7a731518bfd6a0
tree75fa87f1cdfbecdc3de2bf78de58cc8e4904a6ed
parent4d2a3e2ebddbf54bde934c33cb524877dce51262
Add animation and positional stability to intent chooser UI

Dejank the process of bringing in new ChooserTargets from queried
services. Animate the service target rows in upward so that if the
user's finger is already headed for a visible choice we don't inject
something wrong right under them at the last second. Keep things sane
if the user is dragging the UI while we're bringing in new items.

To animate this, since we can't use RecyclerView from the framework we
treat the height of rows as a conceptual data set change for
ListView. To get away with doing this per-frame we pre-measure the
item height (which remains constant) instead of doing more expensive
wrap_content calculations. ResolverDrawerLayout is now aware of how to
account for a cheat-measured ListView to compensate.

Bug 24038066

Change-Id: I01414a5746815255ff948a6d0887bb5ad0897285
core/java/com/android/internal/app/ChooserActivity.java
core/java/com/android/internal/app/ResolverActivity.java
core/java/com/android/internal/widget/ResolverDrawerLayout.java
core/res/res/layout/chooser_grid.xml
core/res/res/layout/resolve_grid_item.xml