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

Unverified Commit fc7b094a 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 c84325bc
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ public class LongScreenshotActivity extends Activity {
            mCacheLoadFuture = null;
        } else {
            LongScreenshot longScreenshot = mLongScreenshotHolder.takeLongScreenshot();
            setMagnification(mLongScreenshotHolder.getNeedsMagnification());
            if (longScreenshot != null) {
                onLongScreenshotReceived(longScreenshot);
            } else {
@@ -223,6 +224,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
@@ -33,6 +33,7 @@ public class LongScreenshotData {
    private final AtomicReference<ScreenshotController.TransitionDestination>
            mTransitionDestinationCallback;
    private String mForegroundAppName;
    private boolean mNeedsMagnification;

    @Inject
    public LongScreenshotData() {
@@ -89,4 +90,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,