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

Commit cb329352 authored by Abhilasha Chahal's avatar Abhilasha Chahal
Browse files

Allow overriding DragController and drag use cases

Test: Manually verified Launcher3 works fine
Bug: 233864888
Change-Id: Ifb2fe19c0a2b332862b36b1ac0100e0f5301a5a6
parent 24d7de43
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -305,7 +305,6 @@ public class Launcher extends StatefulActivity<LauncherState>
    Workspace<?> mWorkspace;
    @Thunk
    DragLayer mDragLayer;
    private DragController mDragController;

    private WidgetManagerHelper mAppWidgetManager;
    private LauncherAppWidgetHost mAppWidgetHost;
@@ -369,6 +368,7 @@ public class Launcher extends StatefulActivity<LauncherState>
    private RotationHelper mRotationHelper;

    protected LauncherOverlayManager mOverlayManager;
    protected DragController mDragController;
    // If true, overlay callbacks are deferred
    private boolean mDeferOverlayCallbacks;
    private final Runnable mDeferredOverlayCallbacks = this::checkIfOverlayStillDeferred;
@@ -465,7 +465,7 @@ public class Launcher extends StatefulActivity<LauncherState>
        mIconCache = app.getIconCache();
        mAccessibilityDelegate = createAccessibilityDelegate();

        mDragController = new LauncherDragController(this);
        initDragController();
        mAllAppsController = new AllAppsTransitionController(this);
        mStateManager = new StateManager<>(this, NORMAL);

@@ -614,6 +614,13 @@ public class Launcher extends StatefulActivity<LauncherState>
        super.onConfigurationChanged(newConfig);
    }

    /**
     * Initializes the drag controller.
     */
    protected void initDragController() {
        mDragController = new LauncherDragController(this);
    }

    @Override
    public void onIdpChanged(boolean modelPropertiesChanged) {
        initDeviceProfile(mDeviceProfile.inv);
+2 −2
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
    private LayoutTransition mLayoutTransition;
    @Thunk final WallpaperManager mWallpaperManager;

    private ShortcutAndWidgetContainer mDragSourceInternal;
    protected ShortcutAndWidgetContainer mDragSourceInternal;

    @Thunk final IntSparseArrayMap<CellLayout> mWorkspaceScreens = new IntSparseArrayMap<>();
    @Thunk final IntArray mScreenOrder = new IntArray();
@@ -195,7 +195,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
    @Thunk final Launcher mLauncher;
    @Thunk DragController mDragController;

    private final int[] mTempXY = new int[2];
    protected final int[] mTempXY = new int[2];
    private final float[] mTempFXY = new float[2];
    private final Rect mTempRect = new Rect();
    @Thunk float[] mDragViewVisualCenter = new float[2];