summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jay Thomas Sullivan <jaysullivan@google.com> 2025-01-25 19:49:28 -0800
committer Jay Sullivan <jaysullivan@google.com> 2025-01-28 18:16:22 -0800
commit959bd727d2faebdc8b5a1b0b9e1b11d2a5a8229f (patch)
treeb0894354efadb6f9cb352be92f867b75b2546597
parent79292285e688378a80ad8f91e4b24d53b5c581fc (diff)
[E2E] Fix edge-to-edge
Fix edge-to-edge in PermissionController. We recently enabled edge-to-edge (go/e2e-2024-1p) in the Permission module, and partially resolved some margin issues by adding `fitsSystemWindows="true"` to the permissions_frame layout. But even after this fix, there still appeared to be an issue with the collapsing toolbar. (It was as if `fitsSystemWindows="true"` had fixed everything except for the collapsing toolbar.) This collapsing toolbar issue is now fixed here by moving the `fitsSystemWindows=true` up to the nav_host_fragment layout instead of the permissions_frame layout. Here's a rough portayal of how these layouts are nested: R.layout.nav_host_fragment { R.layout.collapsing_toolbar_base_layout { <AppBarLayout> <CollapsingToolbarLayout .../> </AppBarLayout> R.layout.permissions_frame { ... } } } Bug: 380055900 Test: atest CtsPermissionUiTestCases Relnote: N/A Flag: EXEMPT bugfix Change-Id: I4fc71837d44e42342d6865e2a146f3848375ebe1
-rw-r--r--PermissionController/res/layout-v35/nav_host_fragment.xml32
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionsFrameFragment.java3
2 files changed, 32 insertions, 3 deletions
diff --git a/PermissionController/res/layout-v35/nav_host_fragment.xml b/PermissionController/res/layout-v35/nav_host_fragment.xml
new file mode 100644
index 000000000..5c2850b7a
--- /dev/null
+++ b/PermissionController/res/layout-v35/nav_host_fragment.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2025 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:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true">
+
+ <fragment
+ android:id="@+id/nav_host_fragment"
+ android:name="androidx.navigation.fragment.NavHostFragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:defaultNavHost="true" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionsFrameFragment.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionsFrameFragment.java
index c1902fb57..af204d7d4 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionsFrameFragment.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/PermissionsFrameFragment.java
@@ -98,9 +98,6 @@ public abstract class PermissionsFrameFragment extends PreferenceFragmentCompat
com.android.settingslib.widget.progressbar.R.id.progress_bar_background);
setProgressBarVisible(false);
getListView().setFocusable(false);
- if (SdkLevel.isAtLeastV()) {
- rootView.setFitsSystemWindows(true);
- }
return rootView;
}