Remove gestures from Home.

This commit is contained in:
Romain Guy 2009-07-21 10:55:43 -07:00
parent 6e1fd5b2b0
commit 94dabf1be4
46 changed files with 4 additions and 1930 deletions

View File

@ -92,11 +92,6 @@
</intent-filter>
</activity>
<activity
android:name="GesturesActivity"
android:label="@string/gestures_activity"
android:theme="@android:style/Theme.Light.NoTitleBar" />
<!-- Enable system-default search mode for any activity in Home -->
<meta-data
android:name="android.app.default_searchable"

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/plus_normal" />
<item android:state_pressed="true"
android:drawable="@drawable/plus_pressed" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/plus_selected" />
<item android:state_enabled="true"
android:drawable="@drawable/plus_normal" />
</selector>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/g_normal" />
<item android:state_pressed="true"
android:drawable="@drawable/g_pressed" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/g_selected" />
<item android:state_enabled="true"
android:drawable="@drawable/g_normal" />
</selector>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/list_normal" />
<item android:state_pressed="true"
android:drawable="@drawable/list_pressed" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/list_selected" />
<item android:state_enabled="true"
android:drawable="@drawable/list_normal" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/g_background"
android:dither="true" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/gestures_frame"
android:dither="true" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,102 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<!-- TODO: Replace all this with a RelativeLayout -->
<com.android.launcher.GesturesPanel
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="13dip"
android:paddingRight="13dip"
android:orientation="vertical"
android:background="@drawable/gestures_background">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="13dip"
android:paddingBottom="13dip">
<TextView
android:id="@+id/gestures_prompt"
android:layout_width="fill_parent"
android:layout_height="64dip"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:text="@string/gestures_instructions" />
<Button
android:id="@+id/gestures_action"
android:layout_width="fill_parent"
android:layout_height="64dip"
android:gravity="left|center_vertical"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:drawablePadding="6dip"
android:visibility="gone" />
</FrameLayout>
<android.gesture.GestureOverlayView
android:id="@+id/gestures_overlay"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1.0"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip"
android:gestureColor="@color/gesture_color"
android:uncertainGestureColor="@color/uncertain_gesture_color"
android:gestureStrokeType="multiple" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="15dip"
android:paddingBottom="13dip">
<ImageButton
android:id="@+id/gestures_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/btn_add" />
<ImageButton
android:id="@+id/gestures_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/btn_list" />
</RelativeLayout>
</com.android.launcher.GesturesPanel>

View File

@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_alignParentTop="true"
android:layout_above="@+id/bottom_bar" />
<View
android:layout_width="fill_parent"
android:layout_height="6dip"
android:layout_alignParentTop="false"
android:layout_above="@+id/bottom_bar"
android:background="@drawable/mirrored_shadow" />
<RelativeLayout
android:id="@id/bottom_bar"
android:layout_width="fill_parent"
android:layout_height="60dip"
android:layout_alignParentBottom="true"
android:background="@drawable/g_bar_background">
<ImageButton
android:onClick="back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="13dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/btn_g" />
</RelativeLayout>
</RelativeLayout>

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:drawablePadding="12dip"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:ellipsize="marquee"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge" />

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"Povoluje aplikaci změnit nastavení a odkazy plochy."</string>
<string name="search_hint">"Vyhledávání Google"</string>
<string name="gadget_error_text">"Problém s načtením widgetu"</string>
<string name="gestures_instructions">"Nakreslete gesto"</string>
<string name="gestures_add">"Přidat zástupce"</string>
<string name="gestures_show">"Zobrazit zástupce"</string>
<string name="gestures_unknown">"Nerozpoznáno"</string>
<string name="gestures_created">"Bylo přidáno gesto %s"</string>
<string name="gestures_failed">"Gesto nebylo možné vytvořit."</string>
<string name="gestures_loading">"Načítání gest..."</string>
<string name="gestures_empty">"Žádná gesta"</string>
<string name="gestures_activity">"Gesta"</string>
<string name="gestures_rename">"Přejmenovat"</string>
<string name="gestures_delete">"Smazat"</string>
<string name="gestures_delete_success">"Gesto bylo smazáno"</string>
<string name="gestures_rename_title">"Přejmenovat gesto"</string>
<string name="gestures_rename_label">"Název gesta"</string>
<string name="gestures_group_gestures">"Gesta"</string>
<string name="gestures_group_settings">"Nastavení"</string>
<string name="gestures_preference_hotkey_title">"Spouštět tlačítkem plochy"</string>
<string name="gestures_preference_hotkey_summary">"Po stisknutí tlačítka plochy kreslit gesta"</string>
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Tillader et program at ændre indstillingerne og genvejene i Start."</string>
<string name="search_hint">"Google-søgning"</string>
<string name="gadget_error_text">"Der er problemer med at indlæse widget"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"Ermöglicht einer Anwendung, die Einstellungen und Shortcuts auf der Startseite zu ändern."</string>
<string name="search_hint">"Google-Suche"</string>
<string name="gadget_error_text">"Problem beim Laden des Widgets"</string>
<string name="gestures_instructions">"Eine Bewegung zeichnen"</string>
<string name="gestures_add">"Verknüpfung hinzufügen"</string>
<string name="gestures_show">"Verknüpfung anzeigen"</string>
<string name="gestures_unknown">"Nicht erkannt"</string>
<string name="gestures_created">"Bewegung %s wurde hinzugefügt."</string>
<string name="gestures_failed">"Bewegung konnte nicht erstellt werden."</string>
<string name="gestures_loading">"Bewegungen werden geladen..."</string>
<string name="gestures_empty">"Keine Bewegungen"</string>
<string name="gestures_activity">"Bewegungen"</string>
<string name="gestures_rename">"Umbenennen"</string>
<string name="gestures_delete">"Löschen"</string>
<string name="gestures_delete_success">"Bewegung wurde gelöscht."</string>
<string name="gestures_rename_title">"Bewegung umbenennen"</string>
<string name="gestures_rename_label">"Name der Bewegung"</string>
<string name="gestures_group_gestures">"Bewegungen"</string>
<string name="gestures_group_settings">"Einstellungen"</string>
<string name="gestures_preference_hotkey_title">"Über Startseite öffnen"</string>
<string name="gestures_preference_hotkey_summary">"Drücken Sie die Taste für die Startseite, um Bewegungen zu zeichnen."</string>
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Επιτρέπει σε μια εφαρμογή την αλλαγή των ρυθμίσεων και των συντομεύσεων στην αρχική οθόνη."</string>
<string name="search_hint">"Αναζήτηση Google"</string>
<string name="gadget_error_text">"Παρουσιάστηκε πρόβλημα στη φόρτωση του γραφικού στοιχείου"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Permite a una aplicación cambiar la configuración y los accesos directos de la página principal."</string>
<string name="search_hint">"Búsqueda de Google"</string>
<string name="gadget_error_text">"Problema al cargar el widget"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"Permite que una aplicación modifique la configuración y los accesos directos de la página principal."</string>
<string name="search_hint">"Búsqueda de Google"</string>
<string name="gadget_error_text">"Problema al cargar el widget"</string>
<string name="gestures_instructions">"Dibujar un gesto"</string>
<string name="gestures_add">"Añadir acceso directo"</string>
<string name="gestures_show">"Mostrar acceso directo"</string>
<string name="gestures_unknown">"No reconocido"</string>
<string name="gestures_created">"Gesto %s añadido"</string>
<string name="gestures_failed">"No se ha podido crear el gesto."</string>
<string name="gestures_loading">"Cargando gestos..."</string>
<string name="gestures_empty">"Ningún gesto"</string>
<string name="gestures_activity">"Gestos"</string>
<string name="gestures_rename">"Cambiar nombre"</string>
<string name="gestures_delete">"Suprimir"</string>
<string name="gestures_delete_success">"Gesto suprimido"</string>
<string name="gestures_rename_title">"Cambiar nombre de gesto"</string>
<string name="gestures_rename_label">"Nombre del gesto"</string>
<string name="gestures_group_gestures">"Gestos"</string>
<string name="gestures_group_settings">"Configuración"</string>
<string name="gestures_preference_hotkey_title">"Utilizar la tecla de página principal para iniciar"</string>
<string name="gestures_preference_hotkey_summary">"Pulsa la tecla de página principal para dibujar gestos."</string>
</resources>

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"Permet à une application de modifier les paramètres et les raccourcis de la page d\'accueil."</string>
<string name="search_hint">"Recherche Google"</string>
<string name="gadget_error_text">"Problème lors du chargement du widget"</string>
<string name="gestures_instructions">"Créer un geste"</string>
<string name="gestures_add">"Ajouter un raccourci"</string>
<string name="gestures_show">"Afficher le raccourci"</string>
<string name="gestures_unknown">"Non reconnu"</string>
<string name="gestures_created">"Le geste %s a bien été ajouté."</string>
<string name="gestures_failed">"Impossible de créer le geste."</string>
<string name="gestures_loading">"Chargement des gestes en cours…"</string>
<string name="gestures_empty">"Aucun geste"</string>
<string name="gestures_activity">"Gestes"</string>
<string name="gestures_rename">"Renommer"</string>
<string name="gestures_delete">"Supprimer"</string>
<string name="gestures_delete_success">"Le geste a bien été supprimé."</string>
<string name="gestures_rename_title">"Renommer le geste"</string>
<string name="gestures_rename_label">"Nom du geste"</string>
<string name="gestures_group_gestures">"Gestes"</string>
<string name="gestures_group_settings">"Paramètres"</string>
<string name="gestures_preference_hotkey_title">"Utiliser la touche Accueil pour commencer"</string>
<string name="gestures_preference_hotkey_summary">"Appuyer sur la touche Accueil pour créer un geste"</string>
</resources>

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"Consente a un\'applicazione di modificare le impostazioni e le scorciatoie in Home."</string>
<string name="search_hint">"Ricerca Google"</string>
<string name="gadget_error_text">"Errore durante il caricamento del widget"</string>
<string name="gestures_instructions">"Traccia un gesto"</string>
<string name="gestures_add">"Aggiungi scorciatoia"</string>
<string name="gestures_show">"Mostra scorciatoia"</string>
<string name="gestures_unknown">"Non riconosciuto"</string>
<string name="gestures_created">"Gesto %s aggiunto"</string>
<string name="gestures_failed">"Impossibile creare il gesto"</string>
<string name="gestures_loading">"Caricamento gesti in corso..."</string>
<string name="gestures_empty">"Nessun gesto"</string>
<string name="gestures_activity">"Gesti"</string>
<string name="gestures_rename">"Rinomina"</string>
<string name="gestures_delete">"Elimina"</string>
<string name="gestures_delete_success">"Gesto eliminato"</string>
<string name="gestures_rename_title">"Rinomina gesto"</string>
<string name="gestures_rename_label">"Nome gesto"</string>
<string name="gestures_group_gestures">"Gesti"</string>
<string name="gestures_group_settings">"Impostazioni"</string>
<string name="gestures_preference_hotkey_title">"Utilizza \"home\" per l\'avvio"</string>
<string name="gestures_preference_hotkey_summary">"Premi il tasto \"home\" per tracciare gesti"</string>
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"ホームの設定とショートカットの変更をアプリケーションに許可します。"</string>
<string name="search_hint">"Google検索"</string>
<string name="gadget_error_text">"ウィジェットを表示できません"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"응용프로그램이 홈에 있는 설정 및 바로가기를 변경할 수 있도록 합니다."</string>
<string name="search_hint">"Google 검색"</string>
<string name="gadget_error_text">"위젯을 로드하는 중 문제가 발생했습니다."</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Lar applikasjonen endre innstillinger og snarveier på skrivebordet."</string>
<string name="search_hint">"Google-søk"</string>
<string name="gadget_error_text">"Problem under lasting av gadget"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina wijzigen."</string>
<string name="search_hint">"Google Zoeken"</string>
<string name="gadget_error_text">"Probleem bij het laden van widget"</string>
<string name="gestures_instructions">"Een gebaar tekenen"</string>
<string name="gestures_add">"Snelkoppeling toevoegen"</string>
<string name="gestures_show">"Snelkoppeling weergeven"</string>
<string name="gestures_unknown">"Onbekend"</string>
<string name="gestures_created">"Gebaar %s toegevoegd"</string>
<string name="gestures_failed">"Gebaar kan niet worden gemaakt"</string>
<string name="gestures_loading">"Gebaren laden..."</string>
<string name="gestures_empty">"Geen gebaren"</string>
<string name="gestures_activity">"Gebaren"</string>
<string name="gestures_rename">"Naam wijzigen"</string>
<string name="gestures_delete">"Verwijderen"</string>
<string name="gestures_delete_success">"Gebaar verwijderd"</string>
<string name="gestures_rename_title">"Naam van gebaar wijzigen"</string>
<string name="gestures_rename_label">"Naam van gebaar"</string>
<string name="gestures_group_gestures">"Gebaren"</string>
<string name="gestures_group_settings">"Instellingen"</string>
<string name="gestures_preference_hotkey_title">"Gebruik de startpaginatoets om te starten"</string>
<string name="gestures_preference_hotkey_summary">"Druk op de startpaginatoets om gebaren te tekenen"</string>
</resources>

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"Umożliwia aplikacji zmianę ustawień i skrótów strony głównej."</string>
<string name="search_hint">"Szukaj w Google"</string>
<string name="gadget_error_text">"Problem podczas ładowania widżetu"</string>
<string name="gestures_instructions">"Określ gest"</string>
<string name="gestures_add">"Dodaj skrót"</string>
<string name="gestures_show">"Pokaż skrót"</string>
<string name="gestures_unknown">"Nierozpoznany"</string>
<string name="gestures_created">"Dodano gest %s"</string>
<string name="gestures_failed">"Nie można utworzyć gestu"</string>
<string name="gestures_loading">"Trwa wczytywanie gestów..."</string>
<string name="gestures_empty">"Brak gestów"</string>
<string name="gestures_activity">"Gesty"</string>
<string name="gestures_rename">"Zmień nazwę"</string>
<string name="gestures_delete">"Usuń"</string>
<string name="gestures_delete_success">"Gest usunięty"</string>
<string name="gestures_rename_title">"Zmień nazwę gestu"</string>
<string name="gestures_rename_label">"Nazwa gestu"</string>
<string name="gestures_group_gestures">"Gesty"</string>
<string name="gestures_group_settings">"Ustawienia"</string>
<string name="gestures_preference_hotkey_title">"Użyj klawisza głównego, aby uruchomić"</string>
<string name="gestures_preference_hotkey_summary">"Naciśnij klawisz główny, aby określić gesty"</string>
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Permite que uma aplicação altere as definições e os atalhos do ecrã principal."</string>
<string name="search_hint">"Pesquisa do Google"</string>
<string name="gadget_error_text">"Erro ao carregar o widget"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Permite que um aplicativo altere as configurações e atalhos na Página inicial."</string>
<string name="search_hint">"Pesquisa do Google"</string>
<string name="gadget_error_text">"Problema ao carregar o widget"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Позволяет приложению изменять настройки и ярлыки на главном экране."</string>
<string name="search_hint">"Поиск Google"</string>
<string name="gadget_error_text">"Не удалось загрузить виджет"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Tillåter att ett program ändrar inställningar och genvägar på startsidan."</string>
<string name="search_hint">"Google Sökning"</string>
<string name="gadget_error_text">"Det gick inte att läsa in widgeten"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"Bir uygulamaya Ana Sayfadaki ayarları ve kısayolları değiştirme izni verir."</string>
<string name="search_hint">"Google Arama"</string>
<string name="gadget_error_text">"Widget yüklenirken sorun oluştu"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -65,40 +65,4 @@
<string name="permdesc_write_settings">"允许应用程序更改主屏幕上的设置和快捷方式。"</string>
<string name="search_hint">"Google 搜索"</string>
<string name="gadget_error_text">"载入窗口小部件时出现问题"</string>
<!-- no translation found for gestures_instructions (9028212666671537142) -->
<skip />
<!-- no translation found for gestures_add (7202345623338547552) -->
<skip />
<!-- no translation found for gestures_show (1819408048115485045) -->
<skip />
<!-- no translation found for gestures_unknown (4627778271648365869) -->
<skip />
<!-- no translation found for gestures_created (8116808500193613741) -->
<skip />
<!-- no translation found for gestures_failed (5113829215530311557) -->
<skip />
<!-- no translation found for gestures_loading (6325241735907189384) -->
<skip />
<!-- no translation found for gestures_empty (3992184768829668968) -->
<skip />
<!-- no translation found for gestures_activity (3366108186921084558) -->
<skip />
<!-- no translation found for gestures_rename (713510200890627175) -->
<skip />
<!-- no translation found for gestures_delete (6962559975386260201) -->
<skip />
<!-- no translation found for gestures_delete_success (2961655691848002690) -->
<skip />
<!-- no translation found for gestures_rename_title (7463326669074661915) -->
<skip />
<!-- no translation found for gestures_rename_label (8790363956270703745) -->
<skip />
<!-- no translation found for gestures_group_gestures (1224781238074132792) -->
<skip />
<!-- no translation found for gestures_group_settings (2153910512547403584) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_title (293268419666027426) -->
<skip />
<!-- no translation found for gestures_preference_hotkey_summary (4351473330309584909) -->
<skip />
</resources>

View File

@ -60,22 +60,4 @@
<string name="permdesc_write_settings">"允許應用程式變更首頁中的設定和捷徑。"</string>
<string name="search_hint">"Google 搜尋"</string>
<string name="gadget_error_text">"載入小工具時發生問題"</string>
<string name="gestures_instructions">"描繪觸控動作"</string>
<string name="gestures_add">"新增捷徑"</string>
<string name="gestures_show">"顯示捷徑"</string>
<string name="gestures_unknown">"無法辨識"</string>
<string name="gestures_created">"已新增觸控動作 %s"</string>
<string name="gestures_failed">"無法建立觸控動作"</string>
<string name="gestures_loading">"正在載入觸控動作..."</string>
<string name="gestures_empty">"無觸控動作"</string>
<string name="gestures_activity">"觸控動作"</string>
<string name="gestures_rename">"重新命名"</string>
<string name="gestures_delete">"刪除"</string>
<string name="gestures_delete_success">"已刪除觸控動作"</string>
<string name="gestures_rename_title">"重新命名觸控動作"</string>
<string name="gestures_rename_label">"觸控動作名稱"</string>
<string name="gestures_group_gestures">"觸控動作"</string>
<string name="gestures_group_settings">"設定"</string>
<string name="gestures_preference_hotkey_title">"使用主螢幕啟動"</string>
<string name="gestures_preference_hotkey_summary">"按下主螢幕鍵來描繪觸控動作"</string>
</resources>

View File

@ -126,44 +126,4 @@
<!-- Text to show user in place of a gadget when we can't display it properly -->
<string name="gadget_error_text">Problem loading widget</string>
<!-- Gestures: -->
<skip />
<!-- Message displayed when the user enters gestures mode and is asked to draw a gesture -->
<string name="gestures_instructions">Draw a gesture</string>
<!-- Label of the button that the user clicks to create a new gesture-based shortcut -->
<string name="gestures_add">Add shortcut</string>
<!-- Label of the button that the user clicks to see the list of gesture-based shortcuts -->
<string name="gestures_show">Show shortcut</string>
<!-- Message displayed when the gesture entered by the user cannot be recognized -->
<string name="gestures_unknown">Unrecognized</string>
<!-- Message displayed when the user has successfully created a new gesture -->
<string name="gestures_created">Added gesture "%s"</string>
<!-- Message displayed when the user could not create a new gesture -->
<string name="gestures_failed">Gesture could not be created</string>
<!-- Message displayed when the user opens the gestures settings screen -->
<string name="gestures_loading">Loading gestures...</string>
<!-- Message displayed when the user has no gestures -->
<string name="gestures_empty">No gestures</string>
<!-- Title of the screen used to view/manage gestures -->
<string name="gestures_activity">Gestures</string>
<!-- Noun, menu item used to rename a gesture -->
<string name="gestures_rename">Rename</string>
<!-- Noun, menu item used to remove a gesture -->
<string name="gestures_delete">Delete</string>
<!-- Message displayed when a gesture is successfully deleted -->
<string name="gestures_delete_success">Gesture deleted</string>
<!-- Title of dialog box -->
<string name="gestures_rename_title">Rename gesture</string>
<!-- Label of gesture name field in Rename gesture dialog box -->
<string name="gestures_rename_label">Gesture name</string>
<!-- Title of the preferences group showing the user's gestures -->
<string name="gestures_group_gestures">Gestures</string>
<!-- Title of the preferences group showing the gestures settings -->
<string name="gestures_group_settings">Settings</string>
<!-- Label of the setting used to enable/disable the home key to draw gestures -->
<string name="gestures_preference_hotkey_title">Use home to launch</string>
<!-- Summary of the setting used to enable/disable the home key to draw gestures -->
<string name="gestures_preference_hotkey_summary">Press home key to draw gestures</string>
</resources>

View File

@ -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<ApplicationInfo> 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<Void, ApplicationInfo, Boolean> {
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<ApplicationInfo> {
private final LayoutInflater mInflater;
private final Map<Long, Drawable> mThumbnails = Collections.synchronizedMap(
new HashMap<Long, Drawable>());
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;
}
}
}

View File

@ -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";
}

View File

@ -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;
}
}

View File

@ -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<Prediction> 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);
}
}
}
}