summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2010-09-27 11:30:20 -0700
committerMichael Jurka <mikejurka@google.com>2010-09-27 11:30:42 -0700
commit3125d9dec8709a6c95039c7b35d27494da46eaab (patch)
tree77c4169bc29373d621e775089606fe32472eb0cb /src
parentd0d43010c7a091b6ade407d30e490527a8d16120 (diff)
downloadandroid_packages_apps_Trebuchet-3125d9dec8709a6c95039c7b35d27494da46eaab.tar.gz
android_packages_apps_Trebuchet-3125d9dec8709a6c95039c7b35d27494da46eaab.tar.bz2
android_packages_apps_Trebuchet-3125d9dec8709a6c95039c7b35d27494da46eaab.zip
Making the CAB text match the type of item selected
in customization mode.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AllAppsPagedView.java2
-rw-r--r--src/com/android/launcher2/CustomizePagedView.java29
2 files changed, 24 insertions, 7 deletions
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index 3c394741c..3fb167986 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 f6cff05ed..f55b46e26 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;
}