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

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

Merge "Adjust LongScreenshotActivity padding based upon system insets" into main

parents e5e9c56f 443ea3ef
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.ContentProvider;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.HardwareRenderer;
import android.graphics.Insets;
import android.graphics.Matrix;
import android.graphics.RecordingCanvas;
import android.graphics.Rect;
@@ -38,9 +39,11 @@ import android.util.Log;
import android.view.Display;
import android.view.ScrollCaptureResponse;
import android.view.View;
import android.view.WindowInsets;
import android.widget.ImageView;

import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.view.WindowCompat;

import com.android.internal.app.ChooserActivity;
import com.android.internal.logging.UiEventLogger;
@@ -127,6 +130,10 @@ public class LongScreenshotActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Enable edge-to-edge explicitly.
        WindowCompat.setDecorFitsSystemWindows(getWindow(), false);

        setContentView(R.layout.long_screenshot);

        mPreview = requireViewById(R.id.preview);
@@ -149,6 +156,13 @@ public class LongScreenshotActivity extends Activity {
                (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) ->
                        updateImageDimensions());

        requireViewById(R.id.root).setOnApplyWindowInsetsListener(
                (view, windowInsets) -> {
                    Insets insets = windowInsets.getInsets(WindowInsets.Type.systemBars());
                    view.setPadding(insets.left, insets.top, insets.right, insets.bottom);
                    return WindowInsets.CONSUMED;
                });

        Intent intent = getIntent();
        mScrollCaptureResponse = intent.getParcelableExtra(EXTRA_CAPTURE_RESPONSE);
        mScreenshotUserHandle = intent.getParcelableExtra(EXTRA_SCREENSHOT_USER_HANDLE,