From 6079b05445e8ce09d7d2d37efe27cf569c853fbf Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 23 May 2011 12:56:50 -0700 Subject: Fix crash on phones --- res/drawable-hdpi/app_market_generic.png | Bin 0 -> 924 bytes res/drawable-large-hdpi/app_market_generic.png | Bin 924 -> 0 bytes res/drawable-large-mdpi/app_market_generic.png | Bin 3441 -> 0 bytes res/drawable-mdpi/app_market_generic.png | Bin 0 -> 3441 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/drawable-hdpi/app_market_generic.png delete mode 100644 res/drawable-large-hdpi/app_market_generic.png delete mode 100644 res/drawable-large-mdpi/app_market_generic.png create mode 100644 res/drawable-mdpi/app_market_generic.png diff --git a/res/drawable-hdpi/app_market_generic.png b/res/drawable-hdpi/app_market_generic.png new file mode 100644 index 000000000..2a2381f3c Binary files /dev/null and b/res/drawable-hdpi/app_market_generic.png differ diff --git a/res/drawable-large-hdpi/app_market_generic.png b/res/drawable-large-hdpi/app_market_generic.png deleted file mode 100644 index 2a2381f3c..000000000 Binary files a/res/drawable-large-hdpi/app_market_generic.png and /dev/null differ diff --git a/res/drawable-large-mdpi/app_market_generic.png b/res/drawable-large-mdpi/app_market_generic.png deleted file mode 100644 index 6eb549703..000000000 Binary files a/res/drawable-large-mdpi/app_market_generic.png and /dev/null differ diff --git a/res/drawable-mdpi/app_market_generic.png b/res/drawable-mdpi/app_market_generic.png new file mode 100644 index 000000000..6eb549703 Binary files /dev/null and b/res/drawable-mdpi/app_market_generic.png differ -- cgit v1.2.3 From 092338a6324eee812ed6c65e613cb87d9745f033 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 21 Jul 2011 11:22:13 -0700 Subject: Fix wallpaper picker crash --- res/values/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/res/values/strings.xml b/res/values/strings.xml index c0df443ee..a3c263d73 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -33,6 +33,12 @@ Android Core Apps + + Select wallpaper from + + Set wallpaper + + Wallpapers Application is not installed. -- cgit v1.2.3 From 7529fa2405fb64455d35f587cd145b2590e7baf8 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 21 Jul 2011 11:46:32 -0700 Subject: Fixing various issues with the dock. - Prevent crash due to no overlays in certain device configurations - Fixing kb crash and adding content description for Apps button Change-Id: Ie2a2bc29e7b9408a165f93d108fdd803193afc29 --- src/com/android/launcher2/BubbleTextView.java | 12 ------------ src/com/android/launcher2/FocusHelper.java | 17 +++++++++++++++-- src/com/android/launcher2/Hotseat.java | 8 ++++++-- src/com/android/launcher2/Launcher.java | 7 +++++++ src/com/android/launcher2/Workspace.java | 2 ++ 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java index 57a6584dd..476d06374 100644 --- a/src/com/android/launcher2/BubbleTextView.java +++ b/src/com/android/launcher2/BubbleTextView.java @@ -330,16 +330,4 @@ public class BubbleTextView extends TextView implements VisibilityChangedBroadca } return true; } - - @Override - public boolean onKeyDown(int keyCode, KeyEvent event) { - return FocusHelper.handleBubbleTextViewKeyEvent(this, keyCode, event) - || super.onKeyDown(keyCode, event); - } - - @Override - public boolean onKeyUp(int keyCode, KeyEvent event) { - return FocusHelper.handleBubbleTextViewKeyEvent(this, keyCode, event) - || super.onKeyUp(keyCode, event); - } } diff --git a/src/com/android/launcher2/FocusHelper.java b/src/com/android/launcher2/FocusHelper.java index 233fd6fbb..3783d566c 100644 --- a/src/com/android/launcher2/FocusHelper.java +++ b/src/com/android/launcher2/FocusHelper.java @@ -30,10 +30,20 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +/** + * A keyboard listener we set on all the workspace icons. + */ +class BubbleTextViewKeyEventListener implements View.OnKeyListener { + @Override + public boolean onKey(View v, int keyCode, KeyEvent event) { + return FocusHelper.handleBubbleTextViewKeyEvent((BubbleTextView) v, keyCode, event); + } +} + /** * A keyboard listener we set on all the hotseat buttons. */ -class HotseatKeyEventListener implements View.OnKeyListener { +class HotseatBubbleTextViewKeyEventListener implements View.OnKeyListener { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { final Configuration configuration = v.getResources().getConfiguration(); @@ -612,6 +622,7 @@ public class FocusHelper { final Workspace workspace = (Workspace) layout.getParent(); final ViewGroup launcher = (ViewGroup) workspace.getParent(); final ViewGroup tabs = (ViewGroup) launcher.findViewById(R.id.qsb_bar); + final ViewGroup hotseat = (ViewGroup) launcher.findViewById(R.id.hotseat); int iconIndex = parent.indexOfChild(v); int iconCount = parent.getChildCount(); int pageIndex = workspace.indexOfChild(layout); @@ -678,11 +689,13 @@ public class FocusHelper { break; case KeyEvent.KEYCODE_DPAD_DOWN: if (handleKeyEvent) { - // Select the closest icon in the next line, otherwise select the tab bar + // Select the closest icon in the next line, otherwise select the button bar View newIcon = getClosestBubbleTextViewOnLine(layout, parent, v, 1); if (newIcon != null) { newIcon.requestFocus(); wasHandled = true; + } else if (hotseat != null) { + hotseat.requestFocus(); } } break; diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java index deab13177..491691eb0 100644 --- a/src/com/android/launcher2/Hotseat.java +++ b/src/com/android/launcher2/Hotseat.java @@ -57,6 +57,7 @@ public class Hotseat extends FrameLayout { public void setup(Launcher launcher) { mLauncher = launcher; + setOnKeyListener(new HotseatBubbleTextViewKeyEventListener()); } CellLayout getLayout() { @@ -96,11 +97,14 @@ public class Hotseat extends FrameLayout { inflater.inflate(R.layout.application, mContent, false); allAppsButton.setCompoundDrawablesWithIntrinsicBounds(null, context.getResources().getDrawable(R.drawable.apps_hotseat_button), null, null); - // button.setText(context.getString(R.string.all_apps_button_label)); + // allAppsButton.setText(context.getString(R.string.all_apps_button_label)); + allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label)); allAppsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(android.view.View v) { - mLauncher.showAllApps(true); + if (mLauncher != null) { + mLauncher.showAllApps(true); + } } }); diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 0abdec090..3050be481 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2874,6 +2874,13 @@ public final class Launcher extends Activity final Workspace workspace = mWorkspace; for (int i=start; i Date: Thu, 25 Aug 2011 13:51:25 -0700 Subject: Tweaking the logging in the fail case, adding additional cases for where the db icon cache should be updated. (5205131) Change-Id: If5bf8d959ba9af40dbe8c13e6ed352a345e1679a --- src/com/android/launcher2/LauncherModel.java | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index b7f92ca47..8f1892492 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -209,11 +209,10 @@ public class LauncherModel extends BroadcastReceiver { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to moveItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to moveItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } // Items are added/removed from the corresponding FolderInfo elsewhere, such @@ -258,11 +257,10 @@ public class LauncherModel extends BroadcastReceiver { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to moveItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to resizeItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } } }); @@ -471,11 +469,10 @@ public class LauncherModel extends BroadcastReceiver { if (item != modelItem) { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item - Log.e(TAG, "item: " + ((item != null) ? item.toString() : "null")); - Log.e(TAG, "modelItem: " + ((modelItem != null) ? modelItem.toString() : - "null")); - throw new RuntimeException("Error: ItemInfo passed to updateItemInDatabase " + - "doesn't match original"); + String msg = "item: " + ((item != null) ? item.toString() : "null") + + "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + "Error: ItemInfo passed to updateItemInDatabase doesn't match original"; + throw new RuntimeException(msg); } } }); @@ -522,12 +519,14 @@ public class LauncherModel extends BroadcastReceiver { cr.delete(LauncherSettings.Favorites.getContentUri(info.id, false), null, null); sItemsIdMap.remove(info.id); sFolders.remove(info.id); + sDbIconCache.remove(info); sWorkspaceItems.remove(info); cr.delete(LauncherSettings.Favorites.CONTENT_URI_NO_NOTIFICATION, LauncherSettings.Favorites.CONTAINER + "=" + info.id, null); for (ItemInfo childInfo : info.contents) { sItemsIdMap.remove(childInfo.id); + sDbIconCache.remove(childInfo); } } }); -- cgit v1.2.3 From 18362aa3755c281c236f0a47341e1fb0f0ab1f52 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 29 Aug 2011 11:24:45 -0700 Subject: Fix crash when package list is updated bug# 5224498 Change-Id: I8953589c21e97fee3f5c3b95fb4a46beb39562b3 --- src/com/android/launcher2/LauncherModel.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 7d6206222..4ad8922f4 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -605,9 +605,11 @@ public class LauncherModel extends BroadcastReceiver { startLoaderFromBackground(); } else if (SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED.equals(action) || SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED.equals(action)) { - Callbacks callbacks = mCallbacks.get(); - if (callbacks != null) { - callbacks.bindSearchablesChanged(); + if (mCallbacks != null) { + Callbacks callbacks = mCallbacks.get(); + if (callbacks != null) { + callbacks.bindSearchablesChanged(); + } } } } -- cgit v1.2.3 From c1a5188be0f31d37e0ad6320aa4fa039e3211732 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 29 Aug 2011 14:02:47 -0700 Subject: Tagging where ItemInfos are created for debug purposes Change-Id: Iad3ed8ef4f81f4990c027ab46fd25b03b089babb --- src/com/android/launcher2/AllAppsList.java | 4 +-- src/com/android/launcher2/ApplicationInfo.java | 12 ++++---- .../android/launcher2/AppsCustomizePagedView.java | 4 +-- src/com/android/launcher2/FolderInfo.java | 3 +- .../android/launcher2/InstallWidgetReceiver.java | 2 +- src/com/android/launcher2/ItemInfo.java | 11 ++++++-- src/com/android/launcher2/Launcher.java | 6 ++-- .../android/launcher2/LauncherAppWidgetInfo.java | 6 ++-- src/com/android/launcher2/LauncherModel.java | 32 +++++++++++++--------- src/com/android/launcher2/PendingAddItemInfo.java | 8 +++++- src/com/android/launcher2/ShortcutInfo.java | 12 ++++---- src/com/android/launcher2/Workspace.java | 4 +-- 12 files changed, 65 insertions(+), 39 deletions(-) diff --git a/src/com/android/launcher2/AllAppsList.java b/src/com/android/launcher2/AllAppsList.java index 051b0bd1d..7c107a79a 100644 --- a/src/com/android/launcher2/AllAppsList.java +++ b/src/com/android/launcher2/AllAppsList.java @@ -91,7 +91,7 @@ class AllAppsList { if (matches.size() > 0) { for (ResolveInfo info : matches) { - add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null)); + add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null, "15")); } } } @@ -142,7 +142,7 @@ class AllAppsList { info.activityInfo.applicationInfo.packageName, info.activityInfo.name); if (applicationInfo == null) { - add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null)); + add(new ApplicationInfo(context.getPackageManager(), info, mIconCache, null, "16")); } else { mIconCache.remove(applicationInfo.componentName); mIconCache.getTitleAndIcon(applicationInfo, info, null); diff --git a/src/com/android/launcher2/ApplicationInfo.java b/src/com/android/launcher2/ApplicationInfo.java index 1fc1d1f55..bbca66445 100644 --- a/src/com/android/launcher2/ApplicationInfo.java +++ b/src/com/android/launcher2/ApplicationInfo.java @@ -60,7 +60,8 @@ class ApplicationInfo extends ItemInfo { int flags = 0; - ApplicationInfo() { + ApplicationInfo(String whereCreated) { + super(whereCreated); itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; } @@ -68,7 +69,8 @@ class ApplicationInfo extends ItemInfo { * Must not hold the Context. */ public ApplicationInfo(PackageManager pm, ResolveInfo info, IconCache iconCache, - HashMap labelCache) { + HashMap labelCache, String whereCreated) { + super(whereCreated); final String packageName = info.activityInfo.applicationInfo.packageName; this.componentName = new ComponentName(packageName, info.activityInfo.name); @@ -93,8 +95,8 @@ class ApplicationInfo extends ItemInfo { iconCache.getTitleAndIcon(this, info, labelCache); } - public ApplicationInfo(ApplicationInfo info) { - super(info); + public ApplicationInfo(ApplicationInfo info, String whereCreated) { + super(info, whereCreated); componentName = info.componentName; title = info.title.toString(); intent = new Intent(info.intent); @@ -133,6 +135,6 @@ class ApplicationInfo extends ItemInfo { } public ShortcutInfo makeShortcut() { - return new ShortcutInfo(this); + return new ShortcutInfo(this, "18"); } } diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 0e442eaeb..3adf404b5 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -1016,7 +1016,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen if (rawInfo instanceof AppWidgetProviderInfo) { // Fill in the widget information AppWidgetProviderInfo info = (AppWidgetProviderInfo) rawInfo; - createItemInfo = new PendingAddWidgetInfo(info, null, null); + createItemInfo = new PendingAddWidgetInfo(info, null, null, "13"); int[] cellSpans = CellLayout.rectToCell(getResources(), info.minWidth, info.minHeight, null); FastBitmapDrawable preview = new FastBitmapDrawable(data.generatedImages.get(i)); @@ -1026,7 +1026,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen } else if (rawInfo instanceof ResolveInfo) { // Fill in the shortcuts information ResolveInfo info = (ResolveInfo) rawInfo; - createItemInfo = new PendingAddItemInfo(); + createItemInfo = new PendingAddItemInfo("14"); createItemInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT; createItemInfo.componentName = new ComponentName(info.activityInfo.packageName, info.activityInfo.name); diff --git a/src/com/android/launcher2/FolderInfo.java b/src/com/android/launcher2/FolderInfo.java index 3ae31d278..0f8b9e06f 100644 --- a/src/com/android/launcher2/FolderInfo.java +++ b/src/com/android/launcher2/FolderInfo.java @@ -42,7 +42,8 @@ class FolderInfo extends ItemInfo { ArrayList listeners = new ArrayList(); - FolderInfo() { + FolderInfo(String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_FOLDER; } diff --git a/src/com/android/launcher2/InstallWidgetReceiver.java b/src/com/android/launcher2/InstallWidgetReceiver.java index 6b3763ce0..1b54e908c 100644 --- a/src/com/android/launcher2/InstallWidgetReceiver.java +++ b/src/com/android/launcher2/InstallWidgetReceiver.java @@ -187,7 +187,7 @@ public class InstallWidgetReceiver { final AppWidgetProviderInfo widgetInfo = mActivities.get(which).widgetInfo; final PendingAddWidgetInfo createInfo = new PendingAddWidgetInfo(widgetInfo, mMimeType, - mClipData); + mClipData, "4"); mLauncher.addAppWidgetFromDrop(createInfo, LauncherSettings.Favorites.CONTAINER_DESKTOP, mTargetLayoutScreen, null, mTargetLayoutPos); } diff --git a/src/com/android/launcher2/ItemInfo.java b/src/com/android/launcher2/ItemInfo.java index 8d4662495..5c05f163f 100644 --- a/src/com/android/launcher2/ItemInfo.java +++ b/src/com/android/launcher2/ItemInfo.java @@ -86,10 +86,16 @@ class ItemInfo { */ int[] dropPos = null; - ItemInfo() { + /* + * A tag to know where this item was created + */ + String whereCreated; + + ItemInfo(String whereCreated) { + this.whereCreated = whereCreated; } - ItemInfo(ItemInfo info) { + ItemInfo(ItemInfo info, String whereCreated) { id = info.id; cellX = info.cellX; cellY = info.cellY; @@ -98,6 +104,7 @@ class ItemInfo { screen = info.screen; itemType = info.itemType; container = info.container; + this.whereCreated = whereCreated; } /** diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 22a34e6c7..eaa98c1b4 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -175,7 +175,7 @@ public final class Launcher extends Activity private AppWidgetManager mAppWidgetManager; private LauncherAppWidgetHost mAppWidgetHost; - private ItemInfo mPendingAddInfo = new ItemInfo(); + private ItemInfo mPendingAddInfo = new ItemInfo("1"); private int[] mTmpAddItemCellCoordinates = new int[2]; private FolderInfo mFolderInfo; @@ -902,7 +902,7 @@ public final class Launcher extends Activity } // Build Launcher-specific widget info and save to database - LauncherAppWidgetInfo launcherInfo = new LauncherAppWidgetInfo(appWidgetId); + LauncherAppWidgetInfo launcherInfo = new LauncherAppWidgetInfo(appWidgetId, "2"); launcherInfo.spanX = spanXY[0]; launcherInfo.spanY = spanXY[1]; @@ -1446,7 +1446,7 @@ public final class Launcher extends Activity FolderIcon addFolder(CellLayout layout, long container, final int screen, int cellX, int cellY) { - final FolderInfo folderInfo = new FolderInfo(); + final FolderInfo folderInfo = new FolderInfo("3"); folderInfo.title = getText(R.string.folder_name); // Update the model diff --git a/src/com/android/launcher2/LauncherAppWidgetInfo.java b/src/com/android/launcher2/LauncherAppWidgetInfo.java index 844abb519..69eae178e 100644 --- a/src/com/android/launcher2/LauncherAppWidgetInfo.java +++ b/src/com/android/launcher2/LauncherAppWidgetInfo.java @@ -51,7 +51,8 @@ class LauncherAppWidgetInfo extends ItemInfo { /** * Constructor for use with AppWidgets that haven't been instantiated yet. */ - LauncherAppWidgetInfo(ComponentName providerName) { + LauncherAppWidgetInfo(ComponentName providerName, String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; this.providerName = providerName; @@ -61,7 +62,8 @@ class LauncherAppWidgetInfo extends ItemInfo { spanY = -1; } - LauncherAppWidgetInfo(int appWidgetId) { + LauncherAppWidgetInfo(int appWidgetId, String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; this.appWidgetId = appWidgetId; } diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 4ad8922f4..ea51d0169 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -210,8 +210,10 @@ public class LauncherModel extends BroadcastReceiver { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item String msg = "item: " + ((item != null) ? item.toString() : "null") + - "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + - "Error: ItemInfo passed to moveItemInDatabase doesn't match original"; + " modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + " creation tag of item: " + ((item != null) ? item.whereCreated : "null") + + " creation tag of modelItem: " + ((modelItem != null) ? modelItem.whereCreated : "null") + + " Error: ItemInfo passed to moveItemInDatabase doesn't match original"; throw new RuntimeException(msg); } @@ -258,8 +260,10 @@ public class LauncherModel extends BroadcastReceiver { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item String msg = "item: " + ((item != null) ? item.toString() : "null") + - "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + - "Error: ItemInfo passed to resizeItemInDatabase doesn't match original"; + " modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + " creation tag of item: " + ((item != null) ? item.whereCreated : "null") + + " creation tag of modelItem: " + ((modelItem != null) ? modelItem.whereCreated : "null") + + " Error: ItemInfo passed to resizeItemInDatabase doesn't match original"; throw new RuntimeException(msg); } } @@ -306,7 +310,7 @@ public class LauncherModel extends BroadcastReceiver { try { while (c.moveToNext()) { - ItemInfo item = new ItemInfo(); + ItemInfo item = new ItemInfo("17"); item.cellX = c.getInt(cellXIndex); item.cellY = c.getInt(cellYIndex); item.spanX = c.getInt(spanXIndex); @@ -470,8 +474,10 @@ public class LauncherModel extends BroadcastReceiver { // the modelItem needs to match up perfectly with item if our model is to be // consistent with the database-- for now, just require modelItem == item String msg = "item: " + ((item != null) ? item.toString() : "null") + - "modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + - "Error: ItemInfo passed to updateItemInDatabase doesn't match original"; + " modelItem: " + ((modelItem != null) ? modelItem.toString() : "null") + + " creation tag of item: " + ((item != null) ? item.whereCreated : "null") + + " creation tag of modelItem: " + ((modelItem != null) ? modelItem.whereCreated : "null") + + " Error: ItemInfo passed to updateItemInDatabase doesn't match original"; throw new RuntimeException(msg); } } @@ -1059,7 +1065,7 @@ public class LauncherModel extends BroadcastReceiver { + id + " appWidgetId=" + appWidgetId); itemsToRemove.add(id); } else { - appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId); + appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId, "5"); appWidgetInfo.id = id; appWidgetInfo.screen = c.getInt(screenIndex); appWidgetInfo.cellX = c.getInt(cellXIndex); @@ -1345,7 +1351,7 @@ public class LauncherModel extends BroadcastReceiver { for (int j=0; i labelCache) { Bitmap icon = null; - final ShortcutInfo info = new ShortcutInfo(); + final ShortcutInfo info = new ShortcutInfo("7"); ComponentName componentName = intent.getComponent(); if (componentName == null) { @@ -1606,7 +1612,7 @@ public class LauncherModel extends BroadcastReceiver { int titleIndex) { Bitmap icon = null; - final ShortcutInfo info = new ShortcutInfo(); + final ShortcutInfo info = new ShortcutInfo("8"); info.itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT; // TODO: If there's an explicit component and we can't install that, delete it. @@ -1765,7 +1771,7 @@ public class LauncherModel extends BroadcastReceiver { } } - final ShortcutInfo info = new ShortcutInfo(); + final ShortcutInfo info = new ShortcutInfo("9"); if (icon == null) { if (fallbackIcon != null) { @@ -1833,7 +1839,7 @@ public class LauncherModel extends BroadcastReceiver { FolderInfo folderInfo = folders.get(id); if (folderInfo == null) { // No placeholder -- create a new instance - folderInfo = new FolderInfo(); + folderInfo = new FolderInfo("10"); folders.put(id, folderInfo); } return folderInfo; diff --git a/src/com/android/launcher2/PendingAddItemInfo.java b/src/com/android/launcher2/PendingAddItemInfo.java index 7b564e051..6ee300bfa 100644 --- a/src/com/android/launcher2/PendingAddItemInfo.java +++ b/src/com/android/launcher2/PendingAddItemInfo.java @@ -28,6 +28,10 @@ class PendingAddItemInfo extends ItemInfo { * The component that will be created. */ ComponentName componentName; + + public PendingAddItemInfo(String whereCreated) { + super(whereCreated); + } } class PendingAddWidgetInfo extends PendingAddItemInfo { @@ -39,7 +43,9 @@ class PendingAddWidgetInfo extends PendingAddItemInfo { String mimeType; Parcelable configurationData; - public PendingAddWidgetInfo(AppWidgetProviderInfo i, String dataMimeType, Parcelable data) { + public PendingAddWidgetInfo( + AppWidgetProviderInfo i, String dataMimeType, Parcelable data, String whereCreated) { + super(whereCreated); itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; componentName = i.provider; minWidth = i.minWidth; diff --git a/src/com/android/launcher2/ShortcutInfo.java b/src/com/android/launcher2/ShortcutInfo.java index c0f80aeec..6d4853ff4 100644 --- a/src/com/android/launcher2/ShortcutInfo.java +++ b/src/com/android/launcher2/ShortcutInfo.java @@ -62,12 +62,14 @@ class ShortcutInfo extends ItemInfo { */ private Bitmap mIcon; - ShortcutInfo() { + ShortcutInfo(String whereCreated) { + super(whereCreated); itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; + this.whereCreated = whereCreated; } - public ShortcutInfo(ShortcutInfo info) { - super(info); + public ShortcutInfo(ShortcutInfo info, String whereCreated) { + super(info, whereCreated); title = info.title.toString(); intent = new Intent(info.intent); if (info.iconResource != null) { @@ -80,8 +82,8 @@ class ShortcutInfo extends ItemInfo { } /** TODO: Remove this. It's only called by ApplicationInfo.makeShortcut. */ - public ShortcutInfo(ApplicationInfo info) { - super(info); + public ShortcutInfo(ApplicationInfo info, String whereCreated) { + super(info, whereCreated); title = info.title.toString(); intent = new Intent(info.intent); customIcon = false; diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 1c13f1409..3e0b466e6 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -2575,7 +2575,7 @@ public class Workspace extends SmoothPagedView // that widget final AppWidgetProviderInfo widgetInfo = widgets.get(0).widgetInfo; final PendingAddWidgetInfo createInfo = - new PendingAddWidgetInfo(widgetInfo, mimeType, data); + new PendingAddWidgetInfo(widgetInfo, mimeType, data, "11"); mLauncher.addAppWidgetFromDrop(createInfo, LauncherSettings.Favorites.CONTAINER_DESKTOP, mCurrentPage, null, pos); } else { @@ -3091,7 +3091,7 @@ public class Workspace extends SmoothPagedView case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT: if (info.container == NO_ID && info instanceof ApplicationInfo) { // Came from all apps -- make a copy - info = new ShortcutInfo((ApplicationInfo) info); + info = new ShortcutInfo((ApplicationInfo) info, "12"); } view = mLauncher.createShortcut(R.layout.application, cellLayout, (ShortcutInfo) info); -- cgit v1.2.3 From 925ae21058782accfb2340100b46595daefc1bfb Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 12 Sep 2011 11:47:18 -0700 Subject: Fix regression: QSB is not clickable Change-Id: I7e3d17d59237f4f3ad4820fa0a43bad7624c6b45 --- res/layout-port/launcher.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index 898e849ea..b45800ef5 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -46,10 +46,6 @@ android:layout_gravity="bottom" android:layout_marginBottom="@dimen/button_bar_height" /> - - + + Date: Wed, 14 Sep 2011 17:56:27 -0700 Subject: Fixing regression where scroll position would be offset when rotated. - Fixes the scrolling issue only in conjunction with framework measure fix - Updating the wallpaper gallery item background Change-Id: Id7ff602837dbe1d8a2aaec6ec49b667f11d01bc9 --- res/drawable-hdpi/grid_focused.9.png | Bin 0 -> 200 bytes res/drawable-hdpi/grid_pressed.9.png | Bin 0 -> 184 bytes res/drawable-hdpi/grid_selected.9.png | Bin 0 -> 202 bytes res/drawable-mdpi/grid_focused.9.png | Bin 0 -> 170 bytes res/drawable-mdpi/grid_pressed.9.png | Bin 0 -> 165 bytes res/drawable-mdpi/grid_selected.9.png | Bin 0 -> 165 bytes res/drawable-xhdpi/grid_focused.9.png | Bin 0 -> 193 bytes res/drawable-xhdpi/grid_pressed.9.png | Bin 0 -> 190 bytes res/drawable-xhdpi/grid_selected.9.png | Bin 0 -> 199 bytes res/drawable/wallpaper_gallery_item.xml | 22 ++++++++++++++++++++++ res/layout/wallpaper_item.xml | 1 + src/com/android/launcher2/PagedView.java | 19 ++++++++++--------- 12 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 res/drawable-hdpi/grid_focused.9.png create mode 100644 res/drawable-hdpi/grid_pressed.9.png create mode 100644 res/drawable-hdpi/grid_selected.9.png create mode 100644 res/drawable-mdpi/grid_focused.9.png create mode 100644 res/drawable-mdpi/grid_pressed.9.png create mode 100644 res/drawable-mdpi/grid_selected.9.png create mode 100644 res/drawable-xhdpi/grid_focused.9.png create mode 100644 res/drawable-xhdpi/grid_pressed.9.png create mode 100644 res/drawable-xhdpi/grid_selected.9.png create mode 100644 res/drawable/wallpaper_gallery_item.xml diff --git a/res/drawable-hdpi/grid_focused.9.png b/res/drawable-hdpi/grid_focused.9.png new file mode 100644 index 000000000..cb5aea89a Binary files /dev/null and b/res/drawable-hdpi/grid_focused.9.png differ diff --git a/res/drawable-hdpi/grid_pressed.9.png b/res/drawable-hdpi/grid_pressed.9.png new file mode 100644 index 000000000..548accef6 Binary files /dev/null and b/res/drawable-hdpi/grid_pressed.9.png differ diff --git a/res/drawable-hdpi/grid_selected.9.png b/res/drawable-hdpi/grid_selected.9.png new file mode 100644 index 000000000..02ab90253 Binary files /dev/null and b/res/drawable-hdpi/grid_selected.9.png differ diff --git a/res/drawable-mdpi/grid_focused.9.png b/res/drawable-mdpi/grid_focused.9.png new file mode 100644 index 000000000..c7e6b06da Binary files /dev/null and b/res/drawable-mdpi/grid_focused.9.png differ diff --git a/res/drawable-mdpi/grid_pressed.9.png b/res/drawable-mdpi/grid_pressed.9.png new file mode 100644 index 000000000..09a7e3fbe Binary files /dev/null and b/res/drawable-mdpi/grid_pressed.9.png differ diff --git a/res/drawable-mdpi/grid_selected.9.png b/res/drawable-mdpi/grid_selected.9.png new file mode 100644 index 000000000..a40b05826 Binary files /dev/null and b/res/drawable-mdpi/grid_selected.9.png differ diff --git a/res/drawable-xhdpi/grid_focused.9.png b/res/drawable-xhdpi/grid_focused.9.png new file mode 100644 index 000000000..20d4647df Binary files /dev/null and b/res/drawable-xhdpi/grid_focused.9.png differ diff --git a/res/drawable-xhdpi/grid_pressed.9.png b/res/drawable-xhdpi/grid_pressed.9.png new file mode 100644 index 000000000..73a784b60 Binary files /dev/null and b/res/drawable-xhdpi/grid_pressed.9.png differ diff --git a/res/drawable-xhdpi/grid_selected.9.png b/res/drawable-xhdpi/grid_selected.9.png new file mode 100644 index 000000000..eb0f3dc2f Binary files /dev/null and b/res/drawable-xhdpi/grid_selected.9.png differ diff --git a/res/drawable/wallpaper_gallery_item.xml b/res/drawable/wallpaper_gallery_item.xml new file mode 100644 index 000000000..b7052bd39 --- /dev/null +++ b/res/drawable/wallpaper_gallery_item.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/res/layout/wallpaper_item.xml b/res/layout/wallpaper_item.xml index 0834ce680..bd3fa2bd3 100644 --- a/res/layout/wallpaper_item.xml +++ b/res/layout/wallpaper_item.xml @@ -18,5 +18,6 @@ android:id="@+id/wallpaper_image" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:background="@drawable/wallpaper_gallery_item" android:scaleType="fitXY" android:focusable="true" /> diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index dca4d1448..9a105d104 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -539,15 +539,6 @@ public abstract class PagedView extends ViewGroup { } if (DEBUG) Log.d(TAG, "PagedView.onLayout()"); - if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { - setHorizontalScrollBarEnabled(false); - int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage); - scrollTo(newX, 0); - mScroller.setFinalX(newX); - setHorizontalScrollBarEnabled(true); - mFirstLayout = false; - } - final int verticalPadding = mPaddingTop + mPaddingBottom; final int childCount = getChildCount(); int childLeft = 0; @@ -578,6 +569,16 @@ public abstract class PagedView extends ViewGroup { childLeft += childWidth + mPageSpacing; } } + + if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { + setHorizontalScrollBarEnabled(false); + int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage); + scrollTo(newX, 0); + mScroller.setFinalX(newX); + setHorizontalScrollBarEnabled(true); + mFirstLayout = false; + } + if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { mFirstLayout = false; } -- cgit v1.2.3 From 50a729414db7d0319bd29dc809e2f9886f86a9f7 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 22 Sep 2011 13:59:02 -0700 Subject: Updating default workspace, fixing missing Browser icon. (5358657) Change-Id: Ibdfbc5084afacfa951355e2e7582d5a86fd742a5 --- res/xml/default_workspace.xml | 58 +++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml index 4ca51fa95..61e8f3fc3 100644 --- a/res/xml/default_workspace.xml +++ b/res/xml/default_workspace.xml @@ -18,16 +18,32 @@ + + + - - - + - + launcher:packageName="com.google.android.talk" + launcher:className="com.google.android.talk.SigningInActivity" /> + launcher:packageName="com.google.android.youtube" + launcher:className="com.google.android.youtube.app.honeycomb.Shell$HomeActivity" /> @@ -86,6 +96,18 @@ launcher:y="1" launcher:spanX="2" launcher:spanY="2" /> + + @@ -112,7 +134,7 @@ launcher:x="3" launcher:y="0" />