diff options
-rw-r--r-- | src/com/android/camera/ActivityBase.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/VideoModule.java | 15 | ||||
-rw-r--r-- | src/com/android/camera/VideoUI.java | 21 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 6 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/category/CategoryAdapter.java | 3 | ||||
-rw-r--r-- | src/com/android/gallery3d/ui/PhotoView.java | 5 |
6 files changed, 49 insertions, 3 deletions
diff --git a/src/com/android/camera/ActivityBase.java b/src/com/android/camera/ActivityBase.java index c3cde8bfc..59bd82c98 100644 --- a/src/com/android/camera/ActivityBase.java +++ b/src/com/android/camera/ActivityBase.java @@ -353,7 +353,7 @@ public abstract class ActivityBase extends AbstractGalleryActivity } } - protected void gotoGallery() { + public void gotoGallery() { // Move the next picture with capture animation. "1" means next. mAppBridge.switchWithCaptureAnimation(1); } diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index f7830a303..2c654fc29 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -91,6 +91,7 @@ public class VideoModule implements CameraModule, private static final int SWITCH_CAMERA = 8; private static final int SWITCH_CAMERA_START_ANIMATION = 9; private static final int HIDE_SURFACE_VIEW = 10; + private static final int CAPTURE_ANIMATION_DONE = 11; private static final int SCREEN_DELAY = 2 * 60 * 1000; @@ -296,6 +297,11 @@ public class VideoModule implements CameraModule, break; } + case CAPTURE_ANIMATION_DONE: { + mUI.enablePreviewThumb(false); + break; + } + default: Log.v(TAG, "Unhandled message: " + msg.what); break; @@ -578,6 +584,14 @@ public class VideoModule implements CameraModule, // the preview. This will cause the preview flicker since the preview // will not be continuous for a short period of time. ((CameraScreenNail) mActivity.mCameraScreenNail).animateCapture(mDisplayRotation); + + mUI.enablePreviewThumb(true); + + // Make sure to disable the thumbnail preview after the + // animation is done to disable the click target. + mHandler.removeMessages(CAPTURE_ANIMATION_DONE); + mHandler.sendEmptyMessageDelayed(CAPTURE_ANIMATION_DONE, + CaptureAnimManager.getAnimationDuration()); } } } @@ -1457,6 +1471,7 @@ public class VideoModule implements CameraModule, private void startVideoRecording() { Log.v(TAG, "startVideoRecording"); + mUI.enablePreviewThumb(false); mActivity.setSwipingEnabled(false); mActivity.updateStorageSpaceAndHint(); diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 0c9457204..dc23ec814 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -76,6 +76,7 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener, private VideoController mController; private int mZoomMax; private List<Integer> mZoomRatios; + private View mPreviewThumb; public VideoUI(CameraActivity activity, VideoController controller, View parent) { mActivity = activity; @@ -227,6 +228,14 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener, mGestures.addTouchReceiver(mReviewPlayButton); } } + + mPreviewThumb = mActivity.findViewById(R.id.preview_thumb); + mPreviewThumb.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + mActivity.gotoGallery(); + } + }); } public void setPrefChangedListener(OnPreferenceChangedListener listener) { @@ -520,4 +529,16 @@ public class VideoUI implements SurfaceHolder.Callback, PieRenderer.PieListener, } } + /** + * Enable or disable the preview thumbnail for click events. + */ + public void enablePreviewThumb(boolean enabled) { + if (enabled) { + mGestures.addTouchReceiver(mPreviewThumb); + mPreviewThumb.setVisibility(View.VISIBLE); + } else { + mGestures.removeTouchReceiver(mPreviewThumb); + mPreviewThumb.setVisibility(View.GONE); + } + } } diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index d13d261a8..e5ddbf5da 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -433,6 +433,9 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL } public void showRepresentation(FilterRepresentation representation) { + if (representation == null) { + return; + } useFilterRepresentation(representation); // show representation @@ -817,7 +820,8 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL loadXML(); loadMainPanel(); - if (!mShowingTinyPlanet) { + // mLoadBitmapTask==null implies you have looked at the intent + if (!mShowingTinyPlanet && (mLoadBitmapTask == null)) { mCategoryFiltersAdapter.removeTinyPlanet(); } final View loading = findViewById(R.id.loading); diff --git a/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java b/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java index 0a65cd92f..4dfaa7fe5 100644 --- a/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java +++ b/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java @@ -34,7 +34,7 @@ import com.android.gallery3d.filtershow.ui.FilterIconButton; public class CategoryAdapter extends ArrayAdapter<Action> { private static final String LOGTAG = "CategoryAdapter"; - private int mItemHeight = 200; + private int mItemHeight; private View mContainer; private int mItemWidth = ListView.LayoutParams.MATCH_PARENT; private boolean mUseFilterIconButton = false; @@ -43,6 +43,7 @@ public class CategoryAdapter extends ArrayAdapter<Action> { public CategoryAdapter(Context context, int textViewResourceId) { super(context, textViewResourceId); + mItemHeight = (int) (context.getResources().getDisplayMetrics().density * 100); } public CategoryAdapter(Context context) { diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 5c8ac1c3e..7afa20348 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -1423,6 +1423,11 @@ public class PhotoView extends GLView { @Override protected void render(GLCanvas canvas) { + if (mFirst) { + // Make sure the fields are properly initialized before checking + // whether isCamera() + mPictures.get(0).reload(); + } // Check if the camera preview occupies the full screen. boolean full = !mFilmMode && mPictures.get(0).isCamera() && mPositionController.isCenter() |