Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20d682f9 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

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
parent 5b2e2109
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -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 +