summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/WallpaperPickerActivity.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-09-26 15:29:57 -0700
committerMichael Jurka <mikejurka@google.com>2013-10-01 11:56:43 -0700
commit7267fa58693549894999db17359ce26f8bc7b4a7 (patch)
tree55f38a256e92c26119d3323badddf31605819390 /src/com/android/launcher3/WallpaperPickerActivity.java
parente269ca4298eb4be7c4e07bfb67cfb7dcf38c274f (diff)
downloadandroid_packages_apps_Trebuchet-7267fa58693549894999db17359ce26f8bc7b4a7.tar.gz
android_packages_apps_Trebuchet-7267fa58693549894999db17359ce26f8bc7b4a7.tar.bz2
android_packages_apps_Trebuchet-7267fa58693549894999db17359ce26f8bc7b4a7.zip
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
Diffstat (limited to 'src/com/android/launcher3/WallpaperPickerActivity.java')
-rw-r--r--src/com/android/launcher3/WallpaperPickerActivity.java32
1 files changed, 22 insertions, 10 deletions
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);
}
}