From 209a859dedba0e8314ee102a760aad78a814ea94 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Mon, 3 Aug 2015 16:59:10 -0700 Subject: Fix issue where scroll container shadow didn't fade out Change-Id: I3b0104dea04009819db0375c381b8ff445b76baa --- .../android/launcher3/WallpaperPickerActivity.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'WallpaperPicker') diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 88dc3e22b..c723b39be 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -100,6 +100,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { @Thunk LinearLayout mWallpapersView; @Thunk HorizontalScrollView mWallpaperScrollContainer; + @Thunk View mWallpaperStrip; @Thunk ActionMode.Callback mActionModeCallback; @Thunk ActionMode mActionMode; @@ -379,6 +380,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { mProgressView = findViewById(R.id.loading); mWallpaperScrollContainer = (HorizontalScrollView) findViewById(R.id.wallpaper_scroll_container); + mWallpaperStrip = findViewById(R.id.wallpaper_strip); mCropView.setTouchCallback(new CropView.TouchCallback() { ViewPropertyAnimator mAnim; @Override @@ -386,15 +388,15 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { if (mAnim != null) { mAnim.cancel(); } - if (mWallpaperScrollContainer.getAlpha() == 1f) { + if (mWallpaperStrip.getAlpha() == 1f) { mIgnoreNextTap = true; } - mAnim = mWallpaperScrollContainer.animate(); + mAnim = mWallpaperStrip.animate(); mAnim.alpha(0f) .setDuration(150) .withEndAction(new Runnable() { public void run() { - mWallpaperScrollContainer.setVisibility(View.INVISIBLE); + mWallpaperStrip.setVisibility(View.INVISIBLE); } }); mAnim.setInterpolator(new AccelerateInterpolator(0.75f)); @@ -412,8 +414,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { if (mAnim != null) { mAnim.cancel(); } - mWallpaperScrollContainer.setVisibility(View.VISIBLE); - mAnim = mWallpaperScrollContainer.animate(); + mWallpaperStrip.setVisibility(View.VISIBLE); + mAnim = mWallpaperStrip.animate(); mAnim.alpha(1f) .setDuration(150) .setInterpolator(new DecelerateInterpolator(0.75f)); @@ -713,10 +715,10 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { public void onStop() { super.onStop(); - mWallpaperScrollContainer = (HorizontalScrollView) findViewById(R.id.wallpaper_scroll_container); - if (mWallpaperScrollContainer.getAlpha() < 1f) { - mWallpaperScrollContainer.setAlpha(1f); - mWallpaperScrollContainer.setVisibility(View.VISIBLE); + mWallpaperStrip = findViewById(R.id.wallpaper_strip); + if (mWallpaperStrip.getAlpha() < 1f) { + mWallpaperStrip.setAlpha(1f); + mWallpaperStrip.setVisibility(View.VISIBLE); } } -- cgit v1.2.3 From b33e09a93cda9793b84ec70e1d85c9038f5d3ee6 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 10 Aug 2015 11:53:23 -0700 Subject: Preventing user from selecting any new time, when a tile is already being applied Bug: 22293299 Change-Id: I6b9bf2b777d33ca23f291c7872ce1f338d41e516 --- .../src/com/android/launcher3/WallpaperPickerActivity.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'WallpaperPicker') diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index c723b39be..069638f8c 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -551,6 +551,10 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { @Override public void onClick(View v) { if (mSelectedTile != null) { + // Prevent user from selecting any new tile. + mWallpaperStrip.setVisibility(View.GONE); + actionBar.hide(); + WallpaperTileInfo info = (WallpaperTileInfo) mSelectedTile.getTag(); info.onSave(WallpaperPickerActivity.this); } else { -- cgit v1.2.3 From 79a640ec354e61363e0c347793f70b3a285a0240 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 12 Aug 2015 15:28:33 -0700 Subject: Ensure that crop view is loaded before applying a wallpaper Bug: 22293299 Change-Id: I64d5268cc263bbb6595a0b28bdd5ec73d540da41 --- WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'WallpaperPicker') diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 069638f8c..75d874552 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -550,7 +550,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { new View.OnClickListener() { @Override public void onClick(View v) { - if (mSelectedTile != null) { + // Ensure that a tile is slelected and loaded. + if (mSelectedTile != null && mCropView.getTileSource() != null) { // Prevent user from selecting any new tile. mWallpaperStrip.setVisibility(View.GONE); actionBar.hide(); -- cgit v1.2.3 From 9fc953b94dbc6b99e6de08c9dcc80a0cb8e3e319 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 17 Aug 2015 12:24:25 -0700 Subject: Version code cleanup > Renaming Lmp to Lollipop > Lollipop_MR1 instead of directly using 22 > Using M APIs directly instead of reflection Change-Id: I10a307f46e3be15b3299f549a2fd7e0e215a6a1b --- .../src/com/android/launcher3/WallpaperCropActivity.java | 6 ++---- .../src/com/android/launcher3/WallpaperPickerActivity.java | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'WallpaperPicker') diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java index f2bb50944..f2459dd3e 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java @@ -223,14 +223,12 @@ public class WallpaperCropActivity extends BaseActivity implements Handler.Callb @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) protected boolean isActivityDestroyed() { - return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) - && isDestroyed(); + return Utilities.ATLEAST_JB_MR1 && isDestroyed(); } @Thunk void addReusableBitmap(TileSource src) { synchronized (mReusableBitmaps) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT - && src instanceof BitmapRegionTileSource) { + if (Utilities.ATLEAST_KITKAT && src instanceof BitmapRegionTileSource) { Bitmap preview = ((BitmapRegionTileSource) src).getBitmap(); if (preview != null && preview.isMutable()) { mReusableBitmaps.add(preview); diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 75d874552..59858501a 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -977,10 +977,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { if (partner == null || !partner.hideDefaultWallpaper()) { // Add an entry for the default wallpaper (stored in system resources) - WallpaperTileInfo defaultWallpaperInfo = - (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) - ? getPreKKDefaultWallpaperInfo() - : getDefaultWallpaper(); + WallpaperTileInfo defaultWallpaperInfo = Utilities.ATLEAST_KITKAT + ? getDefaultWallpaper() : getPreKKDefaultWallpaperInfo(); if (defaultWallpaperInfo != null) { bundled.add(0, defaultWallpaperInfo); } -- cgit v1.2.3 From dd306188a6e8b4d00b8ef0ab402589c92802f04b Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 20 Aug 2015 16:17:36 -0700 Subject: Updating theme to use the light theme by default, instead of wallpaper theme > This allows us to use all the goodness of material theme > Cursor in folder edit text is no longer 1px wide Change-Id: I705f5472ff71969ae45747dd127a8ba5253df44d --- WallpaperPicker/res/values-v19/styles.xml | 2 +- WallpaperPicker/res/values-v21/styles.xml | 7 +++++++ WallpaperPicker/res/values/colors.xml | 2 ++ WallpaperPicker/res/values/styles.xml | 8 +++++++- 4 files changed, 17 insertions(+), 2 deletions(-) (limited to 'WallpaperPicker') diff --git a/WallpaperPicker/res/values-v19/styles.xml b/WallpaperPicker/res/values-v19/styles.xml index 136cf012c..15fb0ea2a 100644 --- a/WallpaperPicker/res/values-v19/styles.xml +++ b/WallpaperPicker/res/values-v19/styles.xml @@ -25,7 +25,7 @@ true - diff --git a/WallpaperPicker/res/values-v21/styles.xml b/WallpaperPicker/res/values-v21/styles.xml index 582ab8fed..70220edb9 100644 --- a/WallpaperPicker/res/values-v21/styles.xml +++ b/WallpaperPicker/res/values-v21/styles.xml @@ -33,4 +33,11 @@ ?android:attr/selectableItemBackgroundBorderless + \ No newline at end of file diff --git a/WallpaperPicker/res/values/colors.xml b/WallpaperPicker/res/values/colors.xml index adae7cff6..6ba32f06d 100644 --- a/WallpaperPicker/res/values/colors.xml +++ b/WallpaperPicker/res/values/colors.xml @@ -19,4 +19,6 @@ --> #66000000 + + #ff009688 diff --git a/WallpaperPicker/res/values/styles.xml b/WallpaperPicker/res/values/styles.xml index 74aeab903..d1c945a32 100644 --- a/WallpaperPicker/res/values/styles.xml +++ b/WallpaperPicker/res/values/styles.xml @@ -35,9 +35,15 @@ #88000000 - + +