OSDN Git Service

Create separate project for Wallpaper Picker
authorMichael Jurka <mikejurka@google.com>
Thu, 12 Dec 2013 14:04:25 +0000 (15:04 +0100)
committerMichael Jurka <mikejurka@google.com>
Fri, 13 Dec 2013 11:50:32 +0000 (12:50 +0100)
Change-Id: Id9e855780b9fb68c63eb6e9f6c19bcbce28a6fd5

100 files changed:
Android.mk
AndroidManifest.xml
WallpaperPicker/AndroidManifest.xml [new file with mode: 0644]
WallpaperPicker/README [new file with mode: 0644]
WallpaperPicker/res/drawable-hdpi/ic_actionbar_accept.png [moved from wallpaper_picker_res/drawable-hdpi/ic_actionbar_accept.png with 100% similarity]
WallpaperPicker/res/drawable-hdpi/ic_images.png [moved from wallpaper_picker_res/drawable-hdpi/ic_images.png with 100% similarity]
WallpaperPicker/res/drawable-hdpi/tile_picker_focused.9.png [moved from wallpaper_picker_res/drawable-hdpi/tile_picker_focused.9.png with 100% similarity]
WallpaperPicker/res/drawable-hdpi/tile_picker_pressed.9.png [moved from wallpaper_picker_res/drawable-hdpi/tile_picker_pressed.9.png with 100% similarity]
WallpaperPicker/res/drawable-hdpi/tile_picker_selected.9.png [moved from wallpaper_picker_res/drawable-hdpi/tile_picker_selected.9.png with 100% similarity]
WallpaperPicker/res/drawable-hdpi/tile_shadow_bottom.9.png [moved from wallpaper_picker_res/drawable-hdpi/tile_shadow_bottom.9.png with 100% similarity]
WallpaperPicker/res/drawable-hdpi/tile_shadow_top.9.png [moved from wallpaper_picker_res/drawable-hdpi/tile_shadow_top.9.png with 100% similarity]
WallpaperPicker/res/drawable-mdpi/ic_actionbar_accept.png [moved from wallpaper_picker_res/drawable-mdpi/ic_actionbar_accept.png with 100% similarity]
WallpaperPicker/res/drawable-mdpi/ic_images.png [moved from wallpaper_picker_res/drawable-mdpi/ic_images.png with 100% similarity]
WallpaperPicker/res/drawable-mdpi/tile_picker_focused.9.png [moved from wallpaper_picker_res/drawable-mdpi/tile_picker_focused.9.png with 100% similarity]
WallpaperPicker/res/drawable-mdpi/tile_picker_pressed.9.png [moved from wallpaper_picker_res/drawable-mdpi/tile_picker_pressed.9.png with 100% similarity]
WallpaperPicker/res/drawable-mdpi/tile_picker_selected.9.png [moved from wallpaper_picker_res/drawable-mdpi/tile_picker_selected.9.png with 100% similarity]
WallpaperPicker/res/drawable-mdpi/tile_shadow_bottom.9.png [moved from wallpaper_picker_res/drawable-mdpi/tile_shadow_bottom.9.png with 100% similarity]
WallpaperPicker/res/drawable-mdpi/tile_shadow_top.9.png [moved from wallpaper_picker_res/drawable-mdpi/tile_shadow_top.9.png with 100% similarity]
WallpaperPicker/res/drawable-xhdpi/ic_actionbar_accept.png [moved from wallpaper_picker_res/drawable-xhdpi/ic_actionbar_accept.png with 100% similarity]
WallpaperPicker/res/drawable-xhdpi/ic_images.png [moved from wallpaper_picker_res/drawable-xhdpi/ic_images.png with 100% similarity]
WallpaperPicker/res/drawable-xhdpi/tile_picker_focused.9.png [moved from wallpaper_picker_res/drawable-xhdpi/tile_picker_focused.9.png with 100% similarity]
WallpaperPicker/res/drawable-xhdpi/tile_picker_pressed.9.png [moved from wallpaper_picker_res/drawable-xhdpi/tile_picker_pressed.9.png with 100% similarity]
WallpaperPicker/res/drawable-xhdpi/tile_picker_selected.9.png [moved from wallpaper_picker_res/drawable-xhdpi/tile_picker_selected.9.png with 100% similarity]
WallpaperPicker/res/drawable-xhdpi/tile_shadow_bottom.9.png [moved from wallpaper_picker_res/drawable-xhdpi/tile_shadow_bottom.9.png with 100% similarity]
WallpaperPicker/res/drawable-xhdpi/tile_shadow_top.9.png [moved from wallpaper_picker_res/drawable-xhdpi/tile_shadow_top.9.png with 100% similarity]
WallpaperPicker/res/drawable-xxhdpi/ic_images.png [moved from wallpaper_picker_res/drawable-xxhdpi/ic_images.png with 100% similarity]
WallpaperPicker/res/drawable-xxhdpi/tile_picker_focused.9.png [moved from wallpaper_picker_res/drawable-xxhdpi/tile_picker_focused.9.png with 100% similarity]
WallpaperPicker/res/drawable-xxhdpi/tile_picker_pressed.9.png [moved from wallpaper_picker_res/drawable-xxhdpi/tile_picker_pressed.9.png with 100% similarity]
WallpaperPicker/res/drawable-xxhdpi/tile_picker_selected.9.png [moved from wallpaper_picker_res/drawable-xxhdpi/tile_picker_selected.9.png with 100% similarity]
WallpaperPicker/res/drawable-xxhdpi/tile_shadow_bottom.9.png [moved from wallpaper_picker_res/drawable-xxhdpi/tile_shadow_bottom.9.png with 100% similarity]
WallpaperPicker/res/drawable-xxhdpi/tile_shadow_top.9.png [moved from wallpaper_picker_res/drawable-xxhdpi/tile_shadow_top.9.png with 100% similarity]
WallpaperPicker/res/drawable/wallpaper_tile_fg.xml [moved from wallpaper_picker_res/drawable/wallpaper_tile_fg.xml with 100% similarity]
WallpaperPicker/res/layout/actionbar_set_wallpaper.xml [moved from wallpaper_picker_res/layout/actionbar_set_wallpaper.xml with 100% similarity]
WallpaperPicker/res/layout/wallpaper_cropper.xml [moved from wallpaper_picker_res/layout/wallpaper_cropper.xml with 100% similarity]
WallpaperPicker/res/layout/wallpaper_picker.xml [moved from wallpaper_picker_res/layout/wallpaper_picker.xml with 100% similarity]
WallpaperPicker/res/layout/wallpaper_picker_image_picker_item.xml [moved from wallpaper_picker_res/layout/wallpaper_picker_image_picker_item.xml with 100% similarity]
WallpaperPicker/res/layout/wallpaper_picker_item.xml [moved from wallpaper_picker_res/layout/wallpaper_picker_item.xml with 100% similarity]
WallpaperPicker/res/layout/wallpaper_picker_live_wallpaper_item.xml [moved from wallpaper_picker_res/layout/wallpaper_picker_live_wallpaper_item.xml with 100% similarity]
WallpaperPicker/res/layout/wallpaper_picker_third_party_item.xml [moved from wallpaper_picker_res/layout/wallpaper_picker_third_party_item.xml with 100% similarity]
WallpaperPicker/res/menu/cab_delete_wallpapers.xml [moved from wallpaper_picker_res/menu/cab_delete_wallpapers.xml with 100% similarity]
WallpaperPicker/res/mipmap-hdpi/ic_launcher_wallpaper.png [moved from wallpaper_picker_res/mipmap-hdpi/ic_launcher_wallpaper.png with 100% similarity]
WallpaperPicker/res/mipmap-mdpi/ic_launcher_wallpaper.png [moved from wallpaper_picker_res/mipmap-mdpi/ic_launcher_wallpaper.png with 100% similarity]
WallpaperPicker/res/mipmap-xhdpi/ic_launcher_wallpaper.png [moved from wallpaper_picker_res/mipmap-xhdpi/ic_launcher_wallpaper.png with 100% similarity]
WallpaperPicker/res/mipmap-xxhdpi/ic_launcher_wallpaper.png [moved from wallpaper_picker_res/mipmap-xxhdpi/ic_launcher_wallpaper.png with 100% similarity]
WallpaperPicker/res/values-nodpi/wallpapers.xml [moved from wallpaper_picker_res/values-nodpi/wallpapers.xml with 100% similarity]
WallpaperPicker/res/values-sw600dp/config.xml [new file with mode: 0644]
WallpaperPicker/res/values-sw720dp/dimens.xml [moved from wallpaper_picker_res/values-sw720dp/dimens.xml with 100% similarity]
WallpaperPicker/res/values-sw720dp/styles.xml [moved from wallpaper_picker_res/values-sw720dp/styles.xml with 100% similarity]
WallpaperPicker/res/values/colors.xml [moved from wallpaper_picker_res/values/colors.xml with 100% similarity]
WallpaperPicker/res/values/config.xml [new file with mode: 0644]
WallpaperPicker/res/values/dimens.xml [moved from wallpaper_picker_res/values/dimens.xml with 100% similarity]
WallpaperPicker/res/values/strings.xml [moved from wallpaper_picker_res/values/strings.xml with 100% similarity]
WallpaperPicker/res/values/styles.xml [moved from wallpaper_picker_res/values/styles.xml with 100% similarity]
WallpaperPicker/src/android/util/Pools.java [moved from wallpaper_picker_src/android/util/Pools.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/common/BitmapUtils.java [moved from wallpaper_picker_src/com/android/gallery3d/common/BitmapUtils.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/common/Utils.java [moved from wallpaper_picker_src/com/android/gallery3d/common/Utils.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ByteBufferInputStream.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ByteBufferInputStream.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/CountedDataInputStream.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/CountedDataInputStream.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifData.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifData.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifInterface.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifInterface.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifInvalidFormatException.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifInvalidFormatException.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifModifier.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifModifier.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifOutputStream.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifOutputStream.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifParser.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifParser.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifReader.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifReader.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/ExifTag.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/ExifTag.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/IfdData.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/IfdData.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/IfdId.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/IfdId.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/JpegHeader.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/JpegHeader.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/OrderedDataOutputStream.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/OrderedDataOutputStream.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/exif/Rational.java [moved from wallpaper_picker_src/com/android/gallery3d/exif/Rational.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/BasicTexture.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/BasicTexture.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/BitmapTexture.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/BitmapTexture.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/GLCanvas.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/GLCanvas.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/GLES20Canvas.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/GLES20Canvas.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/GLES20IdImpl.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/GLES20IdImpl.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/GLId.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/GLId.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/GLPaint.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/GLPaint.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/RawTexture.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/RawTexture.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/Texture.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/Texture.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/glrenderer/UploadedTexture.java [moved from wallpaper_picker_src/com/android/gallery3d/glrenderer/UploadedTexture.java with 100% similarity]
WallpaperPicker/src/com/android/gallery3d/util/IntArray.java [moved from wallpaper_picker_src/com/android/gallery3d/util/IntArray.java with 100% similarity]
WallpaperPicker/src/com/android/launcher3/CheckableFrameLayout.java [moved from src/com/android/launcher3/CheckableFrameLayout.java with 100% similarity]
WallpaperPicker/src/com/android/launcher3/CropView.java [moved from wallpaper_picker_src/com/android/launcher3/CropView.java with 100% similarity]
WallpaperPicker/src/com/android/launcher3/DrawableTileSource.java [moved from wallpaper_picker_src/com/android/launcher3/DrawableTileSource.java with 100% similarity]
WallpaperPicker/src/com/android/launcher3/LiveWallpaperListAdapter.java [moved from wallpaper_picker_src/com/android/launcher3/LiveWallpaperListAdapter.java with 98% similarity]
WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java [moved from wallpaper_picker_src/com/android/launcher3/SavedWallpaperImages.java with 100% similarity]
WallpaperPicker/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java [moved from wallpaper_picker_src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java with 97% similarity]
WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java [moved from wallpaper_picker_src/com/android/launcher3/WallpaperCropActivity.java with 100% similarity]
WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java [moved from wallpaper_picker_src/com/android/launcher3/WallpaperPickerActivity.java with 97% similarity]
WallpaperPicker/src/com/android/launcher3/WallpaperRootView.java [moved from wallpaper_picker_src/com/android/launcher3/WallpaperRootView.java with 100% similarity]
WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java [moved from wallpaper_picker_src/com/android/photos/BitmapRegionTileSource.java with 100% similarity]
WallpaperPicker/src/com/android/photos/views/BlockingGLTextureView.java [moved from wallpaper_picker_src/com/android/photos/views/BlockingGLTextureView.java with 100% similarity]
WallpaperPicker/src/com/android/photos/views/TiledImageRenderer.java [moved from wallpaper_picker_src/com/android/photos/views/TiledImageRenderer.java with 100% similarity]
WallpaperPicker/src/com/android/photos/views/TiledImageView.java [moved from wallpaper_picker_src/com/android/photos/views/TiledImageView.java with 100% similarity]
src/com/android/launcher3/Launcher.java
src/com/android/launcher3/LauncherWallpaperPickerActivity.java [new file with mode: 0644]
src/com/android/launcher3/Utilities.java
src/com/android/launcher3/Workspace.java
update_system_wallpaper_cropper.py

index 840b161..dbce33f 100644 (file)
@@ -26,10 +26,10 @@ LOCAL_MODULE_TAGS := optional
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-    $(call all-java-files-under, wallpaper_picker_src) \
+    $(call all-java-files-under, WallpaperPicker/src) \
     $(call all-renderscript-files-under, src) \
     $(call all-proto-files-under, protos)
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/wallpaper_picker_res $(LOCAL_PATH)/res
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/WallpaperPicker/res $(LOCAL_PATH)/res
 
 LOCAL_AAPT_FLAGS := --auto-add-overlay
 
index 1e418ec..4e27e6f 100644 (file)
         </activity>
 
         <activity
-            android:name="com.android.launcher3.WallpaperPickerActivity"
+            android:name="com.android.launcher3.LauncherWallpaperPickerActivity"
             android:theme="@style/Theme.WallpaperCropper"
             android:label="@string/pick_wallpaper"
             android:icon="@mipmap/ic_launcher_wallpaper"
diff --git a/WallpaperPicker/AndroidManifest.xml b/WallpaperPicker/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..86a94d0
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+        package="com.android.launcher3"
+        android:versionCode="1"
+        android:versionName="1.0"
+        >
+
+    <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="19" />
+
+</manifest>
diff --git a/WallpaperPicker/README b/WallpaperPicker/README
new file mode 100644 (file)
index 0000000..d8efb07
--- /dev/null
@@ -0,0 +1,4 @@
+This project contains the wallpaper picker for Launcher3. It's in a separate
+folder to organize the code separately from the rest of the launcher, and has
+a manifest so that a separate Eclipse project can exist for the wallpaper
+picker (necessary to have the Eclipse build work)
\ No newline at end of file
diff --git a/WallpaperPicker/res/values-sw600dp/config.xml b/WallpaperPicker/res/values-sw600dp/config.xml
new file mode 100644 (file)
index 0000000..62342dc
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <bool name="allow_rotation">true</bool>
+</resources>
diff --git a/WallpaperPicker/res/values/config.xml b/WallpaperPicker/res/values/config.xml
new file mode 100644 (file)
index 0000000..1b24190
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <bool name="allow_rotation">false</bool>
+</resources>
@@ -123,8 +123,7 @@ public class LiveWallpaperListAdapter extends BaseAdapter implements ListAdapter
             preview.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
                     mInfo.getComponent());
             a.onLiveWallpaperPickerLaunch();
-            Utilities.startActivityForResultSafely(
-                    a, preview, WallpaperPickerActivity.PICK_LIVE_WALLPAPER);
+            a.startActivityForResultSafely(preview, WallpaperPickerActivity.PICK_LIVE_WALLPAPER);
         }
     }
 
@@ -56,8 +56,8 @@ public class ThirdPartyWallpaperPickerListAdapter extends BaseAdapter implements
                     mResolveInfo.activityInfo.packageName, mResolveInfo.activityInfo.name);
             Intent launchIntent = new Intent(Intent.ACTION_SET_WALLPAPER);
             launchIntent.setComponent(itemComponentName);
-            Utilities.startActivityForResultSafely(
-                    a, launchIntent, WallpaperPickerActivity.PICK_WALLPAPER_THIRD_PARTY_ACTIVITY);
+            a.startActivityForResultSafely(
+                    launchIntent, WallpaperPickerActivity.PICK_WALLPAPER_THIRD_PARTY_ACTIVITY);
         }
     }
 
@@ -57,6 +57,7 @@ import android.view.View;
 import android.view.View.OnClickListener;
 import android.view.View.OnLayoutChangeListener;
 import android.view.ViewGroup;
+import android.view.ViewPropertyAnimator;
 import android.view.ViewTreeObserver;
 import android.view.ViewTreeObserver.OnGlobalLayoutListener;
 import android.view.animation.AccelerateInterpolator;
@@ -125,7 +126,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
         public void onClick(WallpaperPickerActivity a) {
             Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
             intent.setType("image/*");
-            Utilities.startActivityForResultSafely(a, intent, IMAGE_PICK);
+            a.startActivityForResultSafely(intent, IMAGE_PICK);
         }
     }
 
@@ -278,7 +279,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
         mCropView = (CropView) findViewById(R.id.cropView);
         mWallpaperStrip = findViewById(R.id.wallpaper_strip);
         mCropView.setTouchCallback(new CropView.TouchCallback() {
-            LauncherViewPropertyAnimator mAnim;
+            ViewPropertyAnimator mAnim;
             @Override
             public void onTouchDown() {
                 if (mAnim != null) {
@@ -287,17 +288,14 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
                 if (mWallpaperStrip.getAlpha() == 1f) {
                     mIgnoreNextTap = true;
                 }
-                mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip);
+                mAnim = mWallpaperStrip.animate();
                 mAnim.alpha(0f)
-                     .setDuration(150)
-                     .addListener(new Animator.AnimatorListener() {
-                         public void onAnimationStart(Animator animator) { }
-                         public void onAnimationEnd(Animator animator) {
-                             mWallpaperStrip.setVisibility(View.INVISIBLE);
-                         }
-                         public void onAnimationCancel(Animator animator) { }
-                         public void onAnimationRepeat(Animator animator) { }
-                     });
+                    .setDuration(150)
+                    .withEndAction(new Runnable() {
+                        public void run() {
+                            mWallpaperStrip.setVisibility(View.INVISIBLE);
+                        }
+                    });
                 mAnim.setInterpolator(new AccelerateInterpolator(0.75f));
                 mAnim.start();
             }
@@ -314,7 +312,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
                         mAnim.cancel();
                     }
                     mWallpaperStrip.setVisibility(View.VISIBLE);
-                    mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip);
+                    mAnim = mWallpaperStrip.animate();
                     mAnim.alpha(1f)
                          .setDuration(150)
                          .setInterpolator(new DecelerateInterpolator(0.75f));
@@ -576,10 +574,6 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
         }
     }
 
-    public boolean enableRotation() {
-        return super.enableRotation() || Launcher.sForceEnableRotation;
-    }
-
     protected Bitmap getThumbnailOfLastPhoto() {
         Cursor cursor = MediaStore.Images.Media.query(getContentResolver(),
                 MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
@@ -1001,4 +995,10 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
 
         return view;
     }
+
+    // In Launcher3, we override this with a method that catches exceptions
+    // from starting activities; didn't want to copy and paste code into here
+    public void startActivityForResultSafely(Intent intent, int requestCode) {
+        startActivityForResult(intent, requestCode);
+    }
 }
index 9485cea..a8dd997 100644 (file)
@@ -2174,7 +2174,7 @@ public class Launcher extends Activity
     }
 
     protected ComponentName getWallpaperPickerComponent() {
-        return new ComponentName(getPackageName(), WallpaperPickerActivity.class.getName());
+        return new ComponentName(getPackageName(), LauncherWallpaperPickerActivity.class.getName());
     }
 
     /**
diff --git a/src/com/android/launcher3/LauncherWallpaperPickerActivity.java b/src/com/android/launcher3/LauncherWallpaperPickerActivity.java
new file mode 100644 (file)
index 0000000..10fe013
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3;
+
+import android.content.Intent;
+
+public class LauncherWallpaperPickerActivity extends WallpaperPickerActivity {
+    @Override
+    public void startActivityForResultSafely(Intent intent, int requestCode) {
+        Utilities.startActivityForResultSafely(this, intent, requestCode);
+    }
+    @Override
+    public boolean enableRotation() {
+        return Utilities.isRotationEnabled(this);
+    }
+}
index 9ffd044..cbc9785 100644 (file)
@@ -65,6 +65,12 @@ public final class Utilities {
     static int sColors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff };
     static int sColorIndex = 0;
 
+
+    // To turn on these properties, type
+    // adb shell setprop log.tag.PROPERTY_NAME [VERBOSE | SUPPRESS]
+    static final String FORCE_ENABLE_ROTATION_PROPERTY = "launcher_force_rotate";
+    public static boolean sForceEnableRotation = isPropertyEnabled(FORCE_ENABLE_ROTATION_PROPERTY);
+
     /**
      * Returns a FastBitmapDrawable with the icon, accurately sized.
      */
@@ -82,6 +88,16 @@ public final class Utilities {
         icon.setBounds(0, 0, sIconTextureWidth, sIconTextureHeight);
     }
 
+    private static boolean isPropertyEnabled(String propertyName) {
+        return Log.isLoggable(propertyName, Log.VERBOSE);
+    }
+
+    public static boolean isRotationEnabled(Context c) {
+        boolean enableRotation = sForceEnableRotation ||
+                c.getResources().getBoolean(R.bool.allow_rotation);
+        return enableRotation;
+    }
+
     /**
      * Returns a bitmap suitable for the all apps view. Used to convert pre-ICS
      * icon bitmaps that are stored in the database (which were 74x74 pixels at hdpi size)
index 9937fc5..e6550bc 100644 (file)
@@ -1232,7 +1232,7 @@ public class Workspace extends SmoothPagedView
                 String spKey = WallpaperCropActivity.getSharedPreferencesKey();
                 SharedPreferences sp =
                         mLauncher.getSharedPreferences(spKey, Context.MODE_MULTI_PROCESS);
-                WallpaperPickerActivity.suggestWallpaperDimension(mLauncher.getResources(),
+                LauncherWallpaperPickerActivity.suggestWallpaperDimension(mLauncher.getResources(),
                         sp, mLauncher.getWindowManager(), mWallpaperManager);
                 return null;
             }
index 36904f2..44cbcc9 100644 (file)
@@ -5,7 +5,7 @@
 # necessary so do this with care
 import os
 import sys
-src_dir = "wallpaper_picker_src/"
+src_dir = "WallpaperPicker/src/"
 files = """
 src/android/util/Pools.java
 com/android/gallery3d/util/IntArray.java