summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrint E. Kriebel <bekit@cyngn.com>2014-11-18 13:53:24 -0800
committerBrint E. Kriebel <bekit@cyngn.com>2014-11-18 13:53:24 -0800
commit872c5eec983308dde70b713a4549a39581516014 (patch)
tree0b51e888c47f9ef473ddfe06584ac5a9c83778a7
parent82381089660c3f0624b66740c95a10c9f667ce27 (diff)
parentf7bef2545ba45e8405dd5a00c0d276d669bf0ad0 (diff)
downloadandroid_packages_apps_Trebuchet-872c5eec983308dde70b713a4549a39581516014.zip
android_packages_apps_Trebuchet-872c5eec983308dde70b713a4549a39581516014.tar.gz
android_packages_apps_Trebuchet-872c5eec983308dde70b713a4549a39581516014.tar.bz2
Merge branch 'cm-11.0' into stable/cm-11.0
-rw-r--r--src/com/android/launcher3/Folder.java4
-rw-r--r--src/com/android/launcher3/FolderIcon.java2
-rw-r--r--src/com/android/launcher3/Launcher.java14
-rw-r--r--src/com/android/launcher3/LauncherModel.java16
-rw-r--r--src/com/android/launcher3/Workspace.java18
5 files changed, 44 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 54d2793..0aacff4 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -1202,7 +1202,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
private void replaceFolderWithFinalItem() {
- if (mInfo.hidden) {
+ if (mInfo.hidden && getItemCount() >= 1) {
return;
}
// Add the last remaining child to the workspace in place of the folder
@@ -1245,7 +1245,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
if (finalChild != null) {
mFolderIcon.performDestroyAnimation(finalChild, onCompleteRunnable);
} else {
- onCompleteRunnable.run();
+ mLauncher.runOnUiThread(onCompleteRunnable);
}
mDestroyed = true;
}
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index 78e8c3a..5ea5ee9 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -690,7 +690,7 @@ public class FolderIcon extends FrameLayout implements FolderListener {
public void onAnimationEnd(Animator animation) {
mAnimating = false;
if (onCompleteRunnable != null) {
- onCompleteRunnable.run();
+ mLauncher.runOnUiThread(onCompleteRunnable);
}
}
});
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 1d1208f..edfcc6c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -456,10 +456,21 @@ public class Launcher extends Activity
return Log.isLoggable(propertyName, Log.VERBOSE);
}
+ Runnable mUpdateDynamicGridRunnable = new Runnable() {
+ @Override
+ public void run() {
+ updateDynamicGrid();
+ }
+ };
+
private BroadcastReceiver protectedAppsChangedReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// Update the workspace
+ if (waitUntilResume(mUpdateDynamicGridRunnable, true)) {
+ return;
+ }
+
updateDynamicGrid();
}
};
@@ -1329,7 +1340,8 @@ public class Launcher extends Activity
protected void startThemeSettings() {
Intent chooser = new Intent(Intent.ACTION_MAIN)
.addCategory(OverviewSettingsPanel.THEME_CHOOSER_CATEGORY)
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ .addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
try {
startActivity(chooser);
} catch (ActivityNotFoundException e) {
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index b9ea057..9f89b3a 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -2445,17 +2445,27 @@ public class LauncherModel extends BroadcastReceiver {
int NN = shortcuts.size() - 1;
for (int j = NN; j >= 0; j--) {
- ShortcutInfo sci = shortcuts.get(j);
+ final ShortcutInfo sci = shortcuts.get(j);
if (sci.intent != null && sci.intent.getComponent() != null) {
if (!folder.hidden){
if (mHiddenApps.contains(sci.intent.getComponent())) {
LauncherModel.deleteItemFromDatabase(mContext, sci);
- folder.remove(sci);
+ Runnable r = new Runnable() {
+ public void run() {
+ folder.remove(sci);
+ }
+ };
+ runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
}
} else {
if (!mHiddenApps.contains(sci.intent.getComponent())) {
LauncherModel.deleteItemFromDatabase(mContext, sci);
- folder.remove(sci);
+ Runnable r = new Runnable() {
+ public void run() {
+ folder.remove(sci);
+ }
+ };
+ runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
}
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index e935c99..478b261 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1337,7 +1337,7 @@ public class Workspace extends SmoothPagedView
float mAnimationStartOffset;
private final int ANIMATION_DURATION = 250;
// Don't use all the wallpaper for parallax until you have at least this many pages
- private final int MIN_PARALLAX_PAGE_SPAN = 3;
+ private final int MIN_PARALLAX_PAGE_SPAN = 2;
int mNumScreens;
boolean mCompletedInitialOffset;
@@ -1390,8 +1390,8 @@ public class Workspace extends SmoothPagedView
}
private float wallpaperOffsetForCurrentScroll() {
- if (getChildCount() <= 1) {
- return 0;
+ if (getNumScreensExcludingEmptyAndCustom() <= 1) {
+ return mWallpaperIsLiveWallpaper ? 0 : 0.5f;
}
// Exclude the leftmost page
@@ -2767,6 +2767,18 @@ public class Workspace extends SmoothPagedView
v.getWidth() + padding, v.getHeight() + padding, Bitmap.Config.ARGB_8888);
}
+ // Special case for dragging All Apps button
+ if (v.getTag() instanceof ItemInfo) {
+ ItemInfo info = (ItemInfo) v.getTag();
+ if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS) {
+ // Special case for all apps icon
+ Drawable d = ((TextView) v).getCompoundDrawables()[1];
+ Rect r = d.getBounds();
+ b = Bitmap.createBitmap(r.width() + padding,
+ r.height() + padding, Bitmap.Config.ARGB_8888);
+ }
+ }
+
canvas.setBitmap(b);
drawDragView(v, canvas, padding, true);
canvas.setBitmap(null);