summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-05-23 11:34:11 -0700
committerWinson Chung <winsonc@google.com>2011-05-23 11:34:11 -0700
commit59d0bb0d1e3af45449b070d3233f9e9a4f0fd6ed (patch)
treee6d84803fcc8bf10dcf13ec78ea4f51d82188f93
parent737c3aa05f3274d3828caf853fafadecddba5792 (diff)
downloadandroid_packages_apps_Trebuchet-59d0bb0d1e3af45449b070d3233f9e9a4f0fd6ed.tar.gz
android_packages_apps_Trebuchet-59d0bb0d1e3af45449b070d3233f9e9a4f0fd6ed.tar.bz2
android_packages_apps_Trebuchet-59d0bb0d1e3af45449b070d3233f9e9a4f0fd6ed.zip
Fixing clipped landscape layout and crash when tapping to add widgets.
Change-Id: Ifcd2090cf9d374731726356b611750e1bca5c3cf
-rw-r--r--res/layout-land/workspace_screen.xml4
-rw-r--r--res/values-land/dimens.xml2
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java30
3 files changed, 19 insertions, 17 deletions
diff --git a/res/layout-land/workspace_screen.xml b/res/layout-land/workspace_screen.xml
index 9323f58ac..f2bac599e 100644
--- a/res/layout-land/workspace_screen.xml
+++ b/res/layout-land/workspace_screen.xml
@@ -24,7 +24,7 @@
launcher:cellWidth="@dimen/workspace_cell_width"
launcher:cellHeight="@dimen/workspace_cell_height"
- launcher:xAxisStartPadding="65dip"
- launcher:xAxisEndPadding="65dip"
+ launcher:xAxisStartPadding="48dip"
+ launcher:xAxisEndPadding="0dip"
launcher:yAxisStartPadding="0dip"
launcher:yAxisEndPadding="0dip"/>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index e1b021428..b3d0b2e81 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -15,7 +15,7 @@
-->
<resources>
- <dimen name="workspace_cell_width">106dip</dimen>
+ <dimen name="workspace_cell_width">96dip</dimen>
<dimen name="workspace_cell_height">74dip</dimen>
<dimen name="folder_cell_width">100dip</dimen>
<dimen name="folder_cell_height">74dip</dimen>
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 87be63efa..fabd9e40b 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -293,20 +293,22 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
});
} else if (v instanceof PagedViewWidget) {
- final ResolveInfo info = (ResolveInfo) v.getTag();
- if (mWallpapers.contains(info)) {
- // Start the wallpaper picker
- animateClickFeedback(v, new Runnable() {
- @Override
- public void run() {
- // add the shortcut
- Intent createWallpapersIntent = new Intent(Intent.ACTION_SET_WALLPAPER);
- ComponentName name = new ComponentName(info.activityInfo.packageName,
- info.activityInfo.name);
- createWallpapersIntent.setComponent(name);
- mLauncher.processWallpaper(createWallpapersIntent);
- }
- });
+ if (v.getTag() instanceof ResolveInfo) {
+ final ResolveInfo info = (ResolveInfo) v.getTag();
+ if (mWallpapers.contains(info)) {
+ // Start the wallpaper picker
+ animateClickFeedback(v, new Runnable() {
+ @Override
+ public void run() {
+ // add the shortcut
+ Intent createWallpapersIntent = new Intent(Intent.ACTION_SET_WALLPAPER);
+ ComponentName name = new ComponentName(info.activityInfo.packageName,
+ info.activityInfo.name);
+ createWallpapersIntent.setComponent(name);
+ mLauncher.processWallpaper(createWallpapersIntent);
+ }
+ });
+ }
} else {
// Add the widget to the current workspace screen
Workspace w = mLauncher.getWorkspace();