summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteFragment.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java
index beeb320dd..84bd4b484 100644
--- a/src/com/android/dialer/list/PhoneFavoriteFragment.java
+++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java
@@ -454,7 +454,31 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen
child.animate().alpha(1.0f)
.setDuration(mAnimationDuration)
.start();
- break;
+ } else {
+ Integer startTop = mItemIdTopMap.get(itemId);
+ final int top = child.getTop();
+ if (DEBUG) {
+ Log.d(TAG, "Found itemId: " + itemId + " for listview child " + i +
+ " Top: " + top);
+ }
+ int delta = 0;
+ if (startTop != null) {
+ if (startTop != top) {
+ delta = startTop - top;
+ }
+ } else if (!mItemIdLeftMap.containsKey(itemId)) {
+ // Animate new views along with the others. The catch is that they did
+ // not exist in the start state, so we must calculate their starting
+ // position based on neighboring views.
+ int childHeight = child.getHeight() + mListView.getDividerHeight();
+ startTop = top + (i > 0 ? childHeight : -childHeight);
+ delta = startTop - top;
+ }
+
+ if (delta != 0) {
+ child.setTranslationY(delta);
+ child.animate().setDuration(mAnimationDuration).translationY(0);
+ }
}
}
mItemIdTopMap.clear();