Loading packages/SystemUI/res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,7 @@ <color name="global_screenshot_background_protection_start">#40000000</color> <!-- 25% black --> <!-- Long screenshot UI --> <color name="screenshot_crop_scrim">#9444</color> <color name="screenshot_crop_scrim">#6444</color> <!-- GM2 colors --> <color name="GM2_grey_50">#F8F9FA</color> Loading packages/SystemUI/src/com/android/systemui/screenshot/CropView.java +161 −107 File changed.Preview size limit exceeded, changes collapsed. Show changes packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java +8 −7 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ public class LongScreenshotActivity extends Activity { mPreview.addOnLayoutChangeListener( (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> updateCropLocation()); updateImageDimensions()); Intent intent = getIntent(); mScrollCaptureResponse = intent.getParcelableExtra(EXTRA_CAPTURE_RESPONSE); Loading Loading @@ -206,7 +206,7 @@ public class LongScreenshotActivity extends Activity { Log.d(TAG, "onCaptureCompleted(longScreenshot=" + longScreenshot + ")"); mLongScreenshot = longScreenshot; mPreview.setImageDrawable(mLongScreenshot.getDrawable()); updateCropLocation(); updateImageDimensions(); mMagnifierView.setDrawable(mLongScreenshot.getDrawable(), mLongScreenshot.getWidth(), mLongScreenshot.getHeight()); // Original boundaries go from the image tile set's y=0 to y=pageSize, so Loading Loading @@ -363,10 +363,8 @@ public class LongScreenshotActivity extends Activity { return; } Rect bounds = new Rect(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); int height = bounds.height(); bounds.top = (int) (height * mCropView.getTopBoundary()); bounds.bottom = (int) (height * mCropView.getBottomBoundary()); Rect bounds = mCropView.getCropBoundaries(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); if (bounds.isEmpty()) { Log.w(TAG, "Crop bounds empty, skipping export."); Loading Loading @@ -404,7 +402,7 @@ public class LongScreenshotActivity extends Activity { } } private void updateCropLocation() { private void updateImageDimensions() { Drawable drawable = mPreview.getDrawable(); if (drawable == null) { return; Loading @@ -419,9 +417,12 @@ public class LongScreenshotActivity extends Activity { float imageHeight = mPreview.getHeight() * viewRatio / imageRatio; int extraPadding = (int) (mPreview.getHeight() - imageHeight) / 2; mCropView.setExtraPadding(extraPadding, extraPadding); mCropView.setImageWidth(mPreview.getWidth()); } else { // Image is full height mCropView.setExtraPadding(0, 0); mCropView.setImageWidth((int) (mPreview.getHeight() * imageRatio)); } } } packages/SystemUI/src/com/android/systemui/screenshot/MagnifierView.java +4 −2 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public class MagnifierView extends View implements CropView.CropInteractionListe private float mCheckerboardBoxSize = 40; private float mLastCropPosition; private float mLastCenter = 0.5f; private CropView.CropBoundary mCropBoundary; private ViewPropertyAnimator mTranslationAnimator; Loading Loading @@ -131,7 +132,7 @@ public class MagnifierView extends View implements CropView.CropInteractionListe canvas.save(); // Translate such that the center of this view represents the center of the crop // boundary. canvas.translate(-mDrawable.getBounds().width() / 2 + getWidth() / 2, canvas.translate(-mDrawable.getBounds().width() * mLastCenter + getWidth() / 2, -mDrawable.getBounds().height() * mLastCropPosition + getHeight() / 2); mDrawable.draw(canvas); canvas.restore(); Loading @@ -148,8 +149,9 @@ public class MagnifierView extends View implements CropView.CropInteractionListe @Override public void onCropMotionEvent(MotionEvent event, CropView.CropBoundary boundary, float cropPosition, int cropPositionPx) { float cropPosition, int cropPositionPx, float horizontalCenter) { mCropBoundary = boundary; mLastCenter = horizontalCenter; boolean touchOnRight = event.getX() > getParentWidth() / 2; float translateXTarget = touchOnRight ? 0 : getParentWidth() - getWidth(); switch (event.getAction()) { Loading Loading
packages/SystemUI/res/values/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,7 @@ <color name="global_screenshot_background_protection_start">#40000000</color> <!-- 25% black --> <!-- Long screenshot UI --> <color name="screenshot_crop_scrim">#9444</color> <color name="screenshot_crop_scrim">#6444</color> <!-- GM2 colors --> <color name="GM2_grey_50">#F8F9FA</color> Loading
packages/SystemUI/src/com/android/systemui/screenshot/CropView.java +161 −107 File changed.Preview size limit exceeded, changes collapsed. Show changes
packages/SystemUI/src/com/android/systemui/screenshot/LongScreenshotActivity.java +8 −7 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ public class LongScreenshotActivity extends Activity { mPreview.addOnLayoutChangeListener( (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> updateCropLocation()); updateImageDimensions()); Intent intent = getIntent(); mScrollCaptureResponse = intent.getParcelableExtra(EXTRA_CAPTURE_RESPONSE); Loading Loading @@ -206,7 +206,7 @@ public class LongScreenshotActivity extends Activity { Log.d(TAG, "onCaptureCompleted(longScreenshot=" + longScreenshot + ")"); mLongScreenshot = longScreenshot; mPreview.setImageDrawable(mLongScreenshot.getDrawable()); updateCropLocation(); updateImageDimensions(); mMagnifierView.setDrawable(mLongScreenshot.getDrawable(), mLongScreenshot.getWidth(), mLongScreenshot.getHeight()); // Original boundaries go from the image tile set's y=0 to y=pageSize, so Loading Loading @@ -363,10 +363,8 @@ public class LongScreenshotActivity extends Activity { return; } Rect bounds = new Rect(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); int height = bounds.height(); bounds.top = (int) (height * mCropView.getTopBoundary()); bounds.bottom = (int) (height * mCropView.getBottomBoundary()); Rect bounds = mCropView.getCropBoundaries(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); if (bounds.isEmpty()) { Log.w(TAG, "Crop bounds empty, skipping export."); Loading Loading @@ -404,7 +402,7 @@ public class LongScreenshotActivity extends Activity { } } private void updateCropLocation() { private void updateImageDimensions() { Drawable drawable = mPreview.getDrawable(); if (drawable == null) { return; Loading @@ -419,9 +417,12 @@ public class LongScreenshotActivity extends Activity { float imageHeight = mPreview.getHeight() * viewRatio / imageRatio; int extraPadding = (int) (mPreview.getHeight() - imageHeight) / 2; mCropView.setExtraPadding(extraPadding, extraPadding); mCropView.setImageWidth(mPreview.getWidth()); } else { // Image is full height mCropView.setExtraPadding(0, 0); mCropView.setImageWidth((int) (mPreview.getHeight() * imageRatio)); } } }
packages/SystemUI/src/com/android/systemui/screenshot/MagnifierView.java +4 −2 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ public class MagnifierView extends View implements CropView.CropInteractionListe private float mCheckerboardBoxSize = 40; private float mLastCropPosition; private float mLastCenter = 0.5f; private CropView.CropBoundary mCropBoundary; private ViewPropertyAnimator mTranslationAnimator; Loading Loading @@ -131,7 +132,7 @@ public class MagnifierView extends View implements CropView.CropInteractionListe canvas.save(); // Translate such that the center of this view represents the center of the crop // boundary. canvas.translate(-mDrawable.getBounds().width() / 2 + getWidth() / 2, canvas.translate(-mDrawable.getBounds().width() * mLastCenter + getWidth() / 2, -mDrawable.getBounds().height() * mLastCropPosition + getHeight() / 2); mDrawable.draw(canvas); canvas.restore(); Loading @@ -148,8 +149,9 @@ public class MagnifierView extends View implements CropView.CropInteractionListe @Override public void onCropMotionEvent(MotionEvent event, CropView.CropBoundary boundary, float cropPosition, int cropPositionPx) { float cropPosition, int cropPositionPx, float horizontalCenter) { mCropBoundary = boundary; mLastCenter = horizontalCenter; boolean touchOnRight = event.getX() > getParentWidth() / 2; float translateXTarget = touchOnRight ? 0 : getParentWidth() - getWidth(); switch (event.getAction()) { Loading