summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorjt1134 <jt1134@gmail.com>2014-01-04 20:52:27 -0600
committerArne Coucheron <arco68@gmail.com>2018-01-26 00:51:48 +0100
commitdce40170eca239b2232c2aa2d5a4489771fdac2b (patch)
treea7812523d016845c890ddf99bb964fd1f79d8a63 /src/com
parent529b1ae0a64bfb02608f3d0ced4cec3dbe1489ff (diff)
downloadandroid_packages_apps_Snap-dce40170eca239b2232c2aa2d5a4489771fdac2b.tar.gz
android_packages_apps_Snap-dce40170eca239b2232c2aa2d5a4489771fdac2b.tar.bz2
android_packages_apps_Snap-dce40170eca239b2232c2aa2d5a4489771fdac2b.zip
Camera2: implement volume key zoom in video mode
Change-Id: I140e8cfb3e39700f60e40c35b38e92c83a3c26de
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/VideoModule.java9
-rwxr-xr-xsrc/com/android/camera/VideoUI.java16
2 files changed, 25 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index e83177716..7c5a88e6f 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1381,6 +1381,12 @@ public class VideoModule implements CameraModule,
}
switch (keyCode) {
+ case KeyEvent.KEYCODE_VOLUME_UP:
+ mUI.onScaleStepResize(true);
+ return true;
+ case KeyEvent.KEYCODE_VOLUME_DOWN:
+ mUI.onScaleStepResize(false);
+ return true;
case KeyEvent.KEYCODE_CAMERA:
if (event.getRepeatCount() == 0) {
mUI.clickShutter();
@@ -1403,6 +1409,9 @@ public class VideoModule implements CameraModule,
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
switch (keyCode) {
+ case KeyEvent.KEYCODE_VOLUME_UP:
+ case KeyEvent.KEYCODE_VOLUME_DOWN:
+ return true;
case KeyEvent.KEYCODE_CAMERA:
mUI.pressShutter(false);
return true;
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 3517372ed..5f86afcd1 100755
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -22,6 +22,7 @@ import org.codeaurora.snapcam.R;
import android.content.res.Configuration;
import android.graphics.Bitmap;
+import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.drawable.ColorDrawable;
@@ -1108,6 +1109,21 @@ public class VideoUI implements PieRenderer.PieListener,
return mCameraControls.getVisibility() == View.VISIBLE;
}
+ public boolean onScaleStepResize(boolean direction)
+ {
+ if(mGestures != null){
+ return mGestures.onScaleStepResize(direction);
+ }
+ return false;
+ }
+
+ public void onScaleChangeDraw(Canvas canvas)
+ {
+ if(mGestures != null){
+ mGestures.onScaleChangeDraw(canvas);
+ }
+ }
+
@Override
public void onDisplayChanged() {
mCameraControls.checkLayoutFlip();