diff options
Diffstat (limited to 'src/com/android/camera/ui/FilmStripView.java')
-rw-r--r-- | src/com/android/camera/ui/FilmStripView.java | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java index fb8fd2e31..709d7c666 100644 --- a/src/com/android/camera/ui/FilmStripView.java +++ b/src/com/android/camera/ui/FilmStripView.java @@ -95,7 +95,7 @@ public class FilmStripView extends ViewGroup { public int getWidth(); public int getHeight(); public int getType(); - public boolean isActionSupported(int action); + public boolean isUIActionSupported(int action); // prepare() should be called first time before using it. public void prepare(); @@ -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); } @@ -1139,11 +1151,11 @@ public class FilmStripView extends ViewGroup { int id = mViewInfo[i].getID(); if (mDataAdapter.getImageData(id) - .isActionSupported(ImageData.ACTION_DEMOTE) + .isUIActionSupported(ImageData.ACTION_DEMOTE) && transY > halfH) { demoteData(i, id); } else if (mDataAdapter.getImageData(id) - .isActionSupported(ImageData.ACTION_PROMOTE) + .isUIActionSupported(ImageData.ACTION_PROMOTE) && transY < -halfH) { promoteData(i, id); } else { @@ -1180,10 +1192,10 @@ public class FilmStripView extends ViewGroup { ImageData data = mDataAdapter.getImageData(mViewInfo[hit].getID()); float transY = mViewInfo[hit].getTranslationY(mScale) - dy / mScale; - if (!data.isActionSupported(ImageData.ACTION_DEMOTE) && transY > 0f) { + if (!data.isUIActionSupported(ImageData.ACTION_DEMOTE) && transY > 0f) { transY = 0f; } - if (!data.isActionSupported(ImageData.ACTION_PROMOTE) && transY < 0f) { + if (!data.isUIActionSupported(ImageData.ACTION_PROMOTE) && transY < 0f) { transY = 0f; } mViewInfo[hit].setTranslationY(transY, mScale); @@ -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(); |