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

Commit 65fe833d authored by Himanshu Jaju's avatar Himanshu Jaju
Browse files

Refactor global actions items and lock message view.

Larger screens will have a different layout structure, but
these components are reusable. More details - ag/12936281

Bug: b/171918213
Test: Manually on fold2 without ag/12936281
Change-Id: I6abdc8f6cefd405c60769c58b7e65fe3a434ed74
parent c8cc7844
Loading
Loading
Loading
Loading
+3 −55
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<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"
    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"
      android:clipChildren="false"
      android:clipToPadding="false"
      android:layout_marginStart="@dimen/global_actions_side_margin"
  >
    <LinearLayout
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/global_actions_grid_vertical_padding"
        android:paddingBottom="@dimen/global_actions_grid_vertical_padding"
        android:orientation="horizontal"
        android:gravity="left | center_vertical"
        android:translationZ="@dimen/global_actions_translate"
    >
      <RelativeLayout
          android:id="@+id/global_actions_overflow_button"
          android:contentDescription="@string/accessibility_menu"
          android:layout_width="48dp"
          android:layout_height="48dp"
      >
        <ImageView
            android:src="@drawable/ic_more_vert"
            android:layout_centerInParent="true"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:tint="@color/control_more_vert"
        />
      </RelativeLayout>
    </LinearLayout>
  </com.android.systemui.globalactions.GlobalActionsFlatLayout>

  <androidx.constraintlayout.widget.ConstraintLayout
      android:id="@+id/global_actions_lock_message_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:visibility="gone">
    <TextView
        android:id="@+id/global_actions_lock_message"
        style="@style/TextAppearance.Control.Title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="@dimen/global_actions_side_margin"
        android:drawablePadding="12dp"
        android:gravity="center"
        android:text="@string/global_action_lock_message"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.35"/>
  </androidx.constraintlayout.widget.ConstraintLayout>
  <include layout="@layout/global_actions_view" />

  <include layout="@layout/global_actions_lock_view" />

  <com.android.systemui.globalactions.MinHeightScrollView
      android:layout_width="match_parent"
+35 −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.
  -->
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/global_actions_lock_message_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone">
  <TextView
      android:id="@+id/global_actions_lock_message"
      style="@style/TextAppearance.Control.Title"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginHorizontal="@dimen/global_actions_side_margin"
      android:drawablePadding="12dp"
      android:gravity="center"
      android:text="@string/global_action_lock_message"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintVertical_bias="0.35"/>
</androidx.constraintlayout.widget.ConstraintLayout>
 No newline at end of file
+52 −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.
  -->
<com.android.systemui.globalactions.GlobalActionsFlatLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@id/global_actions_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:theme="@style/qs_theme"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:layout_marginStart="@dimen/global_actions_side_margin"
    >
  <LinearLayout
      android:id="@android:id/list"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:paddingTop="@dimen/global_actions_grid_vertical_padding"
      android:paddingBottom="@dimen/global_actions_grid_vertical_padding"
      android:orientation="horizontal"
      android:gravity="left | center_vertical"
      android:translationZ="@dimen/global_actions_translate"
      >
    <RelativeLayout
        android:id="@+id/global_actions_overflow_button"
        android:contentDescription="@string/accessibility_menu"
        android:layout_width="48dp"
        android:layout_height="48dp"
        >
      <ImageView
          android:src="@drawable/ic_more_vert"
          android:layout_centerInParent="true"
          android:layout_width="24dp"
          android:layout_height="24dp"
          android:tint="@color/control_more_vert"
          />
    </RelativeLayout>
  </LinearLayout>
</com.android.systemui.globalactions.GlobalActionsFlatLayout>
 No newline at end of file