summaryrefslogtreecommitdiff
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher3/Launcher.java8
-rw-r--r--src/com/android/launcher3/Workspace.java1
-rw-r--r--src/com/android/launcher3/views/OptionsPopupView.java5
3 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index aaeeb634f3..3a8679e21b 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2328,6 +2328,8 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
if (isInState(NORMAL)) {
shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.all_apps_button_label),
KeyEvent.KEYCODE_A, KeyEvent.META_CTRL_ON));
+ shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.widget_button_text),
+ KeyEvent.KEYCODE_W, KeyEvent.META_CTRL_ON));
}
final View currentFocus = getCurrentFocus();
if (currentFocus != null) {
@@ -2376,6 +2378,12 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
return true;
}
break;
+ case KeyEvent.KEYCODE_W:
+ if (isInState(NORMAL)) {
+ OptionsPopupView.openWidgets(this);
+ return true;
+ }
+ break;
}
}
return super.onKeyShortcut(keyCode, event);
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 66fb3c6b3e..3188e6ecb9 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -547,6 +547,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
// created CellLayout.
CellLayout newScreen = (CellLayout) LayoutInflater.from(getContext()).inflate(
R.layout.workspace_screen, this, false /* attachToRoot */);
+ newScreen.getShortcutsAndWidgets().setId(R.id.workspace_page_container);
int paddingLeftRight = mLauncher.getDeviceProfile().cellLayoutPaddingLeftRightPx;
int paddingBottom = mLauncher.getDeviceProfile().cellLayoutBottomPaddingPx;
newScreen.setPadding(paddingLeftRight, 0, paddingLeftRight, paddingBottom);
diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java
index c17857f77a..db4c492263 100644
--- a/src/com/android/launcher3/views/OptionsPopupView.java
+++ b/src/com/android/launcher3/views/OptionsPopupView.java
@@ -153,7 +153,10 @@ public class OptionsPopupView extends ArrowPopup
}
public static boolean onWidgetsClicked(View view) {
- Launcher launcher = Launcher.getLauncher(view.getContext());
+ return openWidgets(Launcher.getLauncher(view.getContext()));
+ }
+
+ public static boolean openWidgets(Launcher launcher) {
if (launcher.getPackageManager().isSafeMode()) {
Toast.makeText(launcher, R.string.safemode_widget_error, Toast.LENGTH_SHORT).show();
return false;