summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-09-11 17:48:48 -0700
committerAngus Kong <shkong@google.com>2013-09-12 15:25:50 -0700
commit45f9b06b31666c2b880c24cf32f1ca8b21435422 (patch)
tree928a5e04c0d4ca5805892809b304f6d1d113cddc
parenta29a0ad0fa7667177025a26d3043cb601ae17a6c (diff)
downloadandroid_packages_apps_Snap-45f9b06b31666c2b880c24cf32f1ca8b21435422.tar.gz
android_packages_apps_Snap-45f9b06b31666c2b880c24cf32f1ca8b21435422.tar.bz2
android_packages_apps_Snap-45f9b06b31666c2b880c24cf32f1ca8b21435422.zip
Always leave full-screen when swip from camera.
bug:10714779 Change-Id: Ifa10f151974ac0598a0c27751e23c77d525d332e
-rw-r--r--src/com/android/camera/ui/FilmStripView.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index 1a67060f3..5e0e35bbe 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -1002,8 +1002,9 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
}
int currentViewCenter = currentItem.getCenterX();
if (mCenterX != currentViewCenter) {
- int snapInTime = SNAP_IN_CENTER_TIME_MS
- * Math.abs(mCenterX - currentViewCenter) / mDrawArea.width();
+ int snapInTime = (int) (SNAP_IN_CENTER_TIME_MS
+ * ((float) Math.abs(mCenterX - currentViewCenter))
+ / mDrawArea.width());
mController.scrollToPosition(currentViewCenter,
snapInTime, false);
}
@@ -1126,7 +1127,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
final int fullScreenWidth = mDrawArea.width() + mViewGap;
// Layout the current ViewItem first.
- if (scaleFraction == 1) {
+ if (scaleFraction == 1f) {
if (mCenterX < mViewItem[mCurrentItem].getCenterX()) {
// In full-screen and it's not the first one and mCenterX is on
// the left of the center, we draw the current one to "fade down".
@@ -1138,6 +1139,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
} else {
mViewItem[mCurrentItem].layoutIn(mDrawArea, mCenterX, mScale);
mViewItem[mCurrentItem].setTranslationX(0f, mScale);
+ mViewItem[mCurrentItem].getView().setAlpha(1f);
}
} else {
// The normal filmstrip has no translation for the current item. If it has
@@ -2237,11 +2239,6 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
int deltaX = (int) (dx / mScale);
if (inFilmStrip()) {
if (Math.abs(dx) > Math.abs(dy)) {
- if (deltaX > 0
- && inFullScreen()
- && getCurrentViewType() == ImageData.TYPE_STICKY_VIEW) {
- mController.goToFilmStrip();
- }
mController.scroll(deltaX);
} else {
// Vertical part. Promote or demote.
@@ -2272,7 +2269,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
mViewItem[hit].setTranslationY(transY, mScale);
}
} else if (inFullScreen()) {
- if (deltaX > 0 && inCameraFullscreen()) {
+ if (deltaX > 0 && getCurrentViewType() == ImageData.TYPE_STICKY_VIEW) {
mController.goToFilmStrip();
}
// Multiplied by 1.2 to make it more easy to swipe.