Files
frameworks_base/packages/SystemUI/res/layout/navigation_layout.xml
Charles Chen aa94d95bfc Use size to inflate nav bar buttons instead of rotation
For a landscape or close-to-square device, the button layout of
nav bar was abnormal since System UI assumes the nav bar position
would change if device rotated.
However, for default landscape device, nav bar will be always on
the buttom.

This patch resolve the assumption by using nav bar
direction (horizon/vertical) instead of rotation.
Also renaming the layout for consistency.

Test: atest SystemUITests
Test: atest NavigationBarFlaterViewTest
Test: manual - rotate the phone and comapre to my Pixel2
Test: manual - test the peproduce steps and the layout of nav bar buttons is normal
Fix: 124428114

Change-Id: I23444bcb2a44555e7116f6140a29147c5a03ed69
2019-02-21 15:44:57 +08:00

56 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/rounded_corner_content_padding"
android:layout_marginEnd="@dimen/rounded_corner_content_padding"
android:paddingStart="@dimen/nav_content_padding"
android:paddingEnd="@dimen/nav_content_padding"
android:id="@+id/horizontal">
<com.android.systemui.statusbar.phone.NearestTouchFrame
android:id="@+id/nav_buttons"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false">
<LinearLayout
android:id="@+id/ends_group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:clipToPadding="false"
android:clipChildren="false" />
<LinearLayout
android:id="@+id/center_group"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal"
android:clipToPadding="false"
android:clipChildren="false" />
</com.android.systemui.statusbar.phone.NearestTouchFrame>
</FrameLayout>