|
34 | 34 | import android.graphics.Matrix; |
35 | 35 | import android.graphics.PixelFormat; |
36 | 36 | import android.graphics.PointF; |
| 37 | +import android.hardware.CameraSound; |
37 | 38 | import android.net.Uri; |
38 | 39 | import android.os.AsyncTask; |
39 | 40 | import android.os.Environment; |
|
49 | 50 | import android.view.WindowManager; |
50 | 51 | import android.view.animation.Interpolator; |
51 | 52 | import android.widget.ImageView; |
| 53 | + |
52 | 54 | import com.android.systemui.R; |
53 | 55 |
|
54 | 56 | import java.io.File; |
@@ -254,6 +256,8 @@ class GlobalScreenshot { |
254 | 256 | private float mBgPadding; |
255 | 257 | private float mBgPaddingScale; |
256 | 258 |
|
| 259 | + private CameraSound mCameraSound; |
| 260 | + |
257 | 261 |
|
258 | 262 | /** |
259 | 263 | * @param context everything needs a context :( |
@@ -303,6 +307,9 @@ public boolean onTouch(View v, MotionEvent event) { |
303 | 307 | // Scale has to account for both sides of the bg |
304 | 308 | mBgPadding = (float) r.getDimensionPixelSize(R.dimen.global_screenshot_bg_padding); |
305 | 309 | mBgPaddingScale = mBgPadding / mDisplayMetrics.widthPixels; |
| 310 | + |
| 311 | + // Setup the Camera shutter sound |
| 312 | + mCameraSound = new CameraSound(); |
306 | 313 | } |
307 | 314 |
|
308 | 315 | /** |
@@ -413,6 +420,9 @@ public void onAnimationEnd(Animator animation) { |
413 | 420 | mScreenshotLayout.post(new Runnable() { |
414 | 421 | @Override |
415 | 422 | public void run() { |
| 423 | + // Play the shutter sound to notify that we've taken a screenshot |
| 424 | + mCameraSound.playSound(CameraSound.SHUTTER_CLICK); |
| 425 | + |
416 | 426 | mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, null); |
417 | 427 | mScreenshotView.buildLayer(); |
418 | 428 | mScreenshotAnimation.start(); |
|
0 commit comments