From 20d682f9a586da495f180bfb6a445520d027c74d Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 19 Sep 2013 14:58:13 -0700 Subject: 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 --- src/com/android/dialer/list/PhoneFavoriteFragment.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') 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 + -- cgit v1.2.3