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

Unverified Commit bde697ed 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 a5906f29
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ public class LongScreenshotActivity extends Activity {
            mCacheLoadFuture = null;
        } else {
            LongScreenshot longScreenshot = mLongScreenshotHolder.takeLongScreenshot();
            setMagnification(mLongScreenshotHolder.getNeedsMagnification());
            if (longScreenshot != null) {
                onLongScreenshotReceived(longScreenshot);
            } else {
@@ -191,6 +192,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
@@ -31,6 +31,7 @@ public class LongScreenshotData {
    private final AtomicReference<ScrollCaptureController.LongScreenshot> mLongScreenshot;
    private final AtomicReference<ScreenshotController.TransitionDestination>
            mTransitionDestinationCallback;
    private boolean mNeedsMagnification;

    @Inject
    public LongScreenshotData() {
@@ -73,4 +74,12 @@ public class LongScreenshotData {
    public ScreenshotController.TransitionDestination takeTransitionDestinationCallback() {
        return mTransitionDestinationCallback.getAndSet(null);
    }

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

    public boolean getNeedsMagnification() {
        return mNeedsMagnification;
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -722,6 +722,7 @@ public class ScreenshotController {
        ScrollCaptureController.BitmapScreenshot bitmapScreenshot =
            new ScrollCaptureController.BitmapScreenshot(mContext, newScreenshot);

        mLongScreenshotHolder.setNeedsMagnification(false);
        startLongScreenshotActivity(bitmapScreenshot);
    }

@@ -790,6 +791,7 @@ public class ScreenshotController {
                return;
            }

            mLongScreenshotHolder.setNeedsMagnification(true);
            startLongScreenshotActivity(longScreenshot);
        }, mMainExecutor);
    }