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

Commit 1da1eead authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Remove split shade drag handle

QS is now always expanded, so there's no need for the handle anymore.

Test: manual
Bug: 204450723
Change-Id: I82bcc55172193e160865e017ad8c7609a1d26dd0
parent 60e51c5c
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2021 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
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="36dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <path
        android:fillColor="?android:attr/textColorPrimary"
        android:pathData="M5.41,7.59L4,9l8,8 8,-8 -1.41,-1.41L12,14.17" />
</vector>
+0 −13
Original line number Diff line number Diff line
@@ -56,17 +56,4 @@
        layout="@layout/qs_customize_panel"
        android:visibility="gone" />

    <ImageView
        android:id="@+id/qs_drag_handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="24dp"
        android:elevation="4dp"
        android:importantForAccessibility="no"
        android:scaleType="center"
        android:src="@drawable/ic_qs_drag_handle"
        android:tint="@color/qs_detail_button_white"
        tools:ignore="UseAppTint" />

</com.android.systemui.qs.QSContainerImpl>
+1 −15
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import android.graphics.PointF;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.android.systemui.Dumpable;
import com.android.systemui.R;
@@ -53,7 +52,6 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
    private float mQsExpansion;
    private QSCustomizer mQSCustomizer;
    private NonInterceptingScrollView mQSPanelContainer;
    private ImageView mDragHandle;

    private int mSideMargins;
    private boolean mQsDisabled;
@@ -71,7 +69,6 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
        mQSDetail = findViewById(R.id.qs_detail);
        mHeader = findViewById(R.id.header);
        mQSCustomizer = findViewById(R.id.qs_customize);
        mDragHandle = findViewById(R.id.qs_drag_handle);
        setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
    }

@@ -190,23 +187,14 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
        mQSDetail.setBottom(getTop() + scrollBottom);
        int qsDetailBottomMargin = ((MarginLayoutParams) mQSDetail.getLayoutParams()).bottomMargin;
        mQSDetail.setBottom(getTop() + scrollBottom - qsDetailBottomMargin);
        // Pin the drag handle to the bottom of the panel.
        mDragHandle.setTranslationY(scrollBottom - mDragHandle.getHeight());
    }

    protected int calculateContainerHeight() {
        int heightOverride = mHeightOverride != -1 ? mHeightOverride : getMeasuredHeight();
        // Need to add the dragHandle height so touches will be intercepted by it.
        int dragHandleHeight;
        if (mDragHandle.getVisibility() == VISIBLE) {
            dragHandleHeight = Math.round((1 - mQsExpansion) * mDragHandle.getHeight());
        } else {
            dragHandleHeight = 0;
        }
        return mQSCustomizer.isCustomizing() ? mQSCustomizer.getHeight()
                : Math.round(mQsExpansion * (heightOverride - mHeader.getHeight()))
                + mHeader.getHeight()
                + dragHandleHeight;
                + mHeader.getHeight();
    }

    int calculateContainerBottom() {
@@ -221,8 +209,6 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
    public void setExpansion(float expansion) {
        mQsExpansion = expansion;
        mQSPanelContainer.setScrollingEnabled(expansion > 0f);
        mDragHandle.setAlpha(1.0f - expansion);
        mDragHandle.setClickable(expansion == 0f); // Only clickable when fully collapsed
        updateExpansion();
    }

+0 −13
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageView;

import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
@@ -94,7 +93,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    private float mLastPanelFraction;
    private float mSquishinessFraction = 1;
    private boolean mQsDisabled;
    private ImageView mQsDragHandler;

    private final RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler;
    private final CommandQueue mCommandQueue;
@@ -205,7 +203,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
        mHeader = view.findViewById(R.id.header);
        mQSPanelController.setHeaderContainer(view.findViewById(R.id.header_text_container));
        mFooter = qsFragmentComponent.getQSFooter();
        mQsDragHandler = view.findViewById(R.id.qs_drag_handle);

        mQsDetailDisplayer.setQsPanelController(mQSPanelController);

@@ -249,11 +246,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
                    mQSPanelController.getMediaHost().getHostView().setAlpha(1.0f);
                    mQSAnimator.requestAnimatorUpdate();
                });

        mQsDragHandler.setOnClickListener(v -> {
            Log.d(TAG, "drag handler clicked");
            mCommandQueue.animateExpandSettingsPanel(null);
        });
    }

    @Override
@@ -404,11 +396,6 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
                || (mQsExpanded && !mStackScrollerOverscrolling));
        mQSPanelController.setVisibility(
                !mQsDisabled && expandVisually ? View.VISIBLE : View.INVISIBLE);
        mQsDragHandler.setVisibility((mQsExpanded || !keyguardShowing || mHeaderAnimating
                || mShowCollapsedOnKeyguard)
                && Utils.shouldUseSplitNotificationShade(getResources())
                ? View.VISIBLE
                : View.GONE);
    }

    private boolean isKeyguardState() {