summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/FilmStripView.java
diff options
context:
space:
mode:
authorSanthosh Kumar H E <skhara@codeaurora.org>2013-12-05 16:36:52 +0530
committerSanthosh Kumar H E <skhara@codeaurora.org>2013-12-06 18:58:24 +0530
commitdbdb7620da136374eea95170261032f910015db0 (patch)
tree007242cdb44941ecb855751c85da69aa97cc6a43 /src/com/android/camera/ui/FilmStripView.java
parent1c7734057201ffd1b6d165d9e24793ef3d213043 (diff)
parentdf2b0819907c440a660e228414a18184732816d1 (diff)
downloadandroid_packages_apps_Snap-dbdb7620da136374eea95170261032f910015db0.tar.gz
android_packages_apps_Snap-dbdb7620da136374eea95170261032f910015db0.tar.bz2
android_packages_apps_Snap-dbdb7620da136374eea95170261032f910015db0.zip
Merge remote-tracking branch into merge_branch
Delay onResume tasks to speed up lockscreen onResume->onPause->onResume launch sequence. Import translations. DO NOT MERGE gcam: Clean up placeholders, and add deletion robustness. Fix issue of focus indicator staying on without being hidden Ensure view size gets updated after phone decors change. Show the 100% state of the progress at least one frame. Add parameters and deduplicate parameter changes Revert parallel opening camera in photo mode. Differentiate the InProgressData from the normal PhotoData. Close mode menus if another control is touched Start gcam module directly when handling capture intent. Import translations. DO NOT MERGE Add a null check to fix NPE Add logging to various actions Ensure mOpenCameraThread has been setup before dereferencing. Add logging to various actions Ensure mOpenCameraThread has been setup before dereferencing. Add GCam progress indicator. hide preview cover on arrival of new preview data if hidden Fix photo mode is getting stuck in a single CameraState. ... Conflicts: res/layout/photo_module.xml res/values/arrays.xml src/com/android/camera/CameraActivity.java src/com/android/camera/PhotoUI.java src/com/android/camera/Storage.java src/com/android/camera/WideAnglePanoramaModule.java src/com/android/camera/ui/FilmStripView.java Change-Id: Ic41b4e7e07b2b0ed7936b78a6c5f05270d05985f
Diffstat (limited to 'src/com/android/camera/ui/FilmStripView.java')
-rw-r--r--src/com/android/camera/ui/FilmStripView.java53
1 files changed, 39 insertions, 14 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index 9945952ee..89da0184e 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -43,6 +43,7 @@ import com.android.camera.ui.FilmStripView.ImageData.PanoramaSupportCallback;
import com.android.camera.ui.FilmstripBottomControls.BottomControlsListener;
import com.android.camera.util.CameraUtil;
import com.android.camera.util.PhotoSphereHelper.PanoramaViewHelper;
+import com.android.camera.util.UsageStatistics;
import com.android.camera2.R;
import java.util.Arrays;
@@ -1453,6 +1454,13 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
mController.setSurroundingViewsVisible(true);
}
+ private void hideZoomView() {
+ if (mController.isZoomStarted()) {
+ mController.cancelLoadingZoomedImage();
+ mZoomView.setVisibility(GONE);
+ }
+ }
+
// Keeps the view in the view hierarchy if it's camera preview.
// Remove from the hierarchy otherwise.
private void checkForRemoval(ImageData data, View v) {
@@ -1785,6 +1793,8 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
&& deltaX < mSlop * (-1)) {
// intercept left swipe
if (Math.abs(deltaX) >= Math.abs(deltaY) * 2) {
+ UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
+ UsageStatistics.ACTION_FILMSTRIP, null);
return true;
}
}
@@ -1908,10 +1918,19 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
mController.stopScrolling(true);
mController.stopScale();
mDataIdOnUserScrolling = 0;
- // Remove all views from the mViewItem buffer, except the camera view.
+ // Reload has a side effect that after this call, it will show the
+ // camera preview. So we want to know whether it starts from the camera
+ // preview to decide whether we need to call onDataFocusChanged.
+ boolean stayInPreview = false;
+
if (mListener != null && mViewItem[mCurrentItem] != null) {
- mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), false);
+ stayInPreview = mViewItem[mCurrentItem].getId() == 0;
+ if (!stayInPreview) {
+ mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), false);
+ }
}
+
+ // Remove all views from the mViewItem buffer, except the camera view.
for (int i = 0; i < mViewItem.length; i++) {
if (mViewItem[i] == null) {
continue;
@@ -1920,8 +1939,9 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
if (v != mCameraView) {
removeView(v);
}
- if (mDataAdapter.getImageData(mViewItem[i].getId()) != null) {
- mDataAdapter.getImageData(mViewItem[i].getId()).recycle();
+ ImageData imageData = mDataAdapter.getImageData(mViewItem[i].getId());
+ if (imageData != null) {
+ imageData.recycle();
}
}
@@ -1954,7 +1974,9 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
if (mListener != null) {
mListener.onReload();
- mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), true);
+ if (!stayInPreview) {
+ mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), true);
+ }
}
}
@@ -2625,13 +2647,7 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
if (!mController.stopScrolling(false)) {
return false;
}
- // A down event is usually followed by a gesture, we apply gesture on
- // the lower-res image during a gesture to ensure a responsive experience.
- // TODO: Delay this until gesture starts.
- if (mController.isZoomStarted()) {
- mController.cancelLoadingZoomedImage();
- mZoomView.setVisibility(GONE);
- }
+
return true;
}
@@ -2712,12 +2728,16 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
@Override
public boolean onScroll(float x, float y, float dx, float dy) {
- if (mViewItem[mCurrentItem] == null) {
+ ViewItem currItem = mViewItem[mCurrentItem];
+ if (currItem == null) {
return false;
}
+ if (!mDataAdapter.canSwipeInFullScreen(currItem.getId())) {
+ return false;
+ }
+ hideZoomView();
// When image is zoomed in to be bigger than the screen
if (mController.isZoomStarted()) {
- mController.cancelLoadingZoomedImage();
ViewItem curr = mViewItem[mCurrentItem];
float transX = curr.getTranslationX() - dx;
float transY = curr.getTranslationY() - dy;
@@ -2777,6 +2797,9 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
if (currItem == null) {
return false;
}
+ if (!mDataAdapter.canSwipeInFullScreen(currItem.getId())) {
+ return false;
+ }
if (mController.isZoomStarted()) {
// Fling within the zoomed image
mController.flingInsideZoomView(velocityX, velocityY);
@@ -2837,6 +2860,8 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
if (inCameraFullscreen()) {
return false;
}
+
+ hideZoomView();
mScaleTrend = 1f;
// If the image is smaller than screen size, we should allow to zoom
// in to full screen size