From 22ca09595d4b6f4301414f26d6d502eb0e989a88 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 20 Oct 2011 19:44:32 -0700 Subject: Last update for screenshot animations for MR0. (Bug: 5333706) - Also adding proper border asset Change-Id: I423389d1a68498b2e470e6d483f5b7542a814c31 --- .../global_screenshot_background.9.png | Bin 358 -> 0 bytes .../res/drawable-hdpi/screenshot_panel.9.png | Bin 0 -> 595 bytes .../global_screenshot_background.9.png | Bin 358 -> 0 bytes .../res/drawable-mdpi/screenshot_panel.9.png | Bin 0 -> 404 bytes .../global_screenshot_background.9.png | Bin 671 -> 0 bytes .../res/drawable-xhdpi/screenshot_panel.9.png | Bin 0 -> 797 bytes packages/SystemUI/res/layout/global_screenshot.xml | 7 +- packages/SystemUI/res/values/dimens.xml | 5 +- .../systemui/screenshot/GlobalScreenshot.java | 153 +++++++++++++-------- 9 files changed, 99 insertions(+), 66 deletions(-) delete mode 100644 packages/SystemUI/res/drawable-hdpi/global_screenshot_background.9.png create mode 100644 packages/SystemUI/res/drawable-hdpi/screenshot_panel.9.png delete mode 100644 packages/SystemUI/res/drawable-mdpi/global_screenshot_background.9.png create mode 100644 packages/SystemUI/res/drawable-mdpi/screenshot_panel.9.png delete mode 100644 packages/SystemUI/res/drawable-xhdpi/global_screenshot_background.9.png create mode 100644 packages/SystemUI/res/drawable-xhdpi/screenshot_panel.9.png diff --git a/packages/SystemUI/res/drawable-hdpi/global_screenshot_background.9.png b/packages/SystemUI/res/drawable-hdpi/global_screenshot_background.9.png deleted file mode 100644 index e14111dae168..000000000000 Binary files a/packages/SystemUI/res/drawable-hdpi/global_screenshot_background.9.png and /dev/null differ diff --git a/packages/SystemUI/res/drawable-hdpi/screenshot_panel.9.png b/packages/SystemUI/res/drawable-hdpi/screenshot_panel.9.png new file mode 100644 index 000000000000..9447e01d8af5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/screenshot_panel.9.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/global_screenshot_background.9.png b/packages/SystemUI/res/drawable-mdpi/global_screenshot_background.9.png deleted file mode 100644 index e14111dae168..000000000000 Binary files a/packages/SystemUI/res/drawable-mdpi/global_screenshot_background.9.png and /dev/null differ diff --git a/packages/SystemUI/res/drawable-mdpi/screenshot_panel.9.png b/packages/SystemUI/res/drawable-mdpi/screenshot_panel.9.png new file mode 100644 index 000000000000..7f1aea1da7f3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/screenshot_panel.9.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/global_screenshot_background.9.png b/packages/SystemUI/res/drawable-xhdpi/global_screenshot_background.9.png deleted file mode 100644 index db116b125046..000000000000 Binary files a/packages/SystemUI/res/drawable-xhdpi/global_screenshot_background.9.png and /dev/null differ diff --git a/packages/SystemUI/res/drawable-xhdpi/screenshot_panel.9.png b/packages/SystemUI/res/drawable-xhdpi/screenshot_panel.9.png new file mode 100644 index 000000000000..e5cfc364cc23 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/screenshot_panel.9.png differ diff --git a/packages/SystemUI/res/layout/global_screenshot.xml b/packages/SystemUI/res/layout/global_screenshot.xml index 6d70135d5187..d416af929680 100644 --- a/packages/SystemUI/res/layout/global_screenshot.xml +++ b/packages/SystemUI/res/layout/global_screenshot.xml @@ -26,11 +26,16 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:background="@drawable/global_screenshot_background" + android:background="@drawable/screenshot_panel" android:visibility="gone"> + diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index bf192868ffe7..55b722b12473 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -89,9 +89,6 @@ 2000dp - 0dp - - 6dp - 0dp + 20dp diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java index cc1b8ed12c91..6549610fe682 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -34,7 +34,6 @@ import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.PixelFormat; import android.graphics.PointF; -import android.graphics.RectF; import android.net.Uri; import android.os.AsyncTask; import android.os.Environment; @@ -52,6 +51,7 @@ import android.view.ViewGroup; import android.view.WindowManager; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; +import android.view.animation.Interpolator; import android.widget.FrameLayout; import android.widget.ImageView; @@ -229,15 +229,18 @@ class SaveImageInBackgroundTask extends AsyncTask h) { - tmpMinScale = finalBounds.width() / (2f * w); - } else { - tmpMinScale = finalBounds.height() / (2f * h); - } - final float minScale = tmpMinScale; + final float offsetPct = SCREENSHOT_DROP_OUT_MIN_SCALE_OFFSET; + final PointF finalPos = new PointF( + -halfScreenWidth + (SCREENSHOT_DROP_OUT_MIN_SCALE + offsetPct) * halfScreenWidth, + -halfScreenHeight + (SCREENSHOT_DROP_OUT_MIN_SCALE + offsetPct) * halfScreenHeight); // Animate the screenshot to the status bar - anim.setDuration(SCREENSHOT_FADE_OUT_DURATION); + anim.setDuration(SCREENSHOT_DROP_OUT_DURATION); anim.addUpdateListener(new AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { float t = ((Float) animation.getAnimatedValue()).floatValue(); - float scaleT = minScale - + (float) (1f - t) * (SCREENSHOT_SCALE - minScale - mBgPaddingScale) - + mBgPaddingScale; - mScreenshotContainerView.setAlpha(d.getInterpolation(1f - t)); - mScreenshotContainerView.setTranslationX(d.getInterpolation(t) * finalPos.x); - mScreenshotContainerView.setTranslationY(d.getInterpolation(t) * finalPos.y); + float scaleT = (SCREENSHOT_DROP_IN_MIN_SCALE + mBgPaddingScale) + - (float) scaleInterpolator.getInterpolation(t) + * (SCREENSHOT_DROP_IN_MIN_SCALE - SCREENSHOT_DROP_OUT_MIN_SCALE); + mBackgroundView.setAlpha((1f - t) * BACKGROUND_ALPHA); + mScreenshotContainerView.setAlpha(1f - scaleInterpolator.getInterpolation(t)); mScreenshotContainerView.setScaleX(scaleT); mScreenshotContainerView.setScaleY(scaleT); - mBackgroundView.setAlpha((1f - t) * BACKGROUND_ALPHA); + mScreenshotContainerView.setTranslationX(t * finalPos.x); + mScreenshotContainerView.setTranslationY(t * finalPos.y); } }); } -- cgit v1.2.3-59-g8ed1b