diff options
author | Hongwei Wang <hwwang@google.com> | 2013-09-19 14:58:13 -0700 |
---|---|---|
committer | Hongwei Wang <hwwang@google.com> | 2013-09-19 14:58:13 -0700 |
commit | 20d682f9a586da495f180bfb6a445520d027c74d (patch) | |
tree | a39eff0703c0cb920482024e82379e40beb0e22d | |
parent | 5b2e21098d84e94fd629e5e07c3bbb66bf9b5d95 (diff) |
Tweak the animation for Drag and Drop. Finale
Bug: 10686781
- Fade in when an entry is pushed down from square tiles to list items
area
- Translation when fling
Change-Id: Id2f220bae0b8151ad6e3690dc74f13d1c597fae1
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteFragment.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java index 9e8476062..d731786a5 100644 --- a/src/com/android/dialer/list/PhoneFavoriteFragment.java +++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java @@ -143,7 +143,6 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen @Override public void onScrollStateChanged(AbsListView view, int scrollState) { mActivityScrollListener.onListFragmentScrollStateChange(scrollState); - mLastScrollState = scrollState; } } @@ -186,8 +185,6 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen new ContactTileLoaderListener(); private final ScrollListener mScrollListener = new ScrollListener(); - private int mLastScrollState = ListView.OnScrollListener.SCROLL_STATE_IDLE; - @Override public void onAttach(Activity activity) { if (DEBUG) Log.d(TAG, "onAttach()"); @@ -453,8 +450,7 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen * animations will be performed instead. */ private void animateListView(final long... idsInPlace) { - if (mItemIdTopMap.isEmpty() || - mLastScrollState == ListView.OnScrollListener.SCROLL_STATE_FLING) { + if (mItemIdTopMap.isEmpty()) { // Don't do animations if the database is being queried for the first time and // the previous item offsets have not been cached, or the user hasn't done anything // (dragging, swiping etc) that requires an animation. @@ -501,10 +497,10 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen startTop = top + (i > 0 ? childHeight : -childHeight); delta = startTop - top; } else { - // In the case the first non-square row is pushed down + // In case the first non-square row is pushed down // from the square section. animators.add(ObjectAnimator.ofFloat( - child, "translationX", -child.getWidth(), 0.0f)); + child, "alpha", 0.0f, 1.0f)); } if (DEBUG) { Log.d(TAG, "Found itemId: " + itemId + " for listview child " + i + |