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

Commit eb269053 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove unecessary uses of LauncherActivityInterface.INSTANCE" into main

parents b41def03 5945b311
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -50,9 +50,11 @@ public class BackgroundAppState extends OverviewState {
            return super.getVerticalProgress(launcher);
        }
        RecentsView recentsView = launcher.getOverviewPanel();
        int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher,
        int transitionLength = LayoutUtils.getShelfTrackingDistance(
                launcher,
                launcher.getDeviceProfile(),
                recentsView.getPagedOrientationHandler());
                recentsView.getPagedOrientationHandler(),
                recentsView.getSizeStrategy());
        AllAppsTransitionController controller = launcher.getAllAppsController();
        float scrollRange = Math.max(controller.getShiftRange(), 1);
        float progressDelta = (transitionLength / scrollRange);
+4 −1
Original line number Diff line number Diff line
@@ -129,7 +129,10 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
        mRecentsView = mLauncher.getOverviewPanel();
        mXRange = mLauncher.getDeviceProfile().widthPx / 2f;
        mYRange = LayoutUtils.getShelfTrackingDistance(
            mLauncher, mLauncher.getDeviceProfile(), mRecentsView.getPagedOrientationHandler());
                mLauncher,
                mLauncher.getDeviceProfile(),
                mRecentsView.getPagedOrientationHandler(),
                mRecentsView.getSizeStrategy());
        mMaxYProgress = mLauncher.getDeviceProfile().heightPx / mYRange;
        mMotionPauseDetector = new MotionPauseDetector(mLauncher);
        mMotionPauseMinDisplacement = mLauncher.getResources().getDimension(
+5 −2
Original line number Diff line number Diff line
@@ -142,8 +142,11 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
                    .createPlaybackController();
            mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation);
            RecentsView recentsView = mLauncher.getOverviewPanel();
            totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher,
                    mLauncher.getDeviceProfile(), recentsView.getPagedOrientationHandler());
            totalShift = LayoutUtils.getShelfTrackingDistance(
                    mLauncher,
                    mLauncher.getDeviceProfile(),
                    recentsView.getPagedOrientationHandler(),
                    recentsView.getSizeStrategy());
        } else {
            mCurrentAnimation = mLauncher.getStateManager()
                    .createAnimationToNewWorkspace(mToState, config);
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ public final class LauncherActivityInterface extends
                && DisplayController.getNavigationMode(context) != NavigationMode.NO_BUTTON) {
            return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right);
        } else {
            return LayoutUtils.getShelfTrackingDistance(context, dp, orientationHandler);
            return LayoutUtils.getShelfTrackingDistance(context, dp, orientationHandler, this);
        }
    }

+7 −4
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.view.ViewGroup;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.NavigationMode;
import com.android.quickstep.LauncherActivityInterface;
import com.android.quickstep.BaseContainerInterface;
import com.android.quickstep.orientation.RecentsPagedOrientationHandler;

public class LayoutUtils {
@@ -41,11 +41,14 @@ public class LayoutUtils {
        return swipeHeight;
    }

    public static int getShelfTrackingDistance(Context context, DeviceProfile dp,
            RecentsPagedOrientationHandler orientationHandler) {
    public static int getShelfTrackingDistance(
            Context context,
            DeviceProfile dp,
            RecentsPagedOrientationHandler orientationHandler,
            BaseContainerInterface<?, ?> baseContainerInterface) {
        // Track the bottom of the window.
        Rect taskSize = new Rect();
        LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize,
        baseContainerInterface.calculateTaskSize(context, dp, taskSize,
                orientationHandler);
        return orientationHandler.getDistanceToBottomOfRect(dp, taskSize);
    }