From 45f9b06b31666c2b880c24cf32f1ca8b21435422 Mon Sep 17 00:00:00 2001 From: Angus Kong Date: Wed, 11 Sep 2013 17:48:48 -0700 Subject: Always leave full-screen when swip from camera. bug:10714779 Change-Id: Ifa10f151974ac0598a0c27751e23c77d525d332e --- src/com/android/camera/ui/FilmStripView.java | 15 ++++++--------- 1 file 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. -- cgit v1.2.3