From c36684277aa45085999284bfe71cb8be71b3a464 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Mon, 5 Aug 2013 20:34:40 -0700 Subject: Rewrite animation logic * Remove old animation-related code. In the past, animations would be applied to a view everytime getView was called. This is no longer the case so it fixes the issue of animations triggering everytime the list was scrolled, dialpad opened, etc. * Make PhoneFavoriteMergedAdapter (and PhoneFavoritesTileAdapter) return stable IDs, so that they can be used for animations. The ID schemes are described below: (N + 1) to -2: CallLogAdapterItems, where N is equal to the number of call log items -1: All contacts button 0 to (N -1): Rows of tiled contacts, where N is equal to the max rows of tiled contacts N to infinity: Rows of regular contacts. Their item id is calculated by N + contact_id, where contact_id is guaranteed to never be negative. * Perform animations by saving each view's offset before the data set changes, and then applying a translation animation to them based on their new offsets in the updated list view. This is the same method described by the framework team at : http://graphics-geek.blogspot.com/2013/06/devbytes-animating-listview-deletion.html In our case, we need to perform both horizontal and vertical animations because of the contact tile favorites. Bug: 10294203 Change-Id: I3ea4ff9995c539267410a264dbbea5ffa02bc6e3 --- tests/src/com/android/dialer/list/PhoneFavoritesTileAdapterTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/src/com/android/dialer/list/PhoneFavoritesTileAdapterTest.java b/tests/src/com/android/dialer/list/PhoneFavoritesTileAdapterTest.java index 40d171c8c..3e3cacd07 100644 --- a/tests/src/com/android/dialer/list/PhoneFavoritesTileAdapterTest.java +++ b/tests/src/com/android/dialer/list/PhoneFavoritesTileAdapterTest.java @@ -8,7 +8,7 @@ public class PhoneFavoritesTileAdapterTest extends AndroidTestCase { @Override protected void setUp() throws Exception { super.setUp(); - mAdapter = new PhoneFavoritesTileAdapter(getContext(), null, 3, 1); + mAdapter = new PhoneFavoritesTileAdapter(getContext(), null, null, 3, 1); } /** -- cgit v1.2.3