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

Commit f5925095 authored by Mindy Pereira's avatar Mindy Pereira
Browse files

Please bring back the nice swipe to dismiss animation.

Change-Id: I81efbe3026303c1ef0afb6534734891da74aa4e6
parent f3bee6a8
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -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();