diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index bbc66cf410284..bf192868ffe7b 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -88,4 +88,10 @@
2000dp
+
+ 0dp
+
+ 6dp
+ 0dp
+
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index cf073c46d750b..181cc984c826e 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -19,7 +19,6 @@ package com.android.systemui.screenshot;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
-import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.app.Notification;
@@ -34,6 +33,8 @@ import android.graphics.Bitmap;
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;
@@ -48,9 +49,12 @@ import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
+import com.android.server.wm.WindowManagerService;
import com.android.systemui.R;
import java.io.File;
@@ -65,6 +69,7 @@ class SaveImageInBackgroundData {
Context context;
Bitmap image;
Runnable finisher;
+ int iconSize;
int result;
}
@@ -88,7 +93,15 @@ class SaveImageInBackgroundTask extends AsyncTask imageHeight) {
+ iconWidth = (int) (((float) iconHeight / imageHeight) * imageWidth);
+ } else {
+ iconHeight = (int) (((float) iconWidth / imageWidth) * imageHeight);
+ }
+ Bitmap rawIcon = Bitmap.createScaledBitmap(data.image, iconWidth, iconHeight, true);
+ Bitmap croppedIcon = Bitmap.createBitmap(rawIcon, (iconWidth - data.iconSize) / 2,
+ (iconHeight - data.iconSize) / 2, data.iconSize, data.iconSize);
+
// Show the intermediate notification
mLaunchIntent = new Intent(Intent.ACTION_VIEW);
mLaunchIntent.setDataAndType(Uri.fromFile(new File(mImageFilePath)), "image/png");
mLaunchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mTickerAddSpace = !mTickerAddSpace;
mNotificationId = nId;
mNotificationBuilder = new Notification.Builder(context)
- .setTicker(r.getString(R.string.screenshot_saving_ticker))
+ .setLargeIcon(croppedIcon)
+ .setTicker(r.getString(R.string.screenshot_saving_ticker)
+ + (mTickerAddSpace ? " " : ""))
.setContentTitle(r.getString(R.string.screenshot_saving_title))
.setContentText(r.getString(R.string.screenshot_saving_text))
.setSmallIcon(android.R.drawable.ic_menu_gallery)
@@ -168,7 +198,6 @@ class SaveImageInBackgroundTask extends AsyncTask h) {
+ tmpMinScale = finalBounds.width() / (2f * w);
+ } else {
+ tmpMinScale = finalBounds.height() / (2f * h);
}
- });
+ final float minScale = tmpMinScale;
+
+ // Animate the screenshot to the status bar
+ anim.setDuration(SCREENSHOT_FADE_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);
+ mScreenshotContainerView.setScaleX(scaleT);
+ mScreenshotContainerView.setScaleY(scaleT);
+ mBackgroundView.setAlpha((1f - t) * BACKGROUND_ALPHA);
+ }
+ });
+ }
return anim;
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
index d112b5e46a323..456b5fa7b0a64 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
@@ -46,7 +46,7 @@ public class TakeScreenshotService extends Service {
} catch (RemoteException e) {
}
}
- });
+ }, msg.arg1 > 0, msg.arg2 > 0);
}
}
};
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 8b09e00736573..b9fe18298ca28 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -2614,6 +2614,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
};
msg.replyTo = new Messenger(h);
+ msg.arg1 = msg.arg2 = 0;
+ if (mStatusBar != null && mStatusBar.isVisibleLw())
+ msg.arg1 = 1;
+ if (mNavigationBar != null && mNavigationBar.isVisibleLw())
+ msg.arg2 = 1;
try {
messenger.send(msg);
} catch (RemoteException e) {