summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjt1134 <jt1134@gmail.com>2014-01-04 20:52:27 -0600
committerMichael Bestas <mikeioannina@gmail.com>2015-09-17 23:26:02 +0300
commit090a890049355881cba3ed6d503aebafae056384 (patch)
tree6184abf23d32718a32a98a3df7e50a9fec8c4693
parent81b41090d9538992c125fec37069ba961fc15bec (diff)
downloadandroid_packages_apps_Snap-090a890049355881cba3ed6d503aebafae056384.zip
android_packages_apps_Snap-090a890049355881cba3ed6d503aebafae056384.tar.gz
android_packages_apps_Snap-090a890049355881cba3ed6d503aebafae056384.tar.bz2
Camera2: implement volume key zoom in video mode
Change-Id: I140e8cfb3e39700f60e40c35b38e92c83a3c26de
-rw-r--r--src/com/android/camera/VideoModule.java9
-rw-r--r--src/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 b85f918..ee06289 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1202,6 +1202,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();
@@ -1224,6 +1230,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 321f6d5..69dd4c6 100644
--- 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;
@@ -989,6 +990,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();