OSDN Git Service

Several secure album changes.
authorWu-cheng Li <wuchengli@google.com>
Thu, 27 Sep 2012 06:01:39 +0000 (14:01 +0800)
committerWu-cheng Li <wuchengli@google.com>
Thu, 27 Sep 2012 07:13:56 +0000 (15:13 +0800)
- Make the lock screen photo be a standard portrait size photo
- In the filmstrip, have the first tap on the lock screen photo
  take the user directly to the unlock screen.
- Switch the asset to be a "locked" lock rather than an
  "unlocked" lock.

bug:7192331

Change-Id: If7541cd67cdfb711f8dd721796db3343ae91343a

src/com/android/gallery3d/data/UnlockImage.java
src/com/android/gallery3d/ui/PhotoView.java

index 68e6f0f..d09856d 100644 (file)
@@ -59,7 +59,7 @@ public class UnlockImage extends MediaItem {
         public Bitmap run(JobContext jc) {
             int targetSize = MediaItem.getTargetSize(mType);
             Bitmap bitmap = BitmapFactory.decodeResource(mApplication.getResources(),
-                    R.drawable.ic_lockscreen_unlock_normal);
+                    R.drawable.ic_lockscreen_handle_normal);
 
             if (mType == MediaItem.TYPE_MICROTHUMBNAIL) {
                 bitmap = BitmapUtils.resizeAndCropCenter(bitmap, targetSize, true);
index 1cd5e26..2fbc3ff 100644 (file)
@@ -964,9 +964,18 @@ public class PhotoView extends GLView {
 
             if (mFilmMode && !mDownInScrolling) {
                 switchToHitPicture((int) (x + 0.5f), (int) (y + 0.5f));
-                setFilmMode(false);
-                mIgnoreUpEvent = true;
-                return true;
+
+                // If this is a lock screen photo, let the listener handle the
+                // event. Tapping on lock screen photo should take the user
+                // directly to the lock screen.
+                MediaItem item = mModel.getMediaItem(0);
+                int supported = 0;
+                if (item != null) supported = item.getSupportedOperations();
+                if ((supported & MediaItem.SUPPORT_UNLOCK) == 0) {
+                    setFilmMode(false);
+                    mIgnoreUpEvent = true;
+                    return true;
+                }
             }
 
             if (mListener != null) {