summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/NewCameraActivity.java5
-rw-r--r--src/com/android/camera/NewCameraModule.java2
-rw-r--r--src/com/android/camera/NewPhotoModule.java18
-rw-r--r--src/com/android/camera/NewPhotoUI.java30
-rw-r--r--src/com/android/camera/NewVideoModule.java4
-rw-r--r--src/com/android/camera/NewVideoUI.java24
-rw-r--r--src/com/android/camera/ui/FilmStripView.java19
-rw-r--r--src/com/android/camera/ui/NewCameraRootView.java11
-rw-r--r--src/com/android/camera/ui/RenderOverlay.java5
9 files changed, 57 insertions, 61 deletions
diff --git a/src/com/android/camera/NewCameraActivity.java b/src/com/android/camera/NewCameraActivity.java
index 69d7cea8a..fd2056f80 100644
--- a/src/com/android/camera/NewCameraActivity.java
+++ b/src/com/android/camera/NewCameraActivity.java
@@ -193,6 +193,11 @@ public class NewCameraActivity extends Activity
@Override
public void onDataFullScreenChange(int dataID, boolean full) {
}
+
+ @Override
+ public void onSwitchMode(boolean toCamera) {
+ mCurrentModule.onSwitchMode(toCamera);
+ }
});
mCurrentModule = new NewPhotoModule();
mCurrentModule.init(this, mRootView);
diff --git a/src/com/android/camera/NewCameraModule.java b/src/com/android/camera/NewCameraModule.java
index 35452bb3c..a98c95247 100644
--- a/src/com/android/camera/NewCameraModule.java
+++ b/src/com/android/camera/NewCameraModule.java
@@ -26,7 +26,7 @@ public interface NewCameraModule {
public void init(NewCameraActivity activity, View frame);
- public void onFullScreenChanged(boolean full);
+ public void onSwitchMode(boolean toCamera);
public void onPauseBeforeSuper();
diff --git a/src/com/android/camera/NewPhotoModule.java b/src/com/android/camera/NewPhotoModule.java
index 55eb0e46f..6e306e48f 100644
--- a/src/com/android/camera/NewPhotoModule.java
+++ b/src/com/android/camera/NewPhotoModule.java
@@ -2020,6 +2020,12 @@ public class NewPhotoModule
mHeading += 360;
}
}
+
+ @Override
+ public void onSwitchMode(boolean toCamera) {
+ mUI.onSwitchMode(toCamera);
+ }
+
/* Below is no longer needed, except to get rid of compile error
* TODO: Remove these
*/
@@ -2028,16 +2034,4 @@ public class NewPhotoModule
@Override
public void onRestorePreferencesClicked() {}
- @Override
- public void onFullScreenChanged(boolean full) {
- /* //TODO:
- mUI.onFullScreenChanged(full);
- if (ApiHelper.HAS_SURFACE_TEXTURE) {
- if (mActivity.mCameraScreenNail != null) {
- ((CameraScreenNail) mActivity.mCameraScreenNail).setFullScreen(full);
- }
- return;
- } */
- }
-
}
diff --git a/src/com/android/camera/NewPhotoUI.java b/src/com/android/camera/NewPhotoUI.java
index 15b9409ed..a049787b1 100644
--- a/src/com/android/camera/NewPhotoUI.java
+++ b/src/com/android/camera/NewPhotoUI.java
@@ -366,14 +366,11 @@ public class NewPhotoUI implements PieListener,
public void hideUI() {
mCameraControls.setVisibility(View.INVISIBLE);
- hideSwitcher();
- mShutterButton.setVisibility(View.GONE);
+ mSwitcher.closePopup();
}
public void showUI() {
mCameraControls.setVisibility(View.VISIBLE);
- showSwitcher();
- mShutterButton.setVisibility(View.VISIBLE);
}
public void hideSwitcher() {
@@ -384,7 +381,6 @@ public class NewPhotoUI implements PieListener,
public void showSwitcher() {
mSwitcher.setVisibility(View.VISIBLE);
}
-
// called from onResume but only the first time
public void initializeFirstTime() {
// Initialize shutter button.
@@ -482,28 +478,30 @@ public class NewPhotoUI implements PieListener,
}
}
- public void onFullScreenChanged(boolean full) {
+ public void onSwitchMode(boolean toCamera) {
+ if (toCamera) {
+ showUI();
+ } else {
+ hideUI();
+ }
if (mFaceView != null) {
- mFaceView.setBlockDraw(!full);
+ mFaceView.setBlockDraw(!toCamera);
}
if (mPopup != null) {
- dismissPopup(full);
+ dismissPopup(toCamera);
}
if (mGestures != null) {
- mGestures.setEnabled(full);
+ mGestures.setEnabled(toCamera);
}
if (mRenderOverlay != null) {
// this can not happen in capture mode
- mRenderOverlay.setVisibility(full ? View.VISIBLE : View.GONE);
+ mRenderOverlay.setVisibility(toCamera ? View.VISIBLE : View.GONE);
}
if (mPieRenderer != null) {
- mPieRenderer.setBlockFocus(!full);
- }
- setShowMenu(full);
- if (mBlocker != null) {
- mBlocker.setVisibility(full ? View.VISIBLE : View.GONE);
+ mPieRenderer.setBlockFocus(!toCamera);
}
- if (!full && mCountDownView != null) mCountDownView.cancelCountDown();
+ setShowMenu(toCamera);
+ if (!toCamera && mCountDownView != null) mCountDownView.cancelCountDown();
}
public void enablePreviewThumb(boolean enabled) {
diff --git a/src/com/android/camera/NewVideoModule.java b/src/com/android/camera/NewVideoModule.java
index 87899a249..9b6f59ba8 100644
--- a/src/com/android/camera/NewVideoModule.java
+++ b/src/com/android/camera/NewVideoModule.java
@@ -2141,8 +2141,8 @@ public class NewVideoModule implements NewCameraModule,
}
@Override
- public void onFullScreenChanged(boolean full) {
- mUI.onFullScreenChanged(full);
+ public void onSwitchMode(boolean toCamera) {
+ mUI.onSwitchMode(toCamera);
}
private final class JpegPictureCallback implements PictureCallback {
diff --git a/src/com/android/camera/NewVideoUI.java b/src/com/android/camera/NewVideoUI.java
index 35676aff5..b0c9c507f 100644
--- a/src/com/android/camera/NewVideoUI.java
+++ b/src/com/android/camera/NewVideoUI.java
@@ -269,14 +269,11 @@ public class NewVideoUI implements PieRenderer.PieListener,
public void hideUI() {
mCameraControls.setVisibility(View.INVISIBLE);
- hideSwitcher();
- mShutterButton.setVisibility(View.GONE);
+ mSwitcher.closePopup();
}
public void showUI() {
mCameraControls.setVisibility(View.VISIBLE);
- showSwitcher();
- mShutterButton.setVisibility(View.VISIBLE);
}
public void hideSwitcher() {
@@ -562,22 +559,23 @@ public class NewVideoUI implements PieRenderer.PieListener,
}
}
- public void onFullScreenChanged(boolean full) {
+ public void onSwitchMode(boolean toCamera) {
+ if (toCamera) {
+ showUI();
+ } else {
+ hideUI();
+ }
if (mGestures != null) {
- mGestures.setEnabled(full);
+ mGestures.setEnabled(toCamera);
}
if (mPopup != null) {
- dismissPopup(false, full);
+ dismissPopup(false, toCamera);
}
if (mRenderOverlay != null) {
// this can not happen in capture mode
- mRenderOverlay.setVisibility(full ? View.VISIBLE : View.GONE);
- }
- setShowMenu(full);
- if (mBlocker != null) {
- // this can not happen in capture mode
- mBlocker.setVisibility(full ? View.VISIBLE : View.GONE);
+ mRenderOverlay.setVisibility(toCamera ? View.VISIBLE : View.GONE);
}
+ setShowMenu(toCamera);
}
public void initializePopup(PreferenceGroup pref) {
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index fb8fd2e31..8af30db3f 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -137,6 +137,7 @@ public class FilmStripView extends ViewGroup {
public void onDataPromoted(int dataID);
public void onDataDemoted(int dataID);
public void onDataFullScreenChange(int dataID, boolean full);
+ public void onSwitchMode(boolean toCamera);
}
public interface Controller {
@@ -455,7 +456,7 @@ public class FilmStripView extends ViewGroup {
if (getCurrentType() == ImageData.TYPE_CAMERA_PREVIEW
&& !mController.isScalling()
&& mScale != MAX_SCALE) {
- mController.scaleTo(MAX_SCALE, DURATION_GEOMETRY_ADJUST);
+ mController.gotoFullScreen();
}
}
if (curr.getID() == mDataAdapter.getTotalNumber() - 1
@@ -1056,10 +1057,21 @@ public class FilmStripView extends ViewGroup {
public void gotoFilmStrip() {
unlockPosition();
scaleTo(FILM_STRIP_SCALE, DURATION_GEOMETRY_ADJUST);
+ if (mListener != null) {
+ mListener.onSwitchMode(false);
+ }
}
@Override
public void gotoFullScreen() {
+ if (mListener != null) {
+ // TODO: After full size images snapping to fill the screen at the
+ // end of a scroll/fling is implemented, we should only make
+ // this call when the view on the center of the screen is
+ // camera preview
+ mListener.onSwitchMode(true);
+ }
+ if (mScale == 1f) return;
scaleTo(1f, DURATION_GEOMETRY_ADJUST);
}
@@ -1229,10 +1241,7 @@ public class FilmStripView extends ViewGroup {
@Override
public void onScaleEnd() {
if (mScaleTrend >= 1f) {
- if (mScale != 1f) {
- mController.gotoFullScreen();
- }
-
+ mController.gotoFullScreen();
if (getCurrentType() == ImageData.TYPE_CAMERA_PREVIEW) {
if (isAnchoredTo(0)) {
mController.lockAtCurrentView();
diff --git a/src/com/android/camera/ui/NewCameraRootView.java b/src/com/android/camera/ui/NewCameraRootView.java
index 710d6d304..07b6ec623 100644
--- a/src/com/android/camera/ui/NewCameraRootView.java
+++ b/src/com/android/camera/ui/NewCameraRootView.java
@@ -181,15 +181,4 @@ public class NewCameraRootView extends FrameLayout {
}
}
}
-
- @Override
- public boolean dispatchTouchEvent(MotionEvent ev) {
- //TODO: This scale check is temporary, should be removed once full screen notification
- // is implemented
- if (((View) getParent()).getScaleX() == 1.0f) {
- return super.dispatchTouchEvent(ev);
- } else {
- return false;
- }
- }
}
diff --git a/src/com/android/camera/ui/RenderOverlay.java b/src/com/android/camera/ui/RenderOverlay.java
index 0bda10a23..c61103018 100644
--- a/src/com/android/camera/ui/RenderOverlay.java
+++ b/src/com/android/camera/ui/RenderOverlay.java
@@ -89,7 +89,10 @@ public class RenderOverlay extends FrameLayout {
@Override
public boolean dispatchTouchEvent(MotionEvent m) {
- if (mGestures != null) mGestures.dispatchTouch(m);
+ if (mGestures != null) {
+ if (!mGestures.isEnabled()) return false;
+ mGestures.dispatchTouch(m);
+ }
return true;
}