Loading packages/SystemUI/src/com/android/systemui/screenshot/CropView.java +11 −8 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ public class CropView extends View { case MotionEvent.ACTION_UP: if (mCurrentDraggingBoundary != CropBoundary.NONE) { // Commit the delta to the stored crop values. commitDeltas(); commitDeltas(mCurrentDraggingBoundary); updateListener(event); } } Loading Loading @@ -184,12 +184,12 @@ public class CropView extends View { animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { commitDeltas(); commitDeltas(boundary); } @Override public void onAnimationCancel(Animator animation) { commitDeltas(); commitDeltas(boundary); } }); animator.setFloatValues(0f, 1f); Loading Loading @@ -228,12 +228,15 @@ public class CropView extends View { mCropInteractionListener = listener; } private void commitDeltas() { private void commitDeltas(CropBoundary boundary) { if (boundary == CropBoundary.TOP) { mTopCrop += mTopDelta; mBottomCrop += mBottomDelta; mTopDelta = 0; } else if (boundary == CropBoundary.BOTTOM) { mBottomCrop += mBottomDelta; mBottomDelta = 0; } } private void updateListener(MotionEvent event) { if (mCropInteractionListener != null) { Loading packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java +10 −2 Original line number Diff line number Diff line Loading @@ -339,14 +339,22 @@ public class LongScreenshotActivity extends Activity { } @Override public void onComplete(ImageTileSet imageTileSet) { public void onComplete(ImageTileSet imageTileSet, int pageSize) { Log.i(TAG, "Got tiles " + imageTileSet.getWidth() + " x " + imageTileSet.getHeight()); mPreview.setImageDrawable(imageTileSet.getDrawable()); updateCropLocation(); mMagnifierView.setDrawable(imageTileSet.getDrawable(), imageTileSet.getWidth(), imageTileSet.getHeight()); mCropView.animateBoundaryTo(CropView.CropBoundary.BOTTOM, 0.5f); // Original boundaries go from the image tile set's y=0 to y=pageSize, so // we animate to that as a starting crop position. float topFraction = Math.max(0, -imageTileSet.getTop() / (float) imageTileSet.getHeight()); float bottomFraction = Math.min(1f, 1 - (imageTileSet.getBottom() - pageSize) / (float) imageTileSet.getHeight()); mCropView.animateBoundaryTo(CropView.CropBoundary.TOP, topFraction); mCropView.animateBoundaryTo(CropView.CropBoundary.BOTTOM, bottomFraction); mBackgroundExecutor.execute(() -> saveCacheBitmap(imageTileSet)); } }); Loading packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureController.java +2 −2 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ public class ScrollCaptureController { if (mImageTileSet.isEmpty()) { mCaptureCallback.onError(); } else { mCaptureCallback.onComplete(mImageTileSet); mCaptureCallback.onComplete(mImageTileSet, session.getPageHeight()); } } Loading @@ -179,7 +179,7 @@ public class ScrollCaptureController { * Callback for image capture completion or error. */ public interface ScrollCaptureCallback { void onComplete(ImageTileSet imageTileSet); void onComplete(ImageTileSet imageTileSet, int pageHeight); void onError(); } Loading Loading
packages/SystemUI/src/com/android/systemui/screenshot/CropView.java +11 −8 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ public class CropView extends View { case MotionEvent.ACTION_UP: if (mCurrentDraggingBoundary != CropBoundary.NONE) { // Commit the delta to the stored crop values. commitDeltas(); commitDeltas(mCurrentDraggingBoundary); updateListener(event); } } Loading Loading @@ -184,12 +184,12 @@ public class CropView extends View { animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { commitDeltas(); commitDeltas(boundary); } @Override public void onAnimationCancel(Animator animation) { commitDeltas(); commitDeltas(boundary); } }); animator.setFloatValues(0f, 1f); Loading Loading @@ -228,12 +228,15 @@ public class CropView extends View { mCropInteractionListener = listener; } private void commitDeltas() { private void commitDeltas(CropBoundary boundary) { if (boundary == CropBoundary.TOP) { mTopCrop += mTopDelta; mBottomCrop += mBottomDelta; mTopDelta = 0; } else if (boundary == CropBoundary.BOTTOM) { mBottomCrop += mBottomDelta; mBottomDelta = 0; } } private void updateListener(MotionEvent event) { if (mCropInteractionListener != null) { Loading
packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java +10 −2 Original line number Diff line number Diff line Loading @@ -339,14 +339,22 @@ public class LongScreenshotActivity extends Activity { } @Override public void onComplete(ImageTileSet imageTileSet) { public void onComplete(ImageTileSet imageTileSet, int pageSize) { Log.i(TAG, "Got tiles " + imageTileSet.getWidth() + " x " + imageTileSet.getHeight()); mPreview.setImageDrawable(imageTileSet.getDrawable()); updateCropLocation(); mMagnifierView.setDrawable(imageTileSet.getDrawable(), imageTileSet.getWidth(), imageTileSet.getHeight()); mCropView.animateBoundaryTo(CropView.CropBoundary.BOTTOM, 0.5f); // Original boundaries go from the image tile set's y=0 to y=pageSize, so // we animate to that as a starting crop position. float topFraction = Math.max(0, -imageTileSet.getTop() / (float) imageTileSet.getHeight()); float bottomFraction = Math.min(1f, 1 - (imageTileSet.getBottom() - pageSize) / (float) imageTileSet.getHeight()); mCropView.animateBoundaryTo(CropView.CropBoundary.TOP, topFraction); mCropView.animateBoundaryTo(CropView.CropBoundary.BOTTOM, bottomFraction); mBackgroundExecutor.execute(() -> saveCacheBitmap(imageTileSet)); } }); Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureController.java +2 −2 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ public class ScrollCaptureController { if (mImageTileSet.isEmpty()) { mCaptureCallback.onError(); } else { mCaptureCallback.onComplete(mImageTileSet); mCaptureCallback.onComplete(mImageTileSet, session.getPageHeight()); } } Loading @@ -179,7 +179,7 @@ public class ScrollCaptureController { * Callback for image capture completion or error. */ public interface ScrollCaptureCallback { void onComplete(ImageTileSet imageTileSet); void onComplete(ImageTileSet imageTileSet, int pageHeight); void onError(); } Loading