summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-09-14 21:55:16 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-14 21:55:16 (GMT)
commit54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d (patch)
tree82db2e21449fd52665d7cff5f67b72ea655d185f /WallpaperPicker
parentedd51ad30741098e2110e3d0533085b02cbe752c (diff)
parent00e827c70cb4213ee05140157006a37d12662448 (diff)
downloadandroid_packages_apps_Trebuchet-54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d.zip
android_packages_apps_Trebuchet-54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d.tar.gz
android_packages_apps_Trebuchet-54d17dff6db6847b33bf07e1af6fbaa2e3bbe19d.tar.bz2
am 00e827c7: am 5fcaab43: am ea9ad5ce: Merge remote-tracking branch \'origin/ub-launcher3-burnaby\' into mnc-dev
* commit '00e827c70cb4213ee05140157006a37d12662448': (76 commits) Restoring provider behavior for reloading app on old devices > For older devices, launcher will only reload in case of inserts with specific query parameters > For older devices, launcehr will notify content observers of any internal inserts > Chaning TAG for Launcher provider as max logging tag is only 23 characters Removing items which are on invalid screen Preventing null pointer crash when opening a folder Revert workaround for move to default screen on home intent. Fixing NPE in recycler view scroll bar. Adding workaround for regression caused by ag/752175 Adding gradle script for Android Studio Override the overscroll color for the widget rows. Adding graphic for all apps empty search screen. Using GET_UNINSTALLED_PACKAGES flag when getting packageInfo for a managed profile app Revert "Adding viewId for the QSB" Adding viewId for the QSB Fixing issue with missing scroll bar after fast-scrolling and searching. Fixing an issue where you would inadvertently start fastscrolling. Pending bind callbacks should be cleared before starting the loader, similar to startBinding Fixing widgets container inactive scroll bar color. Making the detached scrollbar catch up faster to the actual scroll position. 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 Updating the target sdk to launcher Using the usermanager api to get creation time ...
Diffstat (limited to 'WallpaperPicker')
-rw-r--r--WallpaperPicker/res/values-v19/styles.xml2
-rw-r--r--WallpaperPicker/res/values-v21/styles.xml7
-rw-r--r--WallpaperPicker/res/values/colors.xml2
-rw-r--r--WallpaperPicker/res/values/styles.xml8
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java6
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java33
6 files changed, 38 insertions, 20 deletions
diff --git a/WallpaperPicker/res/values-v19/styles.xml b/WallpaperPicker/res/values-v19/styles.xml
index 136cf01..15fb0ea 100644
--- a/WallpaperPicker/res/values-v19/styles.xml
+++ b/WallpaperPicker/res/values-v19/styles.xml
@@ -25,7 +25,7 @@
<item name="android:windowTranslucentNavigation">true</item>
</style>
- <style name="Theme" parent="@android:style/Theme.DeviceDefault.Wallpaper.NoTitleBar">
+ <style name="Theme" parent="@style/BaseWallpaperTheme">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
diff --git a/WallpaperPicker/res/values-v21/styles.xml b/WallpaperPicker/res/values-v21/styles.xml
index 582ab8f..70220ed 100644
--- a/WallpaperPicker/res/values-v21/styles.xml
+++ b/WallpaperPicker/res/values-v21/styles.xml
@@ -33,4 +33,11 @@
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
</style>
+ <style name="Theme" parent="@style/BaseWallpaperTheme">
+ <item name="android:windowTranslucentStatus">true</item>
+ <item name="android:windowTranslucentNavigation">true</item>
+ <item name="android:colorControlActivated">@color/launcher_accent_color</item>
+ <item name="android:colorAccent">@color/launcher_accent_color</item>
+ <item name="android:colorPrimary">@color/launcher_accent_color</item>
+ </style>
</resources> \ No newline at end of file
diff --git a/WallpaperPicker/res/values/colors.xml b/WallpaperPicker/res/values/colors.xml
index adae7cf..6ba32f0 100644
--- a/WallpaperPicker/res/values/colors.xml
+++ b/WallpaperPicker/res/values/colors.xml
@@ -19,4 +19,6 @@
-->
<resources>
<color name="wallpaper_picker_translucent_gray">#66000000</color>
+
+ <color name="launcher_accent_color">#ff009688</color>
</resources>
diff --git a/WallpaperPicker/res/values/styles.xml b/WallpaperPicker/res/values/styles.xml
index 74aeab9..d1c945a 100644
--- a/WallpaperPicker/res/values/styles.xml
+++ b/WallpaperPicker/res/values/styles.xml
@@ -35,9 +35,15 @@
<item name="android:background">#88000000</item>
</style>
- <style name="Theme" parent="@android:style/Theme.DeviceDefault.Wallpaper.NoTitleBar">
+ <style name="BaseWallpaperTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
+ <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowShowWallpaper">true</item>
+ <item name="android:windowNoTitle">true</item>
</style>
+ <style name="Theme" parent="@style/BaseWallpaperTheme"></style>
+
<style name="ActionBarSetWallpaperStyle" parent="@android:style/Widget.DeviceDefault.ActionButton">
<item name="android:textColor">#ffffffff</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
index f2bb509..f2459dd 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 88dc3e2..5985850 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));
@@ -548,7 +550,12 @@ 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();
+
WallpaperTileInfo info = (WallpaperTileInfo) mSelectedTile.getTag();
info.onSave(WallpaperPickerActivity.this);
} else {
@@ -713,10 +720,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);
}
}
@@ -970,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);
}