Merge "Fix screenshot to corner animation" into sc-dev
This commit is contained in:
@@ -453,14 +453,6 @@ public class ScreenshotView extends FrameLayout implements
|
|||||||
mCornerSizeX / (mOrientationPortrait ? bounds.width() : bounds.height());
|
mCornerSizeX / (mOrientationPortrait ? bounds.width() : bounds.height());
|
||||||
final float currentScale = 1 / cornerScale;
|
final float currentScale = 1 / cornerScale;
|
||||||
|
|
||||||
mScreenshotPreview.setScaleX(currentScale);
|
|
||||||
mScreenshotPreview.setScaleY(currentScale);
|
|
||||||
|
|
||||||
if (mAccessibilityManager.isEnabled()) {
|
|
||||||
mDismissButton.setAlpha(0);
|
|
||||||
mDismissButton.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimatorSet dropInAnimation = new AnimatorSet();
|
AnimatorSet dropInAnimation = new AnimatorSet();
|
||||||
ValueAnimator flashInAnimator = ValueAnimator.ofFloat(0, 1);
|
ValueAnimator flashInAnimator = ValueAnimator.ofFloat(0, 1);
|
||||||
flashInAnimator.setDuration(SCREENSHOT_FLASH_IN_DURATION_MS);
|
flashInAnimator.setDuration(SCREENSHOT_FLASH_IN_DURATION_MS);
|
||||||
@@ -491,6 +483,20 @@ public class ScreenshotView extends FrameLayout implements
|
|||||||
|
|
||||||
ValueAnimator toCorner = ValueAnimator.ofFloat(0, 1);
|
ValueAnimator toCorner = ValueAnimator.ofFloat(0, 1);
|
||||||
toCorner.setDuration(SCREENSHOT_TO_CORNER_Y_DURATION_MS);
|
toCorner.setDuration(SCREENSHOT_TO_CORNER_Y_DURATION_MS);
|
||||||
|
|
||||||
|
toCorner.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animator animation) {
|
||||||
|
mScreenshotPreview.setScaleX(currentScale);
|
||||||
|
mScreenshotPreview.setScaleY(currentScale);
|
||||||
|
mScreenshotPreview.setVisibility(View.VISIBLE);
|
||||||
|
if (mAccessibilityManager.isEnabled()) {
|
||||||
|
mDismissButton.setAlpha(0);
|
||||||
|
mDismissButton.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
float xPositionPct =
|
float xPositionPct =
|
||||||
SCREENSHOT_TO_CORNER_X_DURATION_MS / (float) SCREENSHOT_TO_CORNER_Y_DURATION_MS;
|
SCREENSHOT_TO_CORNER_X_DURATION_MS / (float) SCREENSHOT_TO_CORNER_Y_DURATION_MS;
|
||||||
float dismissPct =
|
float dismissPct =
|
||||||
@@ -534,13 +540,6 @@ public class ScreenshotView extends FrameLayout implements
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toCorner.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationStart(Animator animation) {
|
|
||||||
mScreenshotPreview.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mScreenshotFlash.setAlpha(0f);
|
mScreenshotFlash.setAlpha(0f);
|
||||||
mScreenshotFlash.setVisibility(View.VISIBLE);
|
mScreenshotFlash.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user