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

Commit 06090266 authored by Aran Ink's avatar Aran Ink
Browse files

Scroll wallet and controls under power menu.

Bug: 150694556

Test: Manual -- wallet and controls scroll beneath power menu, and clicking/swiping them works as expected. User can still dismiss the menu by tapping on any empty space and power menu controls are still functional in all three current layouts (column, grid, grid_v2) in portrait/landscape/seascape.

Change-Id: I31de9661fdcd794c845c5e0040c490bf1520cb65
parent 8ebe5c22
Loading
Loading
Loading
Loading
+58 −54
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/global_actions_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

  <androidx.constraintlayout.widget.ConstraintLayout
      android:id="@+id/global_actions_grid_root"
      android:layout_width="match_parent"
    android:layout_height="match_parent"
      android:clipChildren="false"
      android:clipToPadding="false"
      android:paddingBottom="@dimen/global_actions_grid_container_shadow_offset"
      android:layout_marginBottom="@dimen/global_actions_grid_container_negative_shadow_offset">

    android:orientation="vertical"
>
  <com.android.systemui.globalactions.GlobalActionsFlatLayout
      android:id="@id/global_actions_view"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:theme="@style/qs_theme"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
      android:gravity="top | center_horizontal"
      android:clipChildren="false"
      android:clipToPadding="false"
        android:layout_marginTop="@dimen/global_actions_top_margin">
      android:layout_marginTop="@dimen/global_actions_top_margin"
  >
    <LinearLayout
        android:id="@android:id/list"
        android:layout_width="wrap_content"
@@ -40,22 +29,37 @@
        android:paddingBottom="@dimen/global_actions_grid_vertical_padding"
        android:orientation="horizontal"
        android:gravity="left"
          android:translationZ="@dimen/global_actions_translate" />
        android:translationZ="@dimen/global_actions_translate"
    />
  </com.android.systemui.globalactions.GlobalActionsFlatLayout>

  <com.android.systemui.globalactions.MinHeightScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/global_actions_grid_container_shadow_offset"
    android:layout_marginBottom="@dimen/global_actions_grid_container_negative_shadow_offset"
    android:orientation="vertical"
  >
    <LinearLayout
        android:id="@+id/global_actions_grid_root"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:orientation="vertical"
        android:clipToPadding="false"
    >
      <LinearLayout
          android:id="@+id/global_actions_panel"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@id/global_actions_view">

      >
        <FrameLayout
            android:id="@+id/global_actions_panel_container"
            android:layout_width="match_parent"
          android:layout_height="wrap_content" />
            android:layout_height="wrap_content"
        />
      </LinearLayout>

      <LinearLayout
@@ -63,9 +67,9 @@
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@id/global_actions_panel"
        app:layout_constraintBottom_toBottomOf="parent" />
  </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
          android:layout_marginRight="@dimen/global_actions_grid_horizontal_padding"
          android:layout_marginLeft="@dimen/global_actions_grid_horizontal_padding"
      />
    </LinearLayout>
  </com.android.systemui.globalactions.MinHeightScrollView>
</LinearLayout>
 No newline at end of file
+0 −38
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.HardwareUiLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@id/global_actions_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="top|right"
    android:layout_marginBottom="0dp"
    android:orientation="vertical"
    android:paddingTop="@dimen/global_actions_top_padding"
    android:clipToPadding="false"
    android:theme="@style/qs_theme"
    android:clipChildren="false">

    <!-- Global actions is right-aligned to be physically near power button -->
    <LinearLayout
        android:id="@android:id/list"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top|right"
        android:gravity="center"
        android:orientation="vertical"
        android:padding="@dimen/global_actions_padding"
        android:translationZ="@dimen/global_actions_translate" />

    <!-- For separated button-->
    <FrameLayout
        android:id="@+id/separated_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top|right"
        android:layout_marginTop="6dp"
        android:gravity="center"
        android:orientation="vertical"
        android:padding="@dimen/global_actions_padding"
        android:translationZ="@dimen/global_actions_translate" />

</com.android.systemui.HardwareUiLayout>
+0 −570

File deleted.

Preview size limit exceeded, changes collapsed.

+9 −10
Original line number Diff line number Diff line
@@ -1574,7 +1574,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,

        private ControlsUiController mControlsUiController;
        private ViewGroup mControlsView;
        private ViewGroup mContainerView;

        ActionsDialog(Context context, MyAdapter adapter,
                GlobalActionsPanelPlugin.PanelViewController plugin, BlurUtils blurUtils,
@@ -1671,7 +1670,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
            mControlsView = findViewById(com.android.systemui.R.id.global_actions_controls);
            mGlobalActionsLayout = findViewById(com.android.systemui.R.id.global_actions_view);
            mGlobalActionsLayout.setOutsideTouchListener(view -> dismiss());
            ((View) mGlobalActionsLayout.getParent()).setOnClickListener(view -> dismiss());
            mGlobalActionsLayout.setListViewAccessibilityDelegate(new View.AccessibilityDelegate() {
                @Override
                public boolean dispatchPopulateAccessibilityEvent(
@@ -1684,6 +1682,15 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
            mGlobalActionsLayout.setRotationListener(this::onRotate);
            mGlobalActionsLayout.setAdapter(mAdapter);

            View globalActionsParent = (View) mGlobalActionsLayout.getParent();
            globalActionsParent.setOnClickListener(v -> dismiss());

            // add fall-through dismiss handling to root view
            View rootView = findViewById(com.android.systemui.R.id.global_actions_grid_root);
            if (rootView != null) {
                rootView.setOnClickListener(v -> dismiss());
            }

            if (shouldUsePanel()) {
                initializePanel();
            }
@@ -1692,14 +1699,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
                mScrimAlpha = ScrimController.BUSY_SCRIM_ALPHA;
            }
            getWindow().setBackgroundDrawable(mBackgroundDrawable);

            if (mControlsView != null) {
                mContainerView = findViewById(com.android.systemui.R.id.global_actions_container);
                mContainerView.setOnTouchListener((v, e) -> {
                    dismiss();
                    return true;
                });
            }
        }

        private void fixNavBarClipping() {
+43 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.systemui.globalactions;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;

/**
 * When measured, this view sets the minimum height of its first child to be equal to its own
 * target height.
 *
 * This ensures fall-through click handlers can be placed on this view's child component.
 */
public class MinHeightScrollView extends ScrollView {
    public MinHeightScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        View firstChild = getChildAt(0);
        if (firstChild != null) {
            firstChild.setMinimumHeight(MeasureSpec.getSize(heightMeasureSpec));
        }
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
}