diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-09-14 21:40:15 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-14 21:40:15 +0000 |
commit | 5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0 (patch) | |
tree | fcf23a25aadc660bd2dbb8b5178da454e8a00f08 /WallpaperPicker | |
parent | e40f5ce4af3c743bd4dbc3abeba938559c31732c (diff) | |
parent | ea9ad5cead9ad894fb670476bb5381198cdcf2de (diff) | |
download | android_packages_apps_Trebuchet-5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0.tar.gz android_packages_apps_Trebuchet-5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0.tar.bz2 android_packages_apps_Trebuchet-5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0.zip |
am ea9ad5ce: Merge remote-tracking branch \'origin/ub-launcher3-burnaby\' into mnc-dev
* commit 'ea9ad5cead9ad894fb670476bb5381198cdcf2de': (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')
6 files changed, 38 insertions, 20 deletions
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 @@ <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 582ab8fed..70220edb9 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 adae7cff6..6ba32f06d 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 74aeab903..d1c945a32 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 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 88dc3e22b..59858501a 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); } |