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

Commit 7e2e67fd authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding isSeascape method to have a common place to orientation check

Change-Id: Ia61792b29ab0d1d74f76a8dfa53bbf968874dfaa
parent f5aa2734
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static com.android.quickstep.TouchInteractionService.EDGE_NAV_BAR;
import android.graphics.Rect;
import android.view.MotionEvent;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.anim.SpringAnimationHandler;
import com.android.launcher3.dragndrop.DragLayer;
@@ -56,11 +57,7 @@ public class EdgeSwipeController extends VerticalSwipeController {

    @Override
    protected boolean isTransitionFlipped() {
        if (mLauncher.getDeviceProfile().isVerticalBarLayout()) {
            Rect insets = mLauncher.getDragLayer().getInsets();
            return insets.left > insets.right;
        }
        return false;
        return mLauncher.getDeviceProfile().isSeascape();
    }

    @Override
@@ -82,9 +79,10 @@ public class EdgeSwipeController extends VerticalSwipeController {
        RecentsView.getPageRect(launcher.getDeviceProfile(), launcher, sTempRect);
        DragLayer dl = launcher.getDragLayer();
        Rect insets = dl.getInsets();
        DeviceProfile dp = launcher.getDeviceProfile();

        if (launcher.getDeviceProfile().isVerticalBarLayout()) {
            if (insets.left > insets.right) {
        if (dp.isVerticalBarLayout()) {
            if (dp.isSeascape()) {
                return insets.left + sTempRect.left;
            } else {
                return dl.getWidth() - sTempRect.right + insets.right;
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ public class RecentsView extends PagedView implements Insettable {

        if (dp.isVerticalBarLayout()) {
            boolean wasScrimOnLeft = mScrimOnLeft;
            mScrimOnLeft = insets.left > insets.right;
            mScrimOnLeft = dp.isSeascape();

            if (mScrim == null || wasScrimOnLeft != mScrimOnLeft) {
                Drawable scrim = getContext().getDrawable(mScrimOnLeft
+6 −1
Original line number Diff line number Diff line
@@ -412,7 +412,7 @@ public class DeviceProfile {
            padding.bottom = edgeMarginPx;
            padding.left = hotseatBarSidePaddingPx;
            padding.right = hotseatBarSidePaddingPx;
            if (mInsets.left > mInsets.right) {
            if (isSeascape()) {
                padding.left += hotseatBarSizePx;
                padding.right += pageIndicatorSizePx;
            } else {
@@ -480,6 +480,11 @@ public class DeviceProfile {
        return isLandscape && transposeLayoutWithOrientation;
    }

    public boolean isSeascape() {
        // TODO: This might not hold true for multi window mode, use configuration insead.
        return isVerticalBarLayout() && mInsets.left > mInsets.right;
    }

    public boolean shouldFadeAdjacentWorkspaceScreens() {
        return isVerticalBarLayout() || isLargeTablet;
    }
+2 −2
Original line number Diff line number Diff line
@@ -93,8 +93,8 @@ public class DropTargetBar extends FrameLayout
        if (grid.isVerticalBarLayout()) {
            lp.width = grid.dropTargetBarSizePx;
            lp.height = grid.availableHeightPx - 2 * grid.edgeMarginPx;
            lp.gravity = insets.left > insets.right ? Gravity.RIGHT : Gravity.LEFT;
            tooltipLocation = insets.left > insets.right ? TOOLTIP_LEFT : TOOLTIP_RIGHT;
            lp.gravity = grid.isSeascape() ? Gravity.RIGHT : Gravity.LEFT;
            tooltipLocation = grid.isSeascape() ? TOOLTIP_LEFT : TOOLTIP_RIGHT;
        } else {
            int gap;
            if (grid.isTablet) {
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ public class Hotseat extends FrameLayout implements LogContainerProvider, Insett
            mContent.setGridSize(1, grid.inv.numHotseatIcons);

            lp.height = ViewGroup.LayoutParams.MATCH_PARENT;
            if (insets.left > insets.right) {
            if (grid.isSeascape()) {
                lp.gravity = Gravity.LEFT;
                lp.width = grid.hotseatBarSizePx + insets.left + grid.hotseatBarSidePaddingPx;
                getLayout().setPadding(
Loading