Fix the action bar shows up problem
- Hide the internal action bar. - Refine the Utils.setupEdgeToEdge API. - Rollback the testcases. Bug: 328622648 Fixes: 331308440 Test: atest com.android.settings.UtilsTest SettingsActivityTest Change-Id: I7dfbc93def3e772b57bf06b8276315cee7402a9c
This commit is contained in:
@@ -1385,20 +1385,19 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
* @param activity the Activity need to setup the edge to edge feature.
|
||||
*/
|
||||
public static void setupEdgeToEdge(@NonNull FragmentActivity activity) {
|
||||
if (com.android.window.flags.Flags.enforceEdgeToEdge()) {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(activity.findViewById(android.R.id.content),
|
||||
(v, windowInsets) -> {
|
||||
Insets insets = windowInsets.getInsets(
|
||||
WindowInsetsCompat.Type.systemBars()
|
||||
| WindowInsetsCompat.Type.ime());
|
||||
// Apply the insets paddings to the view.
|
||||
v.setPadding(insets.left, insets.top, insets.right, insets.bottom);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(activity.findViewById(android.R.id.content),
|
||||
(v, windowInsets) -> {
|
||||
Insets insets = windowInsets.getInsets(
|
||||
WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime());
|
||||
int statusBarHeight = activity.getWindow().getDecorView().getRootWindowInsets()
|
||||
.getInsets(WindowInsetsCompat.Type.statusBars()).top;
|
||||
// Apply the insets paddings to the view.
|
||||
v.setPadding(insets.left, statusBarHeight, insets.right, insets.bottom);
|
||||
|
||||
// Return CONSUMED if you don't want the window insets to keep being
|
||||
// passed down to descendant views.
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
}
|
||||
// Return CONSUMED if you don't want the window insets to keep being
|
||||
// passed down to descendant views.
|
||||
return WindowInsetsCompat.CONSUMED;
|
||||
});
|
||||
}
|
||||
|
||||
private static FaceManager.RemovalCallback faceManagerRemovalCallback(int userId) {
|
||||
|
Reference in New Issue
Block a user