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

Unverified Commit fe15be96 authored by Cosmin Tanislav's avatar Cosmin Tanislav Committed by Michael Bestas
Browse files

SystemUI: screenshot: disable magnification for partial screenshots

Partial screenshots are screen-size and don't need a magnifying glass.

Change-Id: I472103352411d1482423230a4ff08ddda45cc53d
parent ab62f2c1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ public class LongScreenshotActivity extends Activity {
            mCacheLoadFuture = null;
        } else {
            LongScreenshot longScreenshot = mLongScreenshotHolder.takeLongScreenshot();
            setMagnification(mLongScreenshotHolder.getNeedsMagnification());
            if (longScreenshot != null) {
                onLongScreenshotReceived(longScreenshot);
            } else {
@@ -228,6 +229,14 @@ public class LongScreenshotActivity extends Activity {
        }
    }

    private void setMagnification(boolean status) {
        if (status) {
            mCropView.setCropInteractionListener(mMagnifierView);
        } else {
            mCropView.setCropInteractionListener(null);
        }
    }

    private void onLongScreenshotReceived(LongScreenshot longScreenshot) {
        Log.i(TAG, "Completed: " + longScreenshot);
        mLongScreenshot = longScreenshot;
+9 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ public class LongScreenshotData {
    private final AtomicReference<TransitionDestination>
            mTransitionDestinationCallback;
    private String mForegroundAppName;
    private boolean mNeedsMagnification;

    public interface TransitionDestination {
        /**
@@ -98,4 +99,12 @@ public class LongScreenshotData {
    public String getForegroundAppName() {
        return mForegroundAppName;
    }

    public void setNeedsMagnification(boolean status) {
        mNeedsMagnification = status;
    }

    public boolean getNeedsMagnification() {
        return mNeedsMagnification;
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ constructor(
                addListener(
                    {
                        getLongScreenshotChecked(this, onFailure)?.let {
                            longScreenshotHolder.setNeedsMagnification(true)
                            longScreenshotHolder.setLongScreenshot(it)
                            longScreenshotHolder.setTransitionDestinationCallback {
                                destinationRect: Rect,
@@ -109,6 +110,7 @@ constructor(
        lastScrollCaptureResponse = null
        longScreenshotFuture?.cancel(true)
        mainExecutor.execute {
            longScreenshotHolder.setNeedsMagnification(false)
            longScreenshotHolder.setLongScreenshot(longScreenshot)
            longScreenshotHolder.setTransitionDestinationCallback {
                destinationRect: Rect,