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

Commit 15694fcc authored by Aaron Heuckroth's avatar Aaron Heuckroth Committed by Android (Google) Code Review
Browse files

Merge "Move grid-based Global Actions to power button when not using panel."

parents 6dc8c217 f19d2726
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@
    android:orientation="horizontal"
    android:clipToPadding="false"
    android:theme="@style/qs_theme"
    android:gravity="top|right"
    android:paddingLeft="@dimen/global_actions_top_padding"
    android:gravity="top|left"
    android:clipChildren="false"
>
    <LinearLayout
+2 −1
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@
    android:orientation="horizontal"
    android:clipToPadding="false"
    android:theme="@style/qs_theme"
    android:gravity="top|left"
    android:gravity="top|right"
    android:paddingRight="@dimen/global_actions_top_padding"
    android:clipChildren="false"
>
    <LinearLayout
+2 −1
Original line number Diff line number Diff line
@@ -6,8 +6,9 @@
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:clipToPadding="false"
    android:paddingTop="@dimen/global_actions_top_padding"
    android:theme="@style/qs_theme"
    android:gravity="bottom|center"
    android:gravity="top|center"
    android:clipChildren="false"
>
    <LinearLayout
+3 −1
Original line number Diff line number Diff line
@@ -867,10 +867,12 @@

    <!-- Global actions power menu -->
    <dimen name="global_actions_panel_width">120dp</dimen>
    <dimen name="global_actions_top_padding">120dp</dimen>
    <dimen name="global_actions_padding">12dp</dimen>
    <dimen name="global_actions_translate">9dp</dimen>

    <!-- Distance from the top of screen in pixels, to position the power menu near the button. -->
    <dimen name="global_actions_top_padding">330px</dimen>

    <!-- Global actions grid layout -->
    <dimen name="global_actions_grid_side_margin">4dp</dimen>

+11 −9
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ public class HardwareUiLayout extends MultiListLayout implements Tunable {
        } else {
            rotateLeft();
        }
        if (mSeparated) {
        if (mAdapter.hasSeparatedItems()) {
            if (from == ROTATION_SEASCAPE || to == ROTATION_SEASCAPE) {
                // Separated view has top margin, so seascape separated view need special rotation,
                // not a full left or right rotation.
@@ -257,10 +257,10 @@ public class HardwareUiLayout extends MultiListLayout implements Tunable {

    @Override
    public void onUpdateList() {
        removeAllItems();
        super.onUpdateList();
        ArrayList<GlobalActionsDialog.Action> separatedActions =
                mAdapter.getSeparatedItems(mSeparated);
        ArrayList<GlobalActionsDialog.Action> listActions = mAdapter.getListItems(mSeparated);
                mAdapter.getSeparatedItems();
        ArrayList<GlobalActionsDialog.Action> listActions = mAdapter.getListItems();

        for (int i = 0; i < mAdapter.getCount(); i++) {
            Object action = mAdapter.getItem(i);
@@ -461,8 +461,9 @@ public class HardwareUiLayout extends MultiListLayout implements Tunable {
        if (mList == null) return;
        // If got separated button, setRotatedBackground to false,
        // all items won't get white background.
        mListBackground.setRotatedBackground(mSeparated);
        mSeparatedViewBackground.setRotatedBackground(mSeparated);
        boolean separated = mAdapter.hasSeparatedItems();
        mListBackground.setRotatedBackground(separated);
        mSeparatedViewBackground.setRotatedBackground(separated);
        if (mDivision != null && mDivision.getVisibility() == VISIBLE) {
            int index = mRotatedBackground ? 0 : 1;
            mDivision.getLocationOnScreen(mTmp2);
@@ -508,26 +509,27 @@ public class HardwareUiLayout extends MultiListLayout implements Tunable {
        int screenHeight;
        int totalHeight;
        int targetGravity;
        boolean separated = mAdapter.hasSeparatedItems();
        MarginLayoutParams params = (MarginLayoutParams) mSeparatedView.getLayoutParams();
        switch (RotationUtils.getRotation(getContext())) {
            case RotationUtils.ROTATION_LANDSCAPE:
                defaultTopPadding = getPaddingLeft();
                viewsTotalHeight = mList.getMeasuredWidth() + mSeparatedView.getMeasuredWidth();
                separatedViewTopMargin = mSeparated ? params.leftMargin : 0;
                separatedViewTopMargin = separated ? params.leftMargin : 0;
                screenHeight = getMeasuredWidth();
                targetGravity = Gravity.CENTER_HORIZONTAL|Gravity.TOP;
                break;
            case RotationUtils.ROTATION_SEASCAPE:
                defaultTopPadding = getPaddingRight();
                viewsTotalHeight = mList.getMeasuredWidth() + mSeparatedView.getMeasuredWidth();
                separatedViewTopMargin = mSeparated ? params.leftMargin : 0;
                separatedViewTopMargin = separated ? params.leftMargin : 0;
                screenHeight = getMeasuredWidth();
                targetGravity = Gravity.CENTER_HORIZONTAL|Gravity.BOTTOM;
                break;
            default: // Portrait
                defaultTopPadding = getPaddingTop();
                viewsTotalHeight = mList.getMeasuredHeight() + mSeparatedView.getMeasuredHeight();
                separatedViewTopMargin = mSeparated ? params.topMargin : 0;
                separatedViewTopMargin = separated ? params.topMargin : 0;
                screenHeight = getMeasuredHeight();
                targetGravity = Gravity.CENTER_VERTICAL|Gravity.RIGHT;
                break;
Loading