From 7267fa58693549894999db17359ce26f8bc7b4a7 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 26 Sep 2013 15:29:57 -0700 Subject: Make some changes for transparent system bars -Move transparent bars from just GEL to Launcher3 -When wallpaper strip animates, render it under the nav bar -Disable rotation of wallpaper picker on phones Bug: 10814785 Bug: 10852650 Bug: 10852554 Change-Id: I9efeccbc4ad1933689266a5dede201ccfd34acf4 --- .../android/launcher3/WallpaperPickerActivity.java | 32 +++++++++++++++------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'src/com/android/launcher3/WallpaperPickerActivity.java') diff --git a/src/com/android/launcher3/WallpaperPickerActivity.java b/src/com/android/launcher3/WallpaperPickerActivity.java index ef94fe86e..7f49c86d3 100644 --- a/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/src/com/android/launcher3/WallpaperPickerActivity.java @@ -77,6 +77,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { private OnClickListener mThumbnailOnClickListener; private LinearLayout mWallpapersView; + private View mWallpaperStrip; private ActionMode.Callback mActionModeCallback; private ActionMode mActionMode; @@ -169,12 +170,19 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { } } + public void setWallpaperStripYOffset(float offset) { + mWallpaperStrip.setPadding(0, 0, 0, (int) offset); + } + // called by onCreate; this is subclassed to overwrite WallpaperCropActivity protected void init() { setContentView(R.layout.wallpaper_picker); + final WallpaperRootView root = (WallpaperRootView) findViewById(R.id.wallpaper_root); + TransparentBars transparentBars = new TransparentBars(root); + transparentBars.requestTransparentBars(true); mCropView = (CropView) findViewById(R.id.cropView); - final View wallpaperStrip = findViewById(R.id.wallpaper_strip); + mWallpaperStrip = findViewById(R.id.wallpaper_strip); mCropView.setTouchCallback(new CropView.TouchCallback() { LauncherViewPropertyAnimator mAnim; @Override @@ -182,11 +190,11 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { if (mAnim != null) { mAnim.cancel(); } - if (wallpaperStrip.getTranslationY() == 0) { + if (mWallpaperStrip.getTranslationY() == 0) { mIgnoreNextTap = true; } - mAnim = new LauncherViewPropertyAnimator(wallpaperStrip); - mAnim.translationY(wallpaperStrip.getHeight()).alpha(0f) + mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip); + mAnim.translationY(mWallpaperStrip.getHeight()).alpha(0f) .setInterpolator(new DecelerateInterpolator(0.75f)); mAnim.start(); } @@ -202,8 +210,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { if (mAnim != null) { mAnim.cancel(); } - mAnim = new LauncherViewPropertyAnimator(wallpaperStrip); - mAnim.translationY(0).alpha(1f) + mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip); + mAnim.translationY(0f).alpha(1f) .setInterpolator(new DecelerateInterpolator(0.75f)); mAnim.start(); } @@ -401,6 +409,10 @@ 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, @@ -419,10 +431,10 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { protected void onStop() { super.onStop(); - final View wallpaperStrip = findViewById(R.id.wallpaper_strip); - if (wallpaperStrip.getTranslationY() > 0) { - wallpaperStrip.setTranslationY(0); - wallpaperStrip.setAlpha(1f); + mWallpaperStrip = findViewById(R.id.wallpaper_strip); + if (mWallpaperStrip.getTranslationY() > 0f) { + mWallpaperStrip.setTranslationY(0f); + mWallpaperStrip.setAlpha(1f); } } -- cgit v1.2.3