summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-09-13 21:16:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-13 21:16:35 +0000
commita29e0bfcafa292adba7fff2daf0f754627e47137 (patch)
tree666f6dbaccff6727dad480bd94eec68edfa041c2
parent539b9eec067c012d17f482975cf8053e04a11759 (diff)
parent45f9b06b31666c2b880c24cf32f1ca8b21435422 (diff)
downloadandroid_packages_apps_Snap-a29e0bfcafa292adba7fff2daf0f754627e47137.tar.gz
android_packages_apps_Snap-a29e0bfcafa292adba7fff2daf0f754627e47137.tar.bz2
android_packages_apps_Snap-a29e0bfcafa292adba7fff2daf0f754627e47137.zip
Merge "Always leave full-screen when swip from camera." into gb-ub-photos-carlsbad
-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 0d45d6ada..64f8a69d4 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -1030,8 +1030,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);
}
@@ -1155,7 +1156,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".
@@ -1167,6 +1168,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
@@ -2293,11 +2295,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.
@@ -2328,7 +2325,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.