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

Commit c18b2e50 authored by Adam Cohen's avatar Adam Cohen Committed by Android (Google) Code Review
Browse files

Merge "-> Fixing a bug where AdapterViewAnimator doesn't refresh correctly ->...

Merge "-> Fixing a bug where AdapterViewAnimator doesn't refresh correctly -> Reduced swipe threshold for StackView Change-Id: I0f04f45dade57f29581fe03fb195a6db5f12adb1"
parents 8fa50d4f a9238c89
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -379,11 +379,13 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
    }

    void refreshChildren() {
        if (mAdapter == null) return;
        for (int i = mCurrentWindowStart; i <= mCurrentWindowEnd; i++) {
            int index = modulo(i, mMaxNumActiveViews);
            int index = modulo(i, getWindowSize());

            int adapterCount = mAdapter.getCount();
            // get the fresh child from the adapter
            View updatedChild = mAdapter.getView(i, null, this);
            View updatedChild = mAdapter.getView(modulo(i, adapterCount), null, this);

            if (mViewsMap.containsKey(index)) {
                FrameLayout fl = (FrameLayout) mViewsMap.get(index).view;
+6 −1
Original line number Diff line number Diff line
@@ -79,7 +79,12 @@ public class StackView extends AdapterViewAnimator {
     * Specifies how far you need to swipe (up or down) before it
     * will be consider a completed gesture when you lift your finger
     */
    private static final float SWIPE_THRESHOLD_RATIO = 0.35f;
    private static final float SWIPE_THRESHOLD_RATIO = 0.2f;

    /**
     * Specifies the total distance, relative to the size of the stack,
     * that views will be slid, either up or down
     */
    private static final float SLIDE_UP_RATIO = 0.7f;

    /**