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

Commit 40e0f1de authored by Thales Lima's avatar Thales Lima Committed by Automerger Merge Worker
Browse files

Merge "sysui: show security footer on the bottom when in split shade mode"...

Merge "sysui: show security footer on the bottom when in split shade mode" into sc-v2-dev am: 69635bde am: 7742083c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937208

Change-Id: Ia1b6239ec4fba4ae21741278796266e74a314e28
parents 9a793987 7742083c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -32,11 +32,11 @@
    -->
    -->
    <dimen name="qs_customize_header_min_height">48dp</dimen>
    <dimen name="qs_customize_header_min_height">48dp</dimen>


    <!--  In landscape the security footer is actually part of the header,
    and needs to be as short as the header  -->
    <dimen name="qs_security_footer_single_line_height">@*android:dimen/quick_qs_offset_height</dimen>
    <dimen name="qs_security_footer_single_line_height">@*android:dimen/quick_qs_offset_height</dimen>
    <dimen name="qs_footer_padding">14dp</dimen>
    <dimen name="qs_footer_padding">14dp</dimen>
    <dimen name="qs_footers_margin_bottom">0dp</dimen>
    <dimen name="qs_security_footer_background_inset">12dp</dimen>
    <dimen name="qs_security_footer_background_inset">12dp</dimen>
    <dimen name="qs_security_footer_corner_radius">28dp</dimen>


    <dimen name="battery_detail_graph_space_top">9dp</dimen>
    <dimen name="battery_detail_graph_space_top">9dp</dimen>
    <dimen name="battery_detail_graph_space_bottom">9dp</dimen>
    <dimen name="battery_detail_graph_space_bottom">9dp</dimen>
+2 −0
Original line number Original line Diff line number Diff line
@@ -38,4 +38,6 @@
    <!-- Max number of columns for quick controls area -->
    <!-- Max number of columns for quick controls area -->
    <integer name="controls_max_columns">4</integer>
    <integer name="controls_max_columns">4</integer>


    <!-- How many lines to show in the security footer -->
    <integer name="qs_security_footer_maxLines">1</integer>
</resources>
</resources>
+5 −0
Original line number Original line Diff line number Diff line
@@ -95,4 +95,9 @@
    <dimen name="controls_top_margin">24dp</dimen>
    <dimen name="controls_top_margin">24dp</dimen>


    <dimen name="global_actions_grid_item_layout_height">80dp</dimen>
    <dimen name="global_actions_grid_item_layout_height">80dp</dimen>

    <!--  For large screens the security footer appears below the footer,
    same as phones in portrait  -->
    <dimen name="qs_security_footer_single_line_height">48dp</dimen>
    <dimen name="qs_security_footer_background_inset">0dp</dimen>
</resources>
</resources>
+20 −21
Original line number Original line Diff line number Diff line
@@ -42,7 +42,6 @@ import com.android.systemui.settings.brightness.BrightnessSlider;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable;
import com.android.systemui.tuner.TunerService.Tunable;
import com.android.systemui.util.animation.UniqueObjectHostView;


import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
@@ -316,7 +315,6 @@ public class QSPanel extends LinearLayout implements Tunable {
        super.onConfigurationChanged(newConfig);
        super.onConfigurationChanged(newConfig);
        mOnConfigurationChangedListeners.forEach(
        mOnConfigurationChangedListeners.forEach(
                listener -> listener.onConfigurationChange(newConfig));
                listener -> listener.onConfigurationChange(newConfig));
        switchSecurityFooter();
    }
    }


    @Override
    @Override
@@ -359,25 +357,21 @@ public class QSPanel extends LinearLayout implements Tunable {
            switchToParent(mFooter, parent, index);
            switchToParent(mFooter, parent, index);
            index++;
            index++;
        }
        }

        // The security footer is switched on orientation changes
    }
    }


    private void switchSecurityFooter() {
    /** Switch the security footer between top and bottom of QS depending on orientation. */
        if (mSecurityFooter != null) {
    public void switchSecurityFooter(boolean shouldUseSplitNotificationShade) {
            if (mContext.getResources().getConfiguration().orientation
        if (mSecurityFooter == null) return;

        if (!shouldUseSplitNotificationShade
                && mContext.getResources().getConfiguration().orientation
                == Configuration.ORIENTATION_LANDSCAPE && mHeaderContainer != null) {
                == Configuration.ORIENTATION_LANDSCAPE && mHeaderContainer != null) {
            // Adding the security view to the header, that enables us to avoid scrolling
            // Adding the security view to the header, that enables us to avoid scrolling
            switchToParent(mSecurityFooter, mHeaderContainer, 0);
            switchToParent(mSecurityFooter, mHeaderContainer, 0);
        } else {
        } else {
                // Where should this go? If there's media, right before it. Otherwise, at the end.
            // Add after the footer
                View mediaView = findViewByPredicate(v -> v instanceof UniqueObjectHostView);
            int index = indexOfChild(mFooter);
                int index = -1;
            switchToParent(mSecurityFooter, this, index + 1);
                if (mediaView != null) {
                    index = indexOfChild(mediaView);
                }
                switchToParent(mSecurityFooter, this, index);
            }
        }
        }
    }
    }


@@ -652,9 +646,14 @@ public class QSPanel extends LinearLayout implements Tunable {
        return mListening;
        return mListening;
    }
    }


    public void setSecurityFooter(View view) {
    /**
     * Set the security footer view and switch it into the right place
     * @param view the view in question
     * @param shouldUseSplitNotificationShade if QS is in split shade mode
     */
    public void setSecurityFooter(View view, boolean shouldUseSplitNotificationShade) {
        mSecurityFooter = view;
        mSecurityFooter = view;
        switchSecurityFooter();
        switchSecurityFooter(shouldUseSplitNotificationShade);
    }
    }


    protected void setPageMargin(int pageMargin) {
    protected void setPageMargin(int pageMargin) {
+2 −1
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
                refreshAllTiles();
                refreshAllTiles();
            }
            }
            updateBrightnessMirror();
            updateBrightnessMirror();
            mView.switchSecurityFooter(mShouldUseSplitNotificationShade);
        }
        }
    };
    };


@@ -141,7 +142,7 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
            refreshAllTiles();
            refreshAllTiles();
        }
        }
        mView.addOnConfigurationChangedListener(mOnConfigurationChangedListener);
        mView.addOnConfigurationChangedListener(mOnConfigurationChangedListener);
        mView.setSecurityFooter(mQsSecurityFooter.getView());
        mView.setSecurityFooter(mQsSecurityFooter.getView(), mShouldUseSplitNotificationShade);
        switchTileLayout(true);
        switchTileLayout(true);
        if (mBrightnessMirrorController != null) {
        if (mBrightnessMirrorController != null) {
            mBrightnessMirrorController.addCallback(mBrightnessMirrorListener);
            mBrightnessMirrorController.addCallback(mBrightnessMirrorListener);
Loading