diff options
-rw-r--r-- | res/values/strings.xml | 10 | ||||
-rw-r--r-- | src/com/android/launcher2/AllAppsPagedView.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher2/CustomizePagedView.java | 29 |
3 files changed, 32 insertions, 9 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 4d88a33..04aea87 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -147,8 +147,14 @@ <!-- Describes the button for getting details/info about currently selected application. Text is not displayed, but provided for accessibility. [CHAR_LIMIT=none] --> <string name="cab_menu_app_info">Application details</string> - <!-- Appears in the CAB when an app is selected in All Apps. [CHAR_LIMIT=50] --> - <string name="cab_selection_text">1 application selected</string> + <!-- Appears in the CAB when an app is selected in All Apps or Customize mode. [CHAR_LIMIT=50] --> + <string name="cab_app_selection_text">1 application selected</string> + <!-- Appears in the CAB when a widget is selected in Customize mode. [CHAR_LIMIT=50] --> + <string name="cab_widget_selection_text">1 widget selected</string> + <!-- Appears in the CAB when a folder is selected in Customize mode. [CHAR_LIMIT=50] --> + <string name="cab_folder_selection_text">1 folder selected</string> + <!-- Appears in the CAB when a shortcut is selected in Customize mode. [CHAR_LIMIT=50] --> + <string name="cab_shortcut_selection_text">1 shortcut selected</string> <!-- Permissions: --> <skip /> diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java index 3c39474..3fb1679 100644 --- a/src/com/android/launcher2/AllAppsPagedView.java +++ b/src/com/android/launcher2/AllAppsPagedView.java @@ -417,7 +417,7 @@ public class AllAppsPagedView extends PagedView @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { - mode.setTitle(R.string.cab_selection_text); + mode.setTitle(R.string.cab_app_selection_text); // Until the workspace has a selection mode and the CAB supports drag-and-drop, we // take a hybrid approach: grab the views from the workspace and stuff them into the CAB. diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java index f6cff05..f55b46e 100644 --- a/src/com/android/launcher2/CustomizePagedView.java +++ b/src/com/android/launcher2/CustomizePagedView.java @@ -124,6 +124,8 @@ public class CustomizePagedView extends PagedView private static final int sMinWidgetCellHSpan = 2; private static final int sMaxWidgetCellHSpan = 4; + private int mChoiceModeTitleText; + // The scale factor for widget previews inside the widget drawer private static final float sScaleFactor = 0.75f; @@ -336,15 +338,29 @@ public class CustomizePagedView extends PagedView // On certain pages, we allow single tap to mark items as selected so that they can be // dropped onto the mini workspaces + boolean enterChoiceMode = false; switch (mCustomizationType) { case WidgetCustomization: + mChoiceModeTitleText = R.string.cab_widget_selection_text; + enterChoiceMode = true; + break; case ApplicationCustomization: + mChoiceModeTitleText = R.string.cab_app_selection_text; + enterChoiceMode = true; + break; case FolderCustomization: + mChoiceModeTitleText = R.string.cab_folder_selection_text; + enterChoiceMode = true; + break; case ShortcutCustomization: - if (isChoiceMode(CHOICE_MODE_NONE)) { - startChoiceMode(CHOICE_MODE_SINGLE, this); - } + mChoiceModeTitleText = R.string.cab_shortcut_selection_text; + enterChoiceMode = true; + break; + default: + break; + } + if (enterChoiceMode) { if (v instanceof Checkable) { final Checkable c = (Checkable) v; final boolean wasChecked = c.isChecked(); @@ -354,11 +370,12 @@ public class CustomizePagedView extends PagedView // End the current choice mode when we have no items selected if (!c.isChecked()) { endChoiceMode(); + } else if (isChoiceMode(CHOICE_MODE_NONE)) { + endChoiceMode(); + startChoiceMode(CHOICE_MODE_SINGLE, this); } } return; - default: - break; } // Otherwise, we just handle the single click here @@ -798,7 +815,7 @@ public class CustomizePagedView extends PagedView @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { - mode.setTitle(R.string.cab_selection_text); + mode.setTitle(mChoiceModeTitleText); return true; } |