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

Commit 83d40e06 authored by Mario Bertschler's avatar Mario Bertschler Committed by Android (Google) Code Review
Browse files

Merge "Fixes a bug where the user ends in freescroll state even for regular...

Merge "Fixes a bug where the user ends in freescroll state even for regular workspace mode." into ub-launcher3-master
parents 8ad02b8f dcc26fc6
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -1370,8 +1370,12 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        dampedOverScroll(amount);
    }

    public void enableFreeScroll() {
    /**
     * return true if freescroll has been enabled, false otherwise
     */
    public boolean enableFreeScroll() {
        setEnableFreeScroll(true);
        return true;
    }

    public void disableFreeScroll() {
@@ -2072,20 +2076,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        if (!mReorderingStarted) return;
        mReorderingStarted = false;

        // If we haven't flung-to-delete the current child, then we just animate the drag view
        // back into position
        final Runnable onCompleteRunnable = new Runnable() {
            @Override
        mPostReorderingPreZoomInRunnable = new Runnable() {
            public void run() {
                // If we haven't flung-to-delete the current child,
                // then we just animate the drag view back into position
                onEndReordering();
            }
        };

        mPostReorderingPreZoomInRunnable = new Runnable() {
            public void run() {
                onCompleteRunnable.run();
                enableFreeScroll();
            };
            }
        };

        mPostReorderingPreZoomInRemainingAnimationCount =
+10 −0
Original line number Diff line number Diff line
@@ -4103,6 +4103,16 @@ public class Workspace extends PagedView
        }
    }

    @Override
    public boolean enableFreeScroll() {
        if (getState() == State.OVERVIEW) {
            return super.enableFreeScroll();
        } else {
            Log.w(TAG, "enableFreeScroll called but not in overview: state=" + getState());
            return false;
        }
    }

    /**
     * Used as a workaround to ensure that the AppWidgetService receives the
     * PACKAGE_ADDED broadcast before updating widgets.