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

Commit b519dc9f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix display problem in the freeform mode" into main

parents fbfacbb9 79c69fcc
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1423,13 +1423,15 @@ public final class Utils extends com.android.settingslib.Utils {
    public static void setupEdgeToEdge(@NonNull FragmentActivity activity) {
        ViewCompat.setOnApplyWindowInsetsListener(activity.findViewById(android.R.id.content),
                (v, windowInsets) -> {
                    Insets insets = windowInsets.getInsets(
                    final Insets insets = windowInsets.getInsets(
                            WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime()
                                    | WindowInsetsCompat.Type.displayCutout());
                    int statusBarHeight = activity.getWindow().getDecorView().getRootWindowInsets()
                            .getInsets(WindowInsetsCompat.Type.statusBars()).top;
                    int newInsetsTop = activity.getWindow().getDecorView().getRootWindowInsets()
                            .getInsets(WindowInsetsCompat.Type.statusBars()
                                    | WindowInsetsCompat.Type.captionBar()).top;

                    // Apply the insets paddings to the view.
                    v.setPadding(insets.left, statusBarHeight, insets.right, insets.bottom);
                    v.setPadding(insets.left, newInsetsTop, insets.right, insets.bottom);

                    // Return CONSUMED if you don't want the window insets to keep being
                    // passed down to descendant views.