summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/WallpaperPickerActivity.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-10-01 19:16:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-01 19:16:06 +0000
commit9643e2e5757b1ac1ec028a4df2a0cfd2592132d5 (patch)
tree5f91e2018022bb3227a8d60408177a59094b9ce2 /src/com/android/launcher3/WallpaperPickerActivity.java
parent8cacf102eb0bd0d84f781b2db4722590398c0ed9 (diff)
parent7267fa58693549894999db17359ce26f8bc7b4a7 (diff)
downloadandroid_packages_apps_Trebuchet-9643e2e5757b1ac1ec028a4df2a0cfd2592132d5.tar.gz
android_packages_apps_Trebuchet-9643e2e5757b1ac1ec028a4df2a0cfd2592132d5.tar.bz2
android_packages_apps_Trebuchet-9643e2e5757b1ac1ec028a4df2a0cfd2592132d5.zip
Merge "Make some changes for transparent system bars" into jb-ub-now-indigo-rose
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);
}
}