diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 7bdc9cfa80..4e60e665c5 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -92,11 +92,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/res/drawable/btn_g.xml b/res/drawable/btn_g.xml
deleted file mode 100644
index d033b438f3..0000000000
--- a/res/drawable/btn_g.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/res/drawable/btn_list.xml b/res/drawable/btn_list.xml
deleted file mode 100644
index 84a033ef8c..0000000000
--- a/res/drawable/btn_list.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/res/drawable/g_background.9.png b/res/drawable/g_background.9.png
deleted file mode 100644
index a4bf817644..0000000000
Binary files a/res/drawable/g_background.9.png and /dev/null differ
diff --git a/res/drawable/g_bar_background.xml b/res/drawable/g_bar_background.xml
deleted file mode 100644
index b9f6694943..0000000000
--- a/res/drawable/g_bar_background.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
diff --git a/res/drawable/g_normal.png b/res/drawable/g_normal.png
deleted file mode 100644
index 2ae97036b0..0000000000
Binary files a/res/drawable/g_normal.png and /dev/null differ
diff --git a/res/drawable/g_pressed.png b/res/drawable/g_pressed.png
deleted file mode 100644
index 13667dcbb3..0000000000
Binary files a/res/drawable/g_pressed.png and /dev/null differ
diff --git a/res/drawable/g_selected.png b/res/drawable/g_selected.png
deleted file mode 100644
index faed865ab6..0000000000
Binary files a/res/drawable/g_selected.png and /dev/null differ
diff --git a/res/drawable/gestures_background.xml b/res/drawable/gestures_background.xml
deleted file mode 100644
index 59c11dc606..0000000000
--- a/res/drawable/gestures_background.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
diff --git a/res/drawable/gestures_frame.9.png b/res/drawable/gestures_frame.9.png
deleted file mode 100644
index 3119a815bc..0000000000
Binary files a/res/drawable/gestures_frame.9.png and /dev/null differ
diff --git a/res/drawable/list_normal.png b/res/drawable/list_normal.png
deleted file mode 100644
index ee05949c76..0000000000
Binary files a/res/drawable/list_normal.png and /dev/null differ
diff --git a/res/drawable/list_pressed.png b/res/drawable/list_pressed.png
deleted file mode 100644
index 8e3c68c860..0000000000
Binary files a/res/drawable/list_pressed.png and /dev/null differ
diff --git a/res/drawable/list_selected.png b/res/drawable/list_selected.png
deleted file mode 100644
index 93858f4353..0000000000
Binary files a/res/drawable/list_selected.png and /dev/null differ
diff --git a/res/drawable/mirrored_shadow.9.png b/res/drawable/mirrored_shadow.9.png
deleted file mode 100644
index 84516dddb0..0000000000
Binary files a/res/drawable/mirrored_shadow.9.png and /dev/null differ
diff --git a/res/drawable/plus_normal.png b/res/drawable/plus_normal.png
deleted file mode 100644
index ddc588807f..0000000000
Binary files a/res/drawable/plus_normal.png and /dev/null differ
diff --git a/res/drawable/plus_pressed.png b/res/drawable/plus_pressed.png
deleted file mode 100644
index 872f092a86..0000000000
Binary files a/res/drawable/plus_pressed.png and /dev/null differ
diff --git a/res/drawable/plus_selected.png b/res/drawable/plus_selected.png
deleted file mode 100644
index 32c441f07d..0000000000
Binary files a/res/drawable/plus_selected.png and /dev/null differ
diff --git a/res/layout/gestures.xml b/res/layout/gestures.xml
deleted file mode 100644
index a22ce0674f..0000000000
--- a/res/layout/gestures.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/layout/gestures_settings.xml b/res/layout/gestures_settings.xml
deleted file mode 100644
index 712cb22d2d..0000000000
--- a/res/layout/gestures_settings.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/layout/gestures_settings_item.xml b/res/layout/gestures_settings_item.xml
deleted file mode 100644
index 1563dfe501..0000000000
--- a/res/layout/gestures_settings_item.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 4211a6a236..c1de7f4863 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -60,22 +60,4 @@
"Povoluje aplikaci změnit nastavení a odkazy plochy."
"Vyhledávání Google"
"Problém s načtením widgetu"
- "Nakreslete gesto"
- "Přidat zástupce"
- "Zobrazit zástupce"
- "Nerozpoznáno"
- "Bylo přidáno gesto %s"
- "Gesto nebylo možné vytvořit."
- "Načítání gest..."
- "Žádná gesta"
- "Gesta"
- "Přejmenovat"
- "Smazat"
- "Gesto bylo smazáno"
- "Přejmenovat gesto"
- "Název gesta"
- "Gesta"
- "Nastavení"
- "Spouštět tlačítkem plochy"
- "Po stisknutí tlačítka plochy kreslit gesta"
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index c3f75fd6f9..3050f001d4 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -65,40 +65,4 @@
"Tillader et program at ændre indstillingerne og genvejene i Start."
"Google-søgning"
"Der er problemer med at indlæse widget"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index d77481e90a..4dcb40152c 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -60,22 +60,4 @@
"Ermöglicht einer Anwendung, die Einstellungen und Shortcuts auf der Startseite zu ändern."
"Google-Suche"
"Problem beim Laden des Widgets"
- "Eine Bewegung zeichnen"
- "Verknüpfung hinzufügen"
- "Verknüpfung anzeigen"
- "Nicht erkannt"
- "Bewegung %s wurde hinzugefügt."
- "Bewegung konnte nicht erstellt werden."
- "Bewegungen werden geladen..."
- "Keine Bewegungen"
- "Bewegungen"
- "Umbenennen"
- "Löschen"
- "Bewegung wurde gelöscht."
- "Bewegung umbenennen"
- "Name der Bewegung"
- "Bewegungen"
- "Einstellungen"
- "Über Startseite öffnen"
- "Drücken Sie die Taste für die Startseite, um Bewegungen zu zeichnen."
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index 51366c1f7b..c0516b8e60 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -65,40 +65,4 @@
"Επιτρέπει σε μια εφαρμογή την αλλαγή των ρυθμίσεων και των συντομεύσεων στην αρχική οθόνη."
"Αναζήτηση Google"
"Παρουσιάστηκε πρόβλημα στη φόρτωση του γραφικού στοιχείου"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index a72cdc6ef1..a2f12dc7ed 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -65,40 +65,4 @@
"Permite a una aplicación cambiar la configuración y los accesos directos de la página principal."
"Búsqueda de Google"
"Problema al cargar el widget"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 50e597cb1d..5bef440d66 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -60,22 +60,4 @@
"Permite que una aplicación modifique la configuración y los accesos directos de la página principal."
"Búsqueda de Google"
"Problema al cargar el widget"
- "Dibujar un gesto"
- "Añadir acceso directo"
- "Mostrar acceso directo"
- "No reconocido"
- "Gesto %s añadido"
- "No se ha podido crear el gesto."
- "Cargando gestos..."
- "Ningún gesto"
- "Gestos"
- "Cambiar nombre"
- "Suprimir"
- "Gesto suprimido"
- "Cambiar nombre de gesto"
- "Nombre del gesto"
- "Gestos"
- "Configuración"
- "Utilizar la tecla de página principal para iniciar"
- "Pulsa la tecla de página principal para dibujar gestos."
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index d55ef0c651..91bea49ea5 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -60,22 +60,4 @@
"Permet à une application de modifier les paramètres et les raccourcis de la page d\'accueil."
"Recherche Google"
"Problème lors du chargement du widget"
- "Créer un geste"
- "Ajouter un raccourci"
- "Afficher le raccourci"
- "Non reconnu"
- "Le geste %s a bien été ajouté."
- "Impossible de créer le geste."
- "Chargement des gestes en cours…"
- "Aucun geste"
- "Gestes"
- "Renommer"
- "Supprimer"
- "Le geste a bien été supprimé."
- "Renommer le geste"
- "Nom du geste"
- "Gestes"
- "Paramètres"
- "Utiliser la touche Accueil pour commencer"
- "Appuyer sur la touche Accueil pour créer un geste"
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 605fb511de..404bb3a948 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -60,22 +60,4 @@
"Consente a un\'applicazione di modificare le impostazioni e le scorciatoie in Home."
"Ricerca Google"
"Errore durante il caricamento del widget"
- "Traccia un gesto"
- "Aggiungi scorciatoia"
- "Mostra scorciatoia"
- "Non riconosciuto"
- "Gesto %s aggiunto"
- "Impossibile creare il gesto"
- "Caricamento gesti in corso..."
- "Nessun gesto"
- "Gesti"
- "Rinomina"
- "Elimina"
- "Gesto eliminato"
- "Rinomina gesto"
- "Nome gesto"
- "Gesti"
- "Impostazioni"
- "Utilizza \"home\" per l\'avvio"
- "Premi il tasto \"home\" per tracciare gesti"
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 91c981291b..c2391c09b8 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -65,40 +65,4 @@
"ホームの設定とショートカットの変更をアプリケーションに許可します。"
"Google検索"
"ウィジェットを表示できません"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 943c9776fb..43f27a72db 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -65,40 +65,4 @@
"응용프로그램이 홈에 있는 설정 및 바로가기를 변경할 수 있도록 합니다."
"Google 검색"
"위젯을 로드하는 중 문제가 발생했습니다."
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index a205b22098..8189f091c6 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -65,40 +65,4 @@
"Lar applikasjonen endre innstillinger og snarveier på skrivebordet."
"Google-søk"
"Problem under lasting av gadget"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index bc12b8052b..f3db12e66c 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -60,22 +60,4 @@
"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina wijzigen."
"Google Zoeken"
"Probleem bij het laden van widget"
- "Een gebaar tekenen"
- "Snelkoppeling toevoegen"
- "Snelkoppeling weergeven"
- "Onbekend"
- "Gebaar %s toegevoegd"
- "Gebaar kan niet worden gemaakt"
- "Gebaren laden..."
- "Geen gebaren"
- "Gebaren"
- "Naam wijzigen"
- "Verwijderen"
- "Gebaar verwijderd"
- "Naam van gebaar wijzigen"
- "Naam van gebaar"
- "Gebaren"
- "Instellingen"
- "Gebruik de startpaginatoets om te starten"
- "Druk op de startpaginatoets om gebaren te tekenen"
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 3f545a3b3b..ac5d9f3c6c 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -60,22 +60,4 @@
"Umożliwia aplikacji zmianę ustawień i skrótów strony głównej."
"Szukaj w Google"
"Problem podczas ładowania widżetu"
- "Określ gest"
- "Dodaj skrót"
- "Pokaż skrót"
- "Nierozpoznany"
- "Dodano gest %s"
- "Nie można utworzyć gestu"
- "Trwa wczytywanie gestów..."
- "Brak gestów"
- "Gesty"
- "Zmień nazwę"
- "Usuń"
- "Gest usunięty"
- "Zmień nazwę gestu"
- "Nazwa gestu"
- "Gesty"
- "Ustawienia"
- "Użyj klawisza głównego, aby uruchomić"
- "Naciśnij klawisz główny, aby określić gesty"
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index b284c485f3..04afce3fd3 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -65,40 +65,4 @@
"Permite que uma aplicação altere as definições e os atalhos do ecrã principal."
"Pesquisa do Google"
"Erro ao carregar o widget"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index e1dff59b70..a2b3b5c2c3 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -65,40 +65,4 @@
"Permite que um aplicativo altere as configurações e atalhos na Página inicial."
"Pesquisa do Google"
"Problema ao carregar o widget"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 4bafe9c4c5..dea57b39c8 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -65,40 +65,4 @@
"Позволяет приложению изменять настройки и ярлыки на главном экране."
"Поиск Google"
"Не удалось загрузить виджет"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index 119bcb112a..142ec0c3d3 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -65,40 +65,4 @@
"Tillåter att ett program ändrar inställningar och genvägar på startsidan."
"Google Sökning"
"Det gick inte att läsa in widgeten"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index 40ab2ec702..218e50a397 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -65,40 +65,4 @@
"Bir uygulamaya Ana Sayfadaki ayarları ve kısayolları değiştirme izni verir."
"Google Arama"
"Widget yüklenirken sorun oluştu"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index d7ab9df524..fc53e54743 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -65,40 +65,4 @@
"允许应用程序更改主屏幕上的设置和快捷方式。"
"Google 搜索"
"载入窗口小部件时出现问题"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 51eb658720..18eb31d988 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -60,22 +60,4 @@
"允許應用程式變更首頁中的設定和捷徑。"
"Google 搜尋"
"載入小工具時發生問題"
- "描繪觸控動作"
- "新增捷徑"
- "顯示捷徑"
- "無法辨識"
- "已新增觸控動作 %s"
- "無法建立觸控動作"
- "正在載入觸控動作..."
- "無觸控動作"
- "觸控動作"
- "重新命名"
- "刪除"
- "已刪除觸控動作"
- "重新命名觸控動作"
- "觸控動作名稱"
- "觸控動作"
- "設定"
- "使用主螢幕啟動"
- "按下主螢幕鍵來描繪觸控動作"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e43459d9ab..4a6d7863a7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -126,44 +126,4 @@
Problem loading widget
-
-
-
-
-
- Draw a gesture
-
- Add shortcut
-
- Show shortcut
-
- Unrecognized
-
- Added gesture "%s"
-
- Gesture could not be created
-
- Loading gestures...
-
- No gestures
-
- Gestures
-
- Rename
-
- Delete
-
- Gesture deleted
-
- Rename gesture
-
- Gesture name
-
- Gestures
-
- Settings
-
- Use home to launch
-
- Press home key to draw gestures
diff --git a/src/com/android/launcher/GesturesActivity.java b/src/com/android/launcher/GesturesActivity.java
deleted file mode 100644
index 5c67a1efee..0000000000
--- a/src/com/android/launcher/GesturesActivity.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher;
-
-import android.app.ListActivity;
-import android.app.Dialog;
-import android.app.AlertDialog;
-import android.os.Bundle;
-import android.os.AsyncTask;
-import android.widget.ArrayAdapter;
-import android.widget.TextView;
-import android.widget.AdapterView;
-import android.widget.Toast;
-import android.widget.EditText;
-import android.widget.BaseAdapter;
-import android.widget.CheckBox;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.SharedPreferences;
-import android.content.res.Resources;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.LayoutInflater;
-import android.view.ContextMenu;
-import android.view.MenuItem;
-import android.gesture.GestureLibrary;
-import android.gesture.Gesture;
-import android.graphics.Bitmap;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.BitmapDrawable;
-import android.text.TextUtils;
-import android.database.DataSetObserver;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Collections;
-import java.util.Map;
-
-public class GesturesActivity extends ListActivity implements AdapterView.OnItemClickListener {
- private static final int MENU_ID_RENAME = 1;
- private static final int MENU_ID_REMOVE = 2;
-
- private static final int DIALOG_RENAME_GESTURE = 1;
-
- // Type: long (id)
- private static final String GESTURES_INFO_ID = "gestures.info_id";
-
- private final Comparator mSorter =
- new LauncherModel.ApplicationInfoComparator();
-
- private GesturesAdapter mAdapter;
- private GestureLibrary mStore;
- private GesturesLoadTask mTask;
-
- private Dialog mRenameDialog;
- private EditText mInput;
- private ApplicationInfo mCurrentRenameInfo;
- private SharedPreferences mPreferences;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.gestures_settings);
-
- mAdapter = new GesturesAdapter(this);
- setListAdapter(new GesturesSettingsAdapter(mAdapter));
- getListView().setOnItemClickListener(this);
-
- mStore = Launcher.getGestureLibrary(this);
- mTask = (GesturesLoadTask) new GesturesLoadTask().execute();
-
- registerForContextMenu(getListView());
-
- mPreferences = getSharedPreferences(GesturesConstants.PREFERENCES_NAME, MODE_PRIVATE);
- }
-
- @SuppressWarnings({ "UnusedDeclaration" })
- public void back(View v) {
- finish();
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
-
- if (mTask != null && mTask.getStatus() != GesturesLoadTask.Status.FINISHED) {
- mTask.cancel(true);
- mTask = null;
- }
-
- cleanupRenameDialog();
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
-
- if (mCurrentRenameInfo != null) {
- outState.putLong(GESTURES_INFO_ID, mCurrentRenameInfo.id);
- }
- }
-
- @Override
- protected void onRestoreInstanceState(Bundle state) {
- super.onRestoreInstanceState(state);
-
- long id = state.getLong(GESTURES_INFO_ID, -1);
- if (id != -1) {
- mCurrentRenameInfo = Launcher.getModel().queryGesture(this, String.valueOf(id));
- }
- }
-
- @Override
- public void onCreateContextMenu(ContextMenu menu, View v,
- ContextMenu.ContextMenuInfo menuInfo) {
-
- super.onCreateContextMenu(menu, v, menuInfo);
-
- AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
- if (info.position > 2) {
- menu.setHeaderTitle(((TextView) info.targetView).getText());
-
- menu.add(0, MENU_ID_RENAME, 0, R.string.gestures_rename);
- menu.add(0, MENU_ID_REMOVE, 0, R.string.gestures_delete);
- }
- }
-
- @Override
- public boolean onContextItemSelected(MenuItem item) {
- final AdapterView.AdapterContextMenuInfo menuInfo = (AdapterView.AdapterContextMenuInfo)
- item.getMenuInfo();
- final ApplicationInfo info = (ApplicationInfo) menuInfo.targetView.getTag();
-
- switch (item.getItemId()) {
- case MENU_ID_RENAME:
- renameGesture(info);
- return true;
- case MENU_ID_REMOVE:
- deleteGesture(info);
- return true;
- }
-
- return super.onContextItemSelected(item);
- }
-
- private void renameGesture(ApplicationInfo info) {
- mCurrentRenameInfo = info;
- showDialog(DIALOG_RENAME_GESTURE);
- }
-
- @Override
- protected Dialog onCreateDialog(int id) {
- if (id == DIALOG_RENAME_GESTURE) {
- return createRenameDialog();
- }
- return super.onCreateDialog(id);
- }
-
- @Override
- protected void onPrepareDialog(int id, Dialog dialog) {
- super.onPrepareDialog(id, dialog);
- if (id == DIALOG_RENAME_GESTURE && mCurrentRenameInfo != null) {
- mInput.setText(mCurrentRenameInfo.title);
- }
- }
-
- private Dialog createRenameDialog() {
- final View layout = View.inflate(this, R.layout.rename_folder, null);
- mInput = (EditText) layout.findViewById(R.id.folder_name);
- ((TextView) layout.findViewById(R.id.label)).setText(R.string.gestures_rename_label);
-
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setIcon(0);
- builder.setTitle(getString(R.string.gestures_rename_title));
- builder.setCancelable(true);
- builder.setOnCancelListener(new Dialog.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- cleanupRenameDialog();
- }
- });
- builder.setNegativeButton(getString(R.string.cancel_action),
- new Dialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- cleanupRenameDialog();
- }
- }
- );
- builder.setPositiveButton(getString(R.string.rename_action),
- new Dialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- changeGestureName();
- }
- }
- );
- builder.setView(layout);
- return builder.create();
- }
-
- private void changeGestureName() {
- final String name = mInput.getText().toString();
- if (!TextUtils.isEmpty(name)) {
- final ApplicationInfo renameInfo = mCurrentRenameInfo;
- final GesturesActivity.GesturesAdapter adapter = mAdapter;
- final int count = adapter.getCount();
-
- // Simple linear search, there should not be enough items to warrant
- // a more sophisticated search
- for (int i = 0; i < count; i++) {
- final ApplicationInfo info = adapter.getItem(i);
- if (info.id == renameInfo.id) {
- info.title = mInput.getText();
- LauncherModel.updateGestureInDatabase(this, info);
- break;
- }
- }
-
- adapter.notifyDataSetChanged();
- }
- mCurrentRenameInfo = null;
- }
-
- private void cleanupRenameDialog() {
- if (mRenameDialog != null) {
- mRenameDialog.dismiss();
- mRenameDialog = null;
- }
- mCurrentRenameInfo = null;
- }
-
- private void deleteGesture(ApplicationInfo info) {
- mStore.removeEntry(String.valueOf(info.id));
- // TODO: On a thread?
- mStore.save();
-
- final GesturesActivity.GesturesAdapter adapter = mAdapter;
- adapter.setNotifyOnChange(false);
- adapter.remove(info);
- adapter.sort(mSorter);
- adapter.notifyDataSetChanged();
-
- LauncherModel.deleteGestureFromDatabase(this, info);
-
- Toast.makeText(this, R.string.gestures_delete_success, Toast.LENGTH_SHORT).show();
- }
-
- public void onItemClick(AdapterView> parent, View view, int position, long id) {
- if (position == 1) {
- final CheckBox checkBox = (CheckBox) view.findViewById(R.id.checkbox);
- checkBox.toggle();
- mPreferences.edit().putBoolean(GesturesConstants.PREFERENCES_HOME_KEY,
- checkBox.isChecked()).commit();
- }
- }
-
- private class GesturesLoadTask extends AsyncTask {
- private int mThumbnailSize;
- private int mThumbnailInset;
- private int mPathColor;
-
- @Override
- protected void onPreExecute() {
- super.onPreExecute();
-
- final Resources resources = getResources();
- mPathColor = resources.getColor(R.color.gesture_color);
- mThumbnailInset = (int) resources.getDimension(R.dimen.gesture_thumbnail_inset);
- mThumbnailSize = (int) resources.getDimension(R.dimen.gesture_thumbnail_size);
- }
-
- protected Boolean doInBackground(Void... params) {
- if (isCancelled()) return Boolean.FALSE;
-
- final GestureLibrary store = mStore;
-
- if (store.load()) {
- final LauncherModel model = Launcher.getModel();
-
- for (String name : store.getGestureEntries()) {
- if (isCancelled()) break;
-
- final Gesture gesture = store.getGestures(name).get(0);
- final Bitmap bitmap = gesture.toBitmap(mThumbnailSize, mThumbnailSize,
- mThumbnailInset, mPathColor);
- final ApplicationInfo info = model.queryGesture(GesturesActivity.this, name);
-
- mAdapter.addBitmap(info.id, bitmap);
- publishProgress(info);
- }
-
- return Boolean.TRUE;
- }
-
- return Boolean.FALSE;
- }
-
- @Override
- protected void onProgressUpdate(ApplicationInfo... values) {
- super.onProgressUpdate(values);
-
- final GesturesActivity.GesturesAdapter adapter = mAdapter;
- adapter.setNotifyOnChange(false);
-
- for (ApplicationInfo info : values) {
- adapter.add(info);
- }
-
- adapter.sort(mSorter);
- adapter.notifyDataSetChanged();
- }
- }
-
- private class GesturesAdapter extends ArrayAdapter {
- private final LayoutInflater mInflater;
- private final Map mThumbnails = Collections.synchronizedMap(
- new HashMap());
-
- public GesturesAdapter(Context context) {
- super(context, 0);
- mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- }
-
- void addBitmap(Long id, Bitmap bitmap) {
- mThumbnails.put(id, new BitmapDrawable(bitmap));
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- if (convertView == null) {
- convertView = mInflater.inflate(R.layout.gestures_settings_item, parent, false);
- }
-
- final ApplicationInfo info = getItem(position);
- final TextView label = (TextView) convertView;
-
- label.setTag(info);
- label.setText(info.title);
- label.setCompoundDrawablesWithIntrinsicBounds(info.icon, null,
- mThumbnails.get(info.id), null);
-
- return convertView;
- }
- }
-
- private class GesturesSettingsAdapter extends BaseAdapter {
- private static final int FIXED_CHILDREN_COUNT = 3;
-
- private static final int VIEW_TYPE_SEPARATOR = 0;
- private static final int VIEW_TYPE_CHECKBOX = 1;
-
- private final GesturesAdapter mAdapter;
- private final LayoutInflater mInflater;
-
- public GesturesSettingsAdapter(GesturesAdapter adapter) {
- mAdapter = adapter;
- mInflater = adapter.mInflater;
- adapter.registerDataSetObserver(new DataSetObserver() {
- @Override
- public void onChanged() {
- notifyDataSetChanged();
- }
-
- @Override
- public void onInvalidated() {
- notifyDataSetInvalidated();
- }
- });
- }
-
- public int getCount() {
- return FIXED_CHILDREN_COUNT + mAdapter.getCount();
- }
-
- public Object getItem(int position) {
- if (position < FIXED_CHILDREN_COUNT) {
- return String.valueOf(position);
- }
- return mAdapter.getItem(position - FIXED_CHILDREN_COUNT);
- }
-
- public long getItemId(int position) {
- return position;
- }
-
- @Override
- public int getItemViewType(int position) {
- if (position < FIXED_CHILDREN_COUNT) {
- switch (position) {
- case 0:
- case 2:
- return VIEW_TYPE_SEPARATOR;
- case 1:
- return VIEW_TYPE_CHECKBOX;
- }
- }
- return 2 + super.getItemViewType(position);
- }
-
- @Override
- public int getViewTypeCount() {
- return 2 + mAdapter.getViewTypeCount();
- }
-
- @Override
- public boolean areAllItemsEnabled() {
- return false;
- }
-
- @Override
- public boolean isEnabled(int position) {
- return position != 0 && position != 2;
- }
-
- public View getView(int position, View convertView, ViewGroup parent) {
- if (position < FIXED_CHILDREN_COUNT) {
- // NOTE: Don't bother with ViewHolders here, we only have 3 items and
- // the list is likely to not be very long
- switch (position) {
- case 0:
- convertView = createHeader(convertView, parent,
- R.string.gestures_group_settings);
- break;
- case 1:
- convertView = createSetting(convertView, parent,
- R.string.gestures_preference_hotkey_title,
- R.string.gestures_preference_hotkey_summary);
- break;
- case 2:
- convertView = createHeader(convertView, parent,
- R.string.gestures_group_gestures);
- break;
- }
- return convertView;
- }
- return mAdapter.getView(position - FIXED_CHILDREN_COUNT, convertView, parent);
- }
-
- private View createSetting(View convertView, ViewGroup parent,
- int title, int summary) {
-
- if (convertView == null) {
- convertView = mInflater.inflate(R.layout.list_checkbox_2lines, parent, false);
- }
-
- ((TextView) convertView.findViewById(R.id.title)).setText(title);
- ((TextView) convertView.findViewById(R.id.summary)).setText(summary);
- ((CheckBox) convertView.findViewById(R.id.checkbox)).setChecked(
- mPreferences.getBoolean(GesturesConstants.PREFERENCES_HOME_KEY, false));
-
- return convertView;
- }
-
- private View createHeader(View convertView, ViewGroup parent, int text) {
- if (convertView == null) {
- convertView = mInflater.inflate(R.layout.list_category, parent, false);
- }
- ((TextView) convertView).setText(text);
- return convertView;
- }
- }
-}
diff --git a/src/com/android/launcher/GesturesConstants.java b/src/com/android/launcher/GesturesConstants.java
deleted file mode 100644
index 93a1f10ba8..0000000000
--- a/src/com/android/launcher/GesturesConstants.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher;
-
-interface GesturesConstants {
- final double PREDICTION_THRESHOLD = 1.0;
- final String STORE_NAME = "gestures";
- final long MATCH_DELAY = 370;
- final float LENGTH_THRESHOLD = 120.0f;
- int PATH_SAMPLE_COUNT = 10;
- String PREFERENCES_NAME = "gestures";
- String PREFERENCES_HOME_KEY = "gestures.home";
-}
diff --git a/src/com/android/launcher/GesturesPanel.java b/src/com/android/launcher/GesturesPanel.java
deleted file mode 100644
index c0fce472e8..0000000000
--- a/src/com/android/launcher/GesturesPanel.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher;
-
-import android.widget.LinearLayout;
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-
-public class GesturesPanel extends LinearLayout {
- public GesturesPanel(Context context) {
- super(context);
- }
-
- public GesturesPanel(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- @Override
- public boolean isOpaque() {
- return true;
- }
-
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- final int keyCode = event.getKeyCode();
-
- switch (keyCode) {
- case KeyEvent.KEYCODE_VOLUME_UP:
- case KeyEvent.KEYCODE_VOLUME_DOWN:
- case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
- case KeyEvent.KEYCODE_MUTE:
- case KeyEvent.KEYCODE_HEADSETHOOK:
- case KeyEvent.KEYCODE_MEDIA_STOP:
- case KeyEvent.KEYCODE_MEDIA_NEXT:
- case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
- case KeyEvent.KEYCODE_MEDIA_REWIND:
- case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
- case KeyEvent.KEYCODE_CAMERA:
- case KeyEvent.KEYCODE_CALL:
- case KeyEvent.KEYCODE_SEARCH:
- return ((Launcher) mContext).getWorkspace().getRootView().dispatchKeyEvent(event);
- }
-
- if (keyCode == KeyEvent.KEYCODE_BACK) {
- if (event.getAction() == KeyEvent.ACTION_DOWN) {
- ((Launcher) mContext).hideGesturesPanel();
- return true;
- }
- } else {
- return super.dispatchKeyEvent(event);
- }
- return false;
- }
-}
diff --git a/src/com/android/launcher/Launcher.java b/src/com/android/launcher/Launcher.java
index 25ad4e5756..3fd141d5a0 100644
--- a/src/com/android/launcher/Launcher.java
+++ b/src/com/android/launcher/Launcher.java
@@ -32,7 +32,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.SharedPreferences;
import android.content.Intent.ShortcutIconResource;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
@@ -67,8 +66,6 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.view.MotionEvent;
-import android.view.Gravity;
import android.view.View.OnLongClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
@@ -76,16 +73,8 @@ import android.widget.GridView;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
-import android.widget.ImageView;
-import android.widget.PopupWindow;
-import android.widget.Button;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProviderInfo;
-import android.gesture.GestureOverlayView;
-import android.gesture.GestureLibraries;
-import android.gesture.GestureLibrary;
-import android.gesture.Gesture;
-import android.gesture.Prediction;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -106,9 +95,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private static final boolean PROFILE_DRAWER = false;
private static final boolean PROFILE_ROTATE = false;
private static final boolean DEBUG_USER_INTERFACE = false;
- private static final boolean DEBUG_GESTURES = false;
-
- private static final boolean CONFIG_GESTURES_IMMEDIATE_MODE = true;
private static final int WALLPAPER_SCREENS_SPAN = 2;
@@ -117,8 +103,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private static final int MENU_WALLPAPER_SETTINGS = MENU_ADD + 1;
private static final int MENU_SEARCH = MENU_WALLPAPER_SETTINGS + 1;
private static final int MENU_NOTIFICATIONS = MENU_SEARCH + 1;
- private static final int MENU_GESTURES = MENU_NOTIFICATIONS + 1;
- private static final int MENU_SETTINGS = MENU_GESTURES + 1;
+ private static final int MENU_SETTINGS = MENU_NOTIFICATIONS + 1;
private static final int REQUEST_CREATE_SHORTCUT = 1;
private static final int REQUEST_CREATE_LIVE_FOLDER = 4;
@@ -127,9 +112,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private static final int REQUEST_PICK_SHORTCUT = 7;
private static final int REQUEST_PICK_LIVE_FOLDER = 8;
private static final int REQUEST_PICK_APPWIDGET = 9;
- private static final int REQUEST_PICK_GESTURE_ACTION = 10;
- private static final int REQUEST_CREATE_GESTURE_ACTION = 11;
- private static final int REQUEST_CREATE_GESTURE_APPLICATION_ACTION = 12;
static final String EXTRA_SHORTCUT_DUPLICATE = "duplicate";
@@ -172,12 +154,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private static final String RUNTIME_STATE_PENDING_FOLDER_RENAME = "launcher.rename_folder";
// Type: long
private static final String RUNTIME_STATE_PENDING_FOLDER_RENAME_ID = "launcher.rename_folder_id";
- // Type: Gesture (Parcelable)
- private static final String RUNTIME_STATE_PENDING_GESTURE = "launcher.gesture";
- // Type: boolean
- private static final String RUNTIME_STATE_GESTURES_PANEL = "launcher.gesture_panel_showing";
- // Type: Gesture (Parcelable)
- private static final String RUNTIME_STATE_GESTURES_PANEL_GESTURE = "launcher.gesture_panel_gesture";
private static final LauncherModel sModel = new LauncherModel();
@@ -188,8 +164,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private static WallpaperIntentReceiver sWallpaperReceiver;
- private static GestureLibrary sLibrary;
-
private final BroadcastReceiver mApplicationsReceiver = new ApplicationsIntentReceiver();
private final ContentObserver mObserver = new FavoritesChangeObserver();
@@ -230,24 +204,11 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private DesktopBinder mBinder;
- private View mGesturesPanel;
- private GestureOverlayView mGesturesOverlay;
- private ImageView mGesturesAdd;
- private PopupWindow mGesturesWindow;
- private Launcher.GesturesProcessor mGesturesProcessor;
- private Gesture mCurrentGesture;
- private GesturesAction mGesturesAction;
- private boolean mHideGesturesPanel;
- private TextView mGesturesPrompt;
- private Button mGesturesSend;
-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mInflater = getLayoutInflater();
- getGestureLibrary(this);
-
mAppWidgetManager = AppWidgetManager.getInstance(this);
mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID);
@@ -405,11 +366,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
// For example, the user would PICK_SHORTCUT for "Music playlist", and we
// launch over to the Music app to actually CREATE_SHORTCUT.
- if (resultCode == RESULT_OK && (mAddItemCellInfo != null ||
- ((requestCode == REQUEST_PICK_GESTURE_ACTION ||
- requestCode == REQUEST_CREATE_GESTURE_ACTION ||
- requestCode == REQUEST_CREATE_GESTURE_APPLICATION_ACTION) && mCurrentGesture != null))) {
-
+ if (resultCode == RESULT_OK && mAddItemCellInfo != null) {
switch (requestCode) {
case REQUEST_PICK_APPLICATION:
completeAddApplication(this, data, mAddItemCellInfo, !mDesktopLocked);
@@ -432,16 +389,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
case REQUEST_CREATE_APPWIDGET:
completeAddAppWidget(data, mAddItemCellInfo, !mDesktopLocked);
break;
- case REQUEST_PICK_GESTURE_ACTION:
- processShortcut(data, REQUEST_CREATE_GESTURE_APPLICATION_ACTION,
- REQUEST_CREATE_GESTURE_ACTION);
- break;
- case REQUEST_CREATE_GESTURE_ACTION:
- completeCreateGesture(data, true);
- break;
- case REQUEST_CREATE_GESTURE_APPLICATION_ACTION:
- completeCreateGesture(data, false);
- break;
}
} else if (requestCode == REQUEST_PICK_APPWIDGET &&
resultCode == RESULT_CANCELED && data != null) {
@@ -486,22 +433,9 @@ public final class Launcher extends Activity implements View.OnClickListener, On
@Override
protected void onPause() {
super.onPause();
- if (mGesturesWindow != null) {
- mGesturesWindow.setAnimationStyle(0);
- mGesturesWindow.update();
- }
closeDrawer(false);
}
- @Override
- protected void onStop() {
- super.onStop();
- if (mHideGesturesPanel) {
- mHideGesturesPanel = false;
- hideGesturesPanel();
- }
- }
-
@Override
public Object onRetainNonConfigurationInstance() {
// Flag any binder to stop early before switching
@@ -589,31 +523,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
mFolderInfo = sModel.getFolderById(this, id);
mRestoring = true;
}
-
- mCurrentGesture = (Gesture) savedState.get(RUNTIME_STATE_PENDING_GESTURE);
-
- boolean gesturesShowing = savedState.getBoolean(RUNTIME_STATE_GESTURES_PANEL, false);
- if (gesturesShowing) {
- if (mCurrentGesture == null) {
- mCurrentGesture = (Gesture) savedState.get(RUNTIME_STATE_GESTURES_PANEL_GESTURE);
- }
- final Gesture gesture = mCurrentGesture;
- mWorkspace.post(new Runnable() {
- public void run() {
- showGesturesPanel(false);
- if (gesture != null && mWorkspace.getParent() != null) {
- mGesturesProcessor.matchGesture(gesture);
- mWorkspace.post(new Runnable() {
- public void run() {
- if (gesture != null && mWorkspace.getParent() != null) {
- mGesturesOverlay.setGesture(gesture);
- }
- }
- });
- }
- }
- });
- }
}
/**
@@ -661,72 +570,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
dragLayer.setIgnoredDropTarget(grid);
dragLayer.setDragScoller(workspace);
dragLayer.setDragListener(deleteZone);
-
- mGesturesPanel = mInflater.inflate(R.layout.gestures, mDragLayer, false);
- final View gesturesPanel = mGesturesPanel;
-
- mGesturesAction = new GesturesAction();
-
- mGesturesPrompt = (TextView) gesturesPanel.findViewById(R.id.gestures_prompt);
- mGesturesSend = (Button) gesturesPanel.findViewById(R.id.gestures_action);
- mGesturesSend.setOnClickListener(mGesturesAction);
-
- mGesturesAdd = (ImageView) gesturesPanel.findViewById(R.id.gestures_add);
- final ImageView gesturesAdd = mGesturesAdd;
- gesturesAdd.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- createGesture();
- }
- });
-
- gesturesPanel.findViewById(R.id.gestures_list).setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- startActivity(new Intent(Launcher.this, GesturesActivity.class));
- }
- });
-
- mGesturesOverlay = (GestureOverlayView) gesturesPanel.findViewById(R.id.gestures_overlay);
- mGesturesProcessor = new GesturesProcessor();
-
- final GestureOverlayView overlay = mGesturesOverlay;
- overlay.addOnGestureListener(mGesturesProcessor);
- }
-
- private void createGesture() {
- if (!mWaitingForResult) {
- mCurrentGesture = mGesturesOverlay.getGesture();
- mWaitingForResult = true;
- pickShortcut(REQUEST_PICK_GESTURE_ACTION, R.string.title_select_shortcut);
- }
- }
-
- private void completeCreateGesture(Intent data, boolean isShortcut) {
- ApplicationInfo info;
-
- if (isShortcut) {
- info = infoFromShortcutIntent(this, data);
- } else {
- info = infoFromApplicationIntent(this, data);
- }
-
- boolean success = false;
- if (info != null) {
- info.isGesture = true;
-
- if (LauncherModel.addGestureToDatabase(this, info, false)) {
- mGesturesProcessor.addGesture(String.valueOf(info.id), mCurrentGesture);
- mGesturesProcessor.update(info, mCurrentGesture);
- Toast.makeText(this, getString(R.string.gestures_created, info.title),
- Toast.LENGTH_SHORT).show();
- success = true;
- }
- }
-
- if (!success) {
- Toast.makeText(this, getString(R.string.gestures_failed), Toast.LENGTH_SHORT).show();
- }
-
- mCurrentGesture = null;
}
/**
@@ -977,32 +820,8 @@ public final class Launcher extends Activity implements View.OnClickListener, On
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) !=
Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) {
- // TODO: This really should not be done here every time
- final SharedPreferences preferences =
- getSharedPreferences(GesturesConstants.PREFERENCES_NAME, MODE_PRIVATE);
- final boolean homeKey = preferences.getBoolean(
- GesturesConstants.PREFERENCES_HOME_KEY, false);
-
- if (!homeKey) {
- if (!mWorkspace.isDefaultScreenShowing()) {
- mWorkspace.moveToDefaultScreen();
- }
-
- if (mGesturesWindow == null || mGesturesWindow.isShowing()) {
- hideGesturesPanel();
- }
- } else {
- if (mGesturesPanel != null && mDragLayer.getWindowVisibility() == View.VISIBLE
- && (mDragLayer.hasWindowFocus() || (mGesturesWindow != null
- && mGesturesWindow.isShowing()))) {
-
- SearchManager searchManager =
- (SearchManager) getSystemService(Context.SEARCH_SERVICE);
-
- if (!searchManager.isVisible()) {
- onHomeKeyPressed();
- }
- }
+ if (!mWorkspace.isDefaultScreenShowing()) {
+ mWorkspace.moveToDefaultScreen();
}
closeDrawer();
@@ -1019,83 +838,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
}
- private void onHomeKeyPressed() {
- if (mGesturesWindow == null || !mGesturesWindow.isShowing()) {
- showGesturesPanel();
- } else {
- hideGesturesPanel();
- }
- }
-
- private void showGesturesPanel() {
- showGesturesPanel(true);
- }
-
- private void showGesturesPanel(boolean animate) {
- resetGesturesPrompt();
-
- mGesturesAdd.setVisibility(View.GONE);
-
- mGesturesOverlay.clear(false);
-
- PopupWindow window;
- if (mGesturesWindow == null) {
- mGesturesWindow = new PopupWindow(this);
- window = mGesturesWindow;
- window.setFocusable(true);
- window.setTouchable(true);
- window.setBackgroundDrawable(getResources().getDrawable(
- android.R.drawable.screen_background_dark));
- window.setContentView(mGesturesPanel);
- } else {
- window = mGesturesWindow;
- }
- window.setAnimationStyle(animate ? com.android.internal.R.style.Animation_Toast : 0);
-
- final int[] xy = new int[2];
- final DragLayer dragLayer = mDragLayer;
- dragLayer.getLocationOnScreen(xy);
-
- window.setWidth(dragLayer.getWidth());
- window.setHeight(dragLayer.getHeight() - 1);
- window.showAtLocation(dragLayer, Gravity.TOP | Gravity.LEFT, xy[0], xy[1] + 1);
- }
-
- private void resetGesturesPrompt() {
- mGesturesAction.intent = null;
- mGesturesPrompt.setText(R.string.gestures_instructions);
- mGesturesPrompt.setVisibility(View.VISIBLE);
- mGesturesSend.setVisibility(View.GONE);
- }
-
- private void setGestureUnknown() {
- mGesturesAction.intent = null;
- mGesturesPrompt.setText(R.string.gestures_unknown);
- mGesturesPrompt.setVisibility(View.VISIBLE);
- mGesturesSend.setVisibility(View.GONE);
- }
-
- private void setGestureAction(Drawable icon, CharSequence title) {
- mGesturesPrompt.setVisibility(View.GONE);
- mGesturesSend.setVisibility(View.VISIBLE);
- mGesturesSend.setText(title);
- mGesturesSend.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
- }
-
- void hideGesturesPanel() {
- hideGesturesPanel(true);
- }
-
- void hideGesturesPanel(boolean animate) {
- if (mGesturesWindow != null) {
- final PopupWindow popupWindow = mGesturesWindow;
- popupWindow.setAnimationStyle(animate ?
- com.android.internal.R.style.Animation_Toast : 0);
- popupWindow.update();
- popupWindow.dismiss();
- }
- }
-
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
// Do not call super here
@@ -1146,21 +888,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
outState.putBoolean(RUNTIME_STATE_PENDING_FOLDER_RENAME, true);
outState.putLong(RUNTIME_STATE_PENDING_FOLDER_RENAME_ID, mFolderInfo.id);
}
-
- if (mCurrentGesture != null && mWaitingForResult) {
- outState.putParcelable(RUNTIME_STATE_PENDING_GESTURE, mCurrentGesture);
- }
-
- if (mGesturesWindow != null && mGesturesWindow.isShowing()) {
- outState.putBoolean(RUNTIME_STATE_GESTURES_PANEL, true);
-
- if (mCurrentGesture == null || !mWaitingForResult) {
- final Gesture gesture = mGesturesOverlay.getGesture();
- if (gesture != null) {
- outState.putParcelable(RUNTIME_STATE_GESTURES_PANEL_GESTURE, gesture);
- }
- }
- }
}
@Override
@@ -1177,7 +904,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
TextKeyListener.getInstance().release();
- hideGesturesPanel(false);
mAllAppsGrid.clearTextFilter();
mAllAppsGrid.setAdapter(null);
sModel.unbind();
@@ -1280,11 +1006,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
.setIcon(com.android.internal.R.drawable.ic_menu_notifications)
.setAlphabeticShortcut('N');
- // TODO: Remove
- menu.add(0, MENU_GESTURES, 0, R.string.menu_gestures)
- .setIcon(com.android.internal.R.drawable.ic_menu_compose)
- .setAlphabeticShortcut('G');
-
final Intent settings = new Intent(android.provider.Settings.ACTION_SETTINGS);
settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
@@ -1321,9 +1042,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
case MENU_NOTIFICATIONS:
showNotifications();
return true;
- case MENU_GESTURES:
- showGesturesPanel();
- return true;
}
return super.onOptionsItemSelected(item);
@@ -1852,7 +1570,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
void startActivitySafely(Intent intent) {
- mHideGesturesPanel = true;
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivity(intent);
@@ -1979,14 +1696,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
return sModel;
}
- static GestureLibrary getGestureLibrary(Context context) {
- if (sLibrary == null) {
- // The context is not kept by the library so it's safe to do this
- sLibrary = GestureLibraries.fromPrivateFile(context, GesturesConstants.STORE_NAME);
- }
- return sLibrary;
- }
-
void closeAllApplications() {
mDrawer.close();
}
@@ -2511,139 +2220,4 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
}
}
-
- private class GesturesProcessor implements GestureOverlayView.OnGestureListener {
-
- private final GestureMatcher mMatcher = new GestureMatcher();
-
- GesturesProcessor() {
- // TODO: Maybe the load should happen on a background thread?
- sLibrary.load();
- }
-
- public void onGestureStarted(GestureOverlayView overlay, MotionEvent event) {
- //noinspection PointlessBooleanExpression,ConstantConditions
- if (!CONFIG_GESTURES_IMMEDIATE_MODE) {
- overlay.removeCallbacks(mMatcher);
- resetGesturesPrompt();
- }
-
- mGesturesAdd.setVisibility(View.GONE);
- }
-
- public void onGesture(GestureOverlayView overlay, MotionEvent event) {
- }
-
- public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
- if (CONFIG_GESTURES_IMMEDIATE_MODE) {
- mMatcher.gesture = overlay.getGesture();
- if (mMatcher.gesture.getLength() < GesturesConstants.LENGTH_THRESHOLD) {
- overlay.clear(false);
- if (mGesturesAction.intent != null) {
- mGesturesAction.intent = null;
- setGestureAction(null, getString(R.string.gestures_unknown));
- }
- } else {
- mMatcher.run();
- }
- } else {
- overlay.removeCallbacks(mMatcher);
-
- mMatcher.gesture = overlay.getGesture();
- if (mMatcher.gesture.getLength() < GesturesConstants.LENGTH_THRESHOLD) {
- overlay.clear(false);
- if (mGesturesAction.intent != null) {
- mGesturesAction.intent = null;
- setGestureAction(null, getString(R.string.gestures_unknown));
- }
- } else {
- overlay.postDelayed(mMatcher, GesturesConstants.MATCH_DELAY);
- }
- }
- }
-
- void matchGesture(Gesture gesture) {
- mGesturesAdd.setVisibility(View.VISIBLE);
-
- if (gesture != null) {
- final ArrayList predictions = sLibrary.recognize(gesture);
-
- if (DEBUG_GESTURES) {
- for (Prediction p : predictions) {
- d(LOG_TAG, String.format("name=%s, score=%f", p.name, p.score));
- }
- }
-
- boolean match = false;
- if (predictions.size() > 0) {
- final Prediction prediction = predictions.get(0);
- if (prediction.score > GesturesConstants.PREDICTION_THRESHOLD) {
- match = true;
-
- ApplicationInfo info = sModel.queryGesture(Launcher.this, prediction.name);
- if (info != null) {
- updatePrompt(info);
- }
- }
- }
-
- if (!match){
- mGesturesAction.intent = null;
- setGestureUnknown();
- }
- }
- }
-
- private void updatePrompt(ApplicationInfo info) {
- // TODO: BRING BACK
- if (mGesturesAction.intent != null &&
- info.intent.toUri(0).equals(mGesturesAction.intent.toUri(0)) &&
- info.title.equals(mGesturesSend.getText())) {
- return;
- }
-
- setGestureAction(info.icon, info.title);
-
- mGesturesAction.intent = info.intent;
- }
-
- public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) {
- //noinspection PointlessBooleanExpression,ConstantConditions
- if (!CONFIG_GESTURES_IMMEDIATE_MODE) {
- overlay.removeCallbacks(mMatcher);
- }
- }
-
- void addGesture(String name, Gesture gesture) {
- sLibrary.addGesture(name, gesture);
- // TODO: On a background thread?
- sLibrary.save();
- }
-
- void update(ApplicationInfo info, Gesture gesture) {
- mGesturesOverlay.setGesture(gesture);
- updatePrompt(info);
- }
-
- class GestureMatcher implements Runnable {
- Gesture gesture;
-
- public void run() {
- if (gesture != null) {
- matchGesture(gesture);
- }
- }
- }
- }
-
- private class GesturesAction implements View.OnClickListener {
- Intent intent;
-
- public void onClick(View v) {
- if (intent != null) {
- startActivitySafely(intent);
- }
- }
- }
}
-