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

Commit 5edf9e29 authored by Tony Wickham's avatar Tony Wickham
Browse files

Update vertical drag handle (all apps arrow)

- Change drawable to match specs, using ShadowDrawable to
  add shadow when necessary based on workspace theme.
- New drawable is 18dp by 6dp; add support for different
  width vs height, and decouple from workspace page
  indicator (which is still 24dp tall).

Bug: 151768994
Change-Id: Icfd0eac197ebc4d1f5bb799f8538c4bd99d800cd
parent 6a2586db
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -66,9 +66,6 @@
       docked_stack_divider_thickness - 2 * docked_stack_divider_insets -->
    <dimen name="multi_window_task_divider_size">10dp</dimen>

    <!-- same as vertical_drag_handle_size -->
    <dimen name="shelf_surface_offset">24dp</dimen>

    <!-- Assistant Gestures -->
    <!-- Distance from the vertical edges of the screen in which assist gestures are recognized -->
    <dimen name="gestures_assistant_width">48dp</dimen>
+1 −4
Original line number Diff line number Diff line
@@ -33,9 +33,6 @@ import com.android.quickstep.SysUINavigationMode;

import java.lang.annotation.Retention;

import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
import static java.lang.annotation.RetentionPolicy.SOURCE;

public class LayoutUtils {

    private static final int MULTI_WINDOW_STRATEGY_HALF_SCREEN = 1;
@@ -68,7 +65,7 @@ public class LayoutUtils {
                // UI when shown.
                extraSpace = 0;
            } else {
                extraSpace = getDefaultSwipeHeight(context, dp) + dp.verticalDragHandleSizePx
                extraSpace = getDefaultSwipeHeight(context, dp) + dp.workspacePageIndicatorHeight
                        + res.getDimensionPixelSize(
                                R.dimen.dynamic_grid_hotseat_extra_vertical_size)
                        + res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_bottom_padding);
+11 −9
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ public class ShelfScrimView extends ScrimView<BaseQuickstepLauncher>

    private float mShiftRange;

    private final float mShelfOffset;
    private float mTopOffset;
    private float mShelfTop;
    private float mShelfTopAtThreshold;
@@ -110,7 +109,6 @@ public class ShelfScrimView extends ScrimView<BaseQuickstepLauncher>
        mRadius = BOTTOM_CORNER_RADIUS_RATIO * Themes.getDialogCornerRadius(context);
        mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);

        mShelfOffset = context.getResources().getDimension(R.dimen.shelf_surface_offset);
        // Just assume the easiest UI for now, until we have the proper layout information.
        mDrawingFlatColor = true;
    }
@@ -179,7 +177,7 @@ public class ShelfScrimView extends ScrimView<BaseQuickstepLauncher>
                        Math.min(hotseatSize, LayoutUtils.getDefaultSwipeHeight(context, dp));
                mDragHandleProgress =  1 - (dragHandleTop / mShiftRange);
            }
            mTopOffset = dp.getInsets().top - mShelfOffset;
            mTopOffset = dp.getInsets().top - mDragHandleSize.y;
            mShelfTopAtThreshold = mShiftRange * SCRIM_CATCHUP_THRESHOLD + mTopOffset;
        }
        updateColors();
@@ -190,12 +188,15 @@ public class ShelfScrimView extends ScrimView<BaseQuickstepLauncher>
    @Override
    public void updateColors() {
        super.updateColors();
        if (mDrawingFlatColor) {
        mDragHandleOffset = 0;
        if (mDrawingFlatColor) {
            return;
        }

        mDragHandleOffset = mShelfOffset - mDragHandleSize;
        if (mProgress < mDragHandleProgress) {
            mDragHandleOffset = mShiftRange * (mDragHandleProgress - mProgress);
        }

        if (mProgress >= SCRIM_CATCHUP_THRESHOLD) {
            mShelfTop = mShiftRange * mProgress + mTopOffset;
        } else {
@@ -231,10 +232,6 @@ public class ShelfScrimView extends ScrimView<BaseQuickstepLauncher>
                            (float) 0, LINEAR));
            mRemainingScreenColor = setColorAlphaBound(mScrimColor, remainingScrimAlpha);
        }

        if (mProgress < mDragHandleProgress) {
            mDragHandleOffset += mShiftRange * (mDragHandleProgress - mProgress);
        }
    }

    @Override
@@ -290,4 +287,9 @@ public class ShelfScrimView extends ScrimView<BaseQuickstepLauncher>
        mPaint.setColor(mShelfColor);
        canvas.drawRoundRect(0, mShelfTop, width, height + mRadius, mRadius, mRadius, mPaint);
    }

    @Override
    public float getVisualTop() {
        return mShelfTop;
    }
}
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2020 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.android.launcher3.graphics.ShadowDrawable
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/drag_handle_indicator_no_shadow"
    android:elevation="@dimen/vertical_drag_handle_elevation" />
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project
<!-- Copyright (C) 2020 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -15,26 +15,15 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="@dimen/vertical_drag_handle_size"
    android:height="@dimen/vertical_drag_handle_size"
    android:viewportWidth="36.0"
    android:viewportHeight="36.0" >
    android:width="@dimen/vertical_drag_handle_width"
    android:height="@dimen/vertical_drag_handle_height"
    android:viewportWidth="18.0"
    android:viewportHeight="6.0"
    android:tint="?attr/workspaceTextColor" >

    <group
        android:translateX="11.5"
        android:translateY="11.5">
    <path
            android:pathData="M2 8.5L6.5 4L11 8.5"
            android:strokeColor="?attr/workspaceAmbientShadowColor"
            android:strokeWidth="3.6"
            android:strokeLineCap="round"
            android:strokeLineJoin="round" />

        <path
            android:pathData="M2 8.5L6.5 4L11 8.5"
            android:strokeColor="?attr/workspaceTextColor"
            android:strokeWidth="1.8"
            android:strokeLineCap="round"
            android:strokeLineJoin="round" />
        </group>
        android:pathData="M17,6c-0.15,0-0.3-0.03-0.45-0.11L9,2.12L1.45,5.89c-0.5,0.25-1.09,
        0.05-1.34-0.45S0.06,4.35,0.55,4.11l8-4c0.28-0.14,0.61-0.14,0.89,0l8,4c0.49,0.25,0.69,
        0.85,0.45,1.34C17.72,5.8,17.37,6,17,6z"
        android:fillColor="@android:color/white" />
</vector>
Loading