summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Himanshu Jaju <himanshujaju@google.com> 2020-11-23 10:42:34 +0000
committer Himanshu Jaju <himanshujaju@google.com> 2020-11-26 11:32:41 +0000
commit65fe833d59b833854cee0c9896b2c9a3bba8fde3 (patch)
tree56cb3bff0717018eed3f5f4c2cc102c0e5e44f95
parentc8cc78445419e802fcc6dac9152366cf62e5dc01 (diff)
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
-rw-r--r--packages/SystemUI/res/layout/global_actions_grid_v2.xml58
-rw-r--r--packages/SystemUI/res/layout/global_actions_lock_view.xml35
-rw-r--r--packages/SystemUI/res/layout/global_actions_view.xml52
3 files changed, 90 insertions, 55 deletions
diff --git a/packages/SystemUI/res/layout/global_actions_grid_v2.xml b/packages/SystemUI/res/layout/global_actions_grid_v2.xml
index 7d45de3fa50d..30ffc32ce1f8 100644
--- a/packages/SystemUI/res/layout/global_actions_grid_v2.xml
+++ b/packages/SystemUI/res/layout/global_actions_grid_v2.xml
@@ -1,67 +1,15 @@
<?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"
diff --git a/packages/SystemUI/res/layout/global_actions_lock_view.xml b/packages/SystemUI/res/layout/global_actions_lock_view.xml
new file mode 100644
index 000000000000..eccc63688065
--- /dev/null
+++ b/packages/SystemUI/res/layout/global_actions_lock_view.xml
@@ -0,0 +1,35 @@
+<!--
+ ~ 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
diff --git a/packages/SystemUI/res/layout/global_actions_view.xml b/packages/SystemUI/res/layout/global_actions_view.xml
new file mode 100644
index 000000000000..454707bc44e2
--- /dev/null
+++ b/packages/SystemUI/res/layout/global_actions_view.xml
@@ -0,0 +1,52 @@
+<!--
+ ~ 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