summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoCamera.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2009-06-23 22:18:20 -0700
committerOwen Lin <owenlin@google.com>2009-06-24 11:51:23 -0700
commite239acc2185c5fb47b22a65f78ffa461e19f183c (patch)
treead368fb4be72d829d4af017d3307346ea0887d25 /src/com/android/camera/VideoCamera.java
parent7035b131cd0a8869f7980841988258a70ca76770 (diff)
downloadLegacyCamera-e239acc2185c5fb47b22a65f78ffa461e19f183c.zip
LegacyCamera-e239acc2185c5fb47b22a65f78ffa461e19f183c.tar.gz
LegacyCamera-e239acc2185c5fb47b22a65f78ffa461e19f183c.tar.bz2
Improve switcher to enable drag and drop operations.
Diffstat (limited to 'src/com/android/camera/VideoCamera.java')
-rw-r--r--src/com/android/camera/VideoCamera.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 37b0710..46a735f 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -71,7 +71,8 @@ import java.util.Date;
*/
public class VideoCamera extends Activity implements View.OnClickListener,
ShutterButton.OnShutterButtonListener, SurfaceHolder.Callback,
- MediaRecorder.OnErrorListener, MediaRecorder.OnInfoListener {
+ MediaRecorder.OnErrorListener, MediaRecorder.OnInfoListener,
+ Switcher.OnSwitchListener {
private static final String TAG = "videocamera";
@@ -89,6 +90,9 @@ public class VideoCamera extends Activity implements View.OnClickListener,
private static final int STORAGE_STATUS_LOW = 1;
private static final int STORAGE_STATUS_NONE = 2;
+ private static final boolean SWITCH_CAMERA = true;
+ private static final boolean SWITCH_VIDEO = false;
+
public static final int MENU_SETTINGS = 6;
public static final int MENU_GALLERY_PHOTOS = 7;
public static final int MENU_GALLERY_VIDEOS = 8;
@@ -247,7 +251,11 @@ public class VideoCamera extends Activity implements View.OnClickListener,
mThumbController = new ThumbnailController(mLastPictureButton, mContentResolver);
mLastPictureButton.setOnClickListener(this);
mThumbController.loadData(ImageManager.getLastVideoThumbPath());
- findViewById(R.id.camera_switch).setOnClickListener(this);
+
+ Switcher switcher = ((Switcher) findViewById(R.id.camera_switch));
+ switcher.setSwitch(SWITCH_VIDEO);
+ switcher.setOnSwitchListener(this);
+
} else {
View controlBar = inflater.inflate(R.layout.attach_camera_control, rootView);
controlBar.findViewById(R.id.btn_cancel).setOnClickListener(this);
@@ -299,9 +307,6 @@ public class VideoCamera extends Activity implements View.OnClickListener,
case R.id.btn_retake:
discardCurrentVideoAndInitRecorder();
break;
- case R.id.camera_switch:
- MenuHelper.gotoCameraMode(this);
- break;
case R.id.btn_play:
startPlayVideoActivity();
break;
@@ -1283,4 +1288,10 @@ public class VideoCamera extends Activity implements View.OnClickListener,
mVideoPreview.invalidate();
mHandler.sendEmptyMessageDelayed(UPDATE_RECORD_TIME, 1000);
}
+
+ public void onSwitchChanged(Switcher source, boolean onOff) {
+ if (onOff == SWITCH_CAMERA) {
+ MenuHelper.gotoCameraMode(this);
+ }
+ }
}