From 6079b05445e8ce09d7d2d37efe27cf569c853fbf Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 23 May 2011 12:56:50 -0700 Subject: [PATCH 1/3] Fix crash on phones --- .../app_market_generic.png | Bin .../app_market_generic.png | Bin 2 files changed, 0 insertions(+), 0 deletions(-) rename res/{drawable-large-hdpi => drawable-hdpi}/app_market_generic.png (100%) rename res/{drawable-large-mdpi => drawable-mdpi}/app_market_generic.png (100%) diff --git a/res/drawable-large-hdpi/app_market_generic.png b/res/drawable-hdpi/app_market_generic.png similarity index 100% rename from res/drawable-large-hdpi/app_market_generic.png rename to res/drawable-hdpi/app_market_generic.png diff --git a/res/drawable-large-mdpi/app_market_generic.png b/res/drawable-mdpi/app_market_generic.png similarity index 100% rename from res/drawable-large-mdpi/app_market_generic.png rename to res/drawable-mdpi/app_market_generic.png From 092338a6324eee812ed6c65e613cb87d9745f033 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 21 Jul 2011 11:22:13 -0700 Subject: [PATCH 2/3] 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 c0df443eeb..a3c263d736 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. From 7529fa2405fb64455d35f587cd145b2590e7baf8 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 21 Jul 2011 11:46:32 -0700 Subject: [PATCH 3/3] 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 57a6584dd4..476d06374b 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 233fd6fbb6..3783d566ce 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 deab13177d..491691eb00 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 0abdec090a..3050be4813 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