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

Commit dc1d4f1a authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Make shade transparent under a flag

Shade can now look like what we had on R, where QS has a solid
brackground and scrims are transparent.

Test: atest QSFragmentTest ScrimControllerTest
Test: manual
Bug: 171916625
Change-Id: If85b3993c1e11d4ad9555e8161d5e3fab4b91749
parent 36df85a2
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ 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.
  -->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
    <shape>
        <solid android:color="?android:attr/colorBackground"/>
        <corners android:radius="@dimen/notification_corner_radius" />
    </shape>
</inset>
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@
    <View
        android:id="@+id/quick_settings_background"
        android:layout_width="match_parent"
        android:layout_height="0dp" />
        android:layout_height="0dp"
        android:background="@drawable/qs_background_primary" />

    <com.android.systemui.qs.NonInterceptingScrollView
        android:id="@+id/expanded_qs_scroll_view"
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

    <bool name="flag_notification_pipeline2">false</bool>
    <bool name="flag_notification_pipeline2_rendering">false</bool>
    <bool name="flag_shade_is_opaque">true</bool>

    <!-- b/171917882 -->
    <bool name="flag_notification_twocolumn">false</bool>
+14 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ public class QSContainerImpl extends FrameLayout {

    private int mSideMargins;
    private boolean mQsDisabled;
    private boolean mBackgroundVisible;
    private int mContentPadding = -1;
    private boolean mAnimateBottomOnNextLayout;

@@ -122,6 +123,14 @@ public class QSContainerImpl extends FrameLayout {
        return true;
    }

    /**
     * If QS should have a solid or transparent background.
     */
    public void setBackgroundVisible(boolean visible) {
        mBackgroundVisible = visible;
        updateBackgroundVisibility();
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        // QSPanel will show as many rows as it can (up to TileLayout.MAX_ROWS) such that the
@@ -174,7 +183,11 @@ public class QSContainerImpl extends FrameLayout {
        final boolean disabled = (state2 & DISABLE2_QUICK_SETTINGS) != 0;
        if (disabled == mQsDisabled) return;
        mQsDisabled = disabled;
        mBackground.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
        updateBackgroundVisibility();
    }

    private void updateBackgroundVisibility() {
        mBackground.setVisibility(mQsDisabled || !mBackgroundVisible ? GONE : VISIBLE);
    }

    void updateResources(QSPanelController qsPanelController,
+5 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.qs.customize.QSCustomizerController;
import com.android.systemui.qs.dagger.QSFragmentComponent;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
@@ -105,6 +106,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    private QSPanelController mQSPanelController;
    private QuickQSPanelController mQuickQSPanelController;
    private QSCustomizerController mQSCustomizerController;
    private FeatureFlags mFeatureFlags;

    @Inject
    public QSFragment(RemoteInputQuickSettingsDisabler remoteInputQsDisabler,
@@ -112,7 +114,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
            StatusBarStateController statusBarStateController, CommandQueue commandQueue,
            QSDetailDisplayer qsDetailDisplayer, @Named(QS_PANEL) MediaHost qsMediaHost,
            @Named(QUICK_QS_PANEL) MediaHost qqsMediaHost,
            QSFragmentComponent.Factory qsComponentFactory) {
            QSFragmentComponent.Factory qsComponentFactory, FeatureFlags featureFlags) {
        mRemoteInputQuickSettingsDisabler = remoteInputQsDisabler;
        mInjectionInflater = injectionInflater;
        mCommandQueue = commandQueue;
@@ -122,6 +124,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
        mQsComponentFactory = qsComponentFactory;
        commandQueue.observe(getLifecycle(), this);
        mHost = qsTileHost;
        mFeatureFlags = featureFlags;
        mStatusBarStateController = statusBarStateController;
    }

@@ -163,6 +166,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
        mQSContainerImplController = qsFragmentComponent.getQSContainerImplController();
        mQSContainerImplController.init();
        mContainer = mQSContainerImplController.getView();
        mContainer.setBackgroundVisible(!mFeatureFlags.isShadeOpaque());

        mQSDetail.setQsPanel(mQSPanelController, mHeader, mFooter);
        mQSAnimator = qsFragmentComponent.getQSAnimator();
Loading