diff --git a/res/drawable-hdpi/ic_search_widget.png b/res/drawable-hdpi/ic_search_widget.png
deleted file mode 100644
index 06b9b251b1..0000000000
Binary files a/res/drawable-hdpi/ic_search_widget.png and /dev/null differ
diff --git a/res/drawable-hdpi/search_button_bg.9.png b/res/drawable-hdpi/search_button_bg.9.png
deleted file mode 100644
index 9fba3d10ce..0000000000
Binary files a/res/drawable-hdpi/search_button_bg.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/search_button_voice.png b/res/drawable-hdpi/search_button_voice.png
deleted file mode 100644
index a60f7d9c9c..0000000000
Binary files a/res/drawable-hdpi/search_button_voice.png and /dev/null differ
diff --git a/res/drawable-hdpi/search_floater.9.png b/res/drawable-hdpi/search_floater.9.png
deleted file mode 100644
index 02441d04a5..0000000000
Binary files a/res/drawable-hdpi/search_floater.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/textfield_searchwidget_default.9.png b/res/drawable-hdpi/textfield_searchwidget_default.9.png
deleted file mode 100644
index 2fe637d5f9..0000000000
Binary files a/res/drawable-hdpi/textfield_searchwidget_default.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/textfield_searchwidget_pressed.9.png b/res/drawable-hdpi/textfield_searchwidget_pressed.9.png
deleted file mode 100644
index 58af9baf4b..0000000000
Binary files a/res/drawable-hdpi/textfield_searchwidget_pressed.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/textfield_searchwidget_selected.9.png b/res/drawable-hdpi/textfield_searchwidget_selected.9.png
deleted file mode 100644
index 8a84fdcacb..0000000000
Binary files a/res/drawable-hdpi/textfield_searchwidget_selected.9.png and /dev/null differ
diff --git a/res/drawable/textfield_searchwidget.xml b/res/drawable/textfield_searchwidget.xml
deleted file mode 100644
index 80f3dca34a..0000000000
--- a/res/drawable/textfield_searchwidget.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/layout/widget_search.xml b/res/layout/widget_search.xml
deleted file mode 100644
index a3467234cd..0000000000
--- a/res/layout/widget_search.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index debfc8ba3a..a591ff7c25 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -30,7 +30,6 @@
"Přidat na plochu"
"Aplikace"
"Zástupce"
- "Hledat"
"Nová složka"
"Složky"
"Widgety"
@@ -38,7 +37,6 @@
"Složka"
"Hodiny"
"Rámeček fotografie"
- "Vyhledávání"
"Na této ploše již není místo."
"Zástupce %s byl vytvořen."
"Zástupce %s byl odebrán."
@@ -59,6 +57,5 @@
"Povoluje aplikaci číst nastavení a odkazy plochy."
"zápis nastavení a odkazů plochy"
"Povoluje aplikaci změnit nastavení a odkazy plochy."
- "Vyhledávání Google"
"Problém s načtením widgetu"
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 95d43fd863..ec98ea6f4a 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -30,7 +30,6 @@
"Føj til Startskærm"
"Programmer"
"Genveje"
- "Søg"
"Ny mappe"
"Mapper"
"Widgets"
@@ -38,7 +37,6 @@
"Mappe"
"Ur"
"Billedramme"
- "Søg"
"Der er ikke mere plads på Startskærmen."
"Genvejen \"%s\" blev oprettet."
"Genvejen \"%s\" blev fjernet."
@@ -59,6 +57,5 @@
"Tillader et program at læse indstillingerne og genvejene i Start."
"skriv indstillinger og genveje for Start"
"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 117dedefa7..48b594498b 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -30,7 +30,6 @@
"Zum Startbildschirm hinzufügen"
"Anwendungen"
"Verknüpfungen"
- "Suchen"
"Neuer Ordner"
"Ordner"
"Widgets"
@@ -38,7 +37,6 @@
"Ordner"
"Uhr"
"Bildrahmen"
- "Suchen"
"Auf dem Startbildschirm ist kein Platz mehr vorhanden."
"\"%s\"-Verknüpfung wurde erstellt."
"\"%s\"-Verknüpfung wurde entfernt."
@@ -59,6 +57,5 @@
"Ermöglicht einer Anwendung, die Einstellungen und Shortcuts auf der Startseite zu lesen."
"Einstellungen und Shortcuts für Startseite schreiben"
"Ermöglicht einer Anwendung, die Einstellungen und Shortcuts auf der Startseite zu ändern."
- "Google-Suche"
"Problem beim Laden des Widgets"
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index de44fcd8ef..7a6a108c3d 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -30,7 +30,6 @@
"Προσθήκη στην αρχική οθόνη"
"Εφαρμογές"
"Συντομεύσεις"
- "Αναζήτηση"
"Νέος φάκελος"
"Φάκελοι"
"Γραφικά στοιχεία"
@@ -38,7 +37,6 @@
"Φάκελος"
"Ρολόι"
"Πλαίσιο εικόνας"
- "Αναζήτηση"
"Δεν υπάρχει χώρος σε αυτήν την αρχική οθόνη."
"Δημιουργήθηκε η συντόμευση \"%s\"."
"Η συντόμευση \"%s\" καταργήθηκε."
@@ -59,6 +57,5 @@
"Επιτρέπει σε μια εφαρμογή την ανάγνωση των ρυθμίσεων και των συντομεύσεων στην αρχική οθόνη."
"εγγραφή ρυθμίσεων και συντομεύσεων αρχικής οθόνης"
"Επιτρέπει σε μια εφαρμογή την αλλαγή των ρυθμίσεων και των συντομεύσεων στην αρχική οθόνη."
- "Αναζήτηση Google"
"Παρουσιάστηκε πρόβλημα στη φόρτωση του γραφικού στοιχείου"
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 22ecb7b862..ef6720be9a 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -30,7 +30,6 @@
"Agregar a la pantalla Página principal"
"Aplicaciones"
"Accesos directos"
- "Buscar"
"Carpeta nueva"
"Carpetas"
"Controles"
@@ -38,7 +37,6 @@
"Carpeta"
"Reloj"
"Marco de imagen"
- "Buscar"
"No hay más espacio en esta pantalla de la página principal"
"Acceso directo \"%s\" creado."
"El acceso directo \"%s\" ha sido eliminado."
@@ -59,6 +57,5 @@
"Permite a una aplicación leer la configuración y los accesos directos de la página principal."
"escribir configuración y accesos directos de la página principal"
"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 5af29896f1..23a3eb4abf 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -30,7 +30,6 @@
"Añadir a pantalla de página principal"
"Aplicaciones"
"Accesos directos"
- "Búsqueda"
"Nueva carpeta"
"Carpetas"
"Widgets"
@@ -38,7 +37,6 @@
"Carpeta"
"Reloj"
"Picture frame"
- "Búsqueda de Google"
"No queda espacio en esta pantalla de página principal."
"Se ha creado el acceso directo \"%s\"."
"Se ha eliminado el acceso directo \"%s\"."
@@ -59,6 +57,5 @@
"Permite que una aplicación lea la información de configuración y accesos directos de la página principal."
"escribir información de accesos directos y de configuración de la página principal"
"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"
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 63a146cde1..de5023c3c4 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -30,7 +30,6 @@
"Ajouter à l\'écran d\'accueil"
"Applications"
"Raccourcis"
- "Recherche"
"Nouveau dossier"
"Dossiers"
"Widgets"
@@ -38,7 +37,6 @@
"Dossier"
"Horloge"
"Cadre d\'image"
- "Recherche"
"Plus d\'espace libre sur l\'écran d\'accueil."
"Le raccourci \"%s\" a été créé."
"Le raccourci \"%s\" a été supprimé."
@@ -59,6 +57,5 @@
"Permet à une application de lire les paramètres et raccourcis de la page d\'accueil."
"Enregistrer les paramètres de la page d\'accueil et des raccourcis"
"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"
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 518507e576..485bd8a1c8 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -30,7 +30,6 @@
"Aggiungi a schermata Home"
"Applicazioni"
"Collegamenti"
- "Ricerca"
"Nuova cartella"
"Cartelle"
"Widget"
@@ -38,7 +37,6 @@
"Cartella"
"Orologio"
"Cornice immagini"
- "Ricerca"
"Spazio nella schermata Home esaurito."
"Collegamento \"%s\" creato."
"Il collegamento \"%s\" è stato rimosso."
@@ -59,6 +57,5 @@
"Consente a un\'applicazione di leggere le impostazioni e le scorciatoie in Home."
"creare impostazioni e scorciatoie in Home"
"Consente a un\'applicazione di modificare le impostazioni e le scorciatoie in Home."
- "Ricerca Google"
"Errore durante il caricamento del widget"
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index dd17bd1a73..e5209c997a 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -30,7 +30,6 @@
"ホーム画面に追加"
"アプリケーション"
"ショートカット"
- "検索"
"新しいフォルダ"
"フォルダ"
"ウィジェット"
@@ -38,7 +37,6 @@
"フォルダ"
"時計"
"写真フレーム"
- "検索"
"ホーム画面に空きスペースがありません。"
"ショートカット「%s」を作成しました。"
"ショートカット「%s」を削除しました。"
@@ -59,6 +57,5 @@
"ホームの設定とショートカットの読み取りをアプリケーションに許可します。"
"ホームの設定とショートカットの書き込み"
"ホームの設定とショートカットの変更をアプリケーションに許可します。"
- "Google検索"
"ウィジェットを表示できません"
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index b5bd1dd0cf..b3442f9e15 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -30,7 +30,6 @@
"홈 화면에 추가"
"응용프로그램"
"바로가기"
- "검색"
"새 폴더"
"폴더"
"위젯"
@@ -38,7 +37,6 @@
"폴더"
"시계"
"사진 프레임"
- "검색"
"홈 화면에 더 이상 공간이 없습니다."
"바로가기(\'%s\')가 생성되었습니다."
"바로가기(\'%s\')가 삭제되었습니다."
@@ -59,6 +57,5 @@
"응용프로그램이 홈에 있는 설정 및 바로가기를 읽을 수 있도록 합니다."
"홈 설정 및 바로가기 쓰기"
"응용프로그램이 홈에 있는 설정 및 바로가기를 변경할 수 있도록 합니다."
- "Google 검색"
"위젯을 로드하는 중 문제가 발생했습니다."
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index d2d31c27a7..d1236f2323 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -17,7 +17,6 @@
106dip
74dip
- 19dip
8dip
64dip
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index fe22f69de7..20df495057 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -30,7 +30,6 @@
"Legg til skrivebord"
"Applikasjoner"
"Snarveier"
- "Søk"
"Ny mappe"
"Mapper"
"Skrivebordselementer"
@@ -38,7 +37,6 @@
"Mappe"
"Klokke"
"Bilderamme"
- "Søk"
"Ikke nok plass på skrivebordet."
"Opprettet snarveien «%s»."
"Fjernet snarveien «%s»."
@@ -59,6 +57,5 @@
"Lar applikasjonen lese innstillinger og snarveier fra skrivebordet."
"skrive skrivebordsinnstillinger og -snarveier"
"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 ffe5dae2d1..892e40529e 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -30,7 +30,6 @@
"Toevoegen aan startpagina"
"Toepassingen"
"Sneltoetsen"
- "Zoeken"
"Nieuwe map"
"Mappen"
"Widgets"
@@ -38,7 +37,6 @@
"Map"
"Klok"
"Fotolijstje"
- "Zoeken"
"Er is geen ruimte meer op dit startscherm."
"Snelkoppeling \'%s\' is gemaakt."
"Snelkoppeling \'%s\' is verwijderd."
@@ -59,6 +57,5 @@
"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina lezen."
"instellingen en snelkoppelingen voor de startpagina schrijven"
"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina wijzigen."
- "Google Zoeken"
"Probleem bij het laden van widget"
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index a2b81c1817..971003822a 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -30,7 +30,6 @@
"Dodaj do strony głównej"
"Aplikacje"
"Skróty"
- "Wyszukiwarka"
"Nowy folder"
"Foldery"
"Widżety"
@@ -38,7 +37,6 @@
"Folder"
"Zegar"
"Ramka obrazu"
- "Wyszukiwarka"
"Brak miejsca na tej stronie głównej"
"Skrót „%s” został utworzony."
"Skrót „%s” został usunięty."
@@ -59,6 +57,5 @@
"Umożliwia aplikacji odczytywanie ustawień i skrótów strony głównej."
"zapisywanie ustawień i skrótów strony głównej"
"Umożliwia aplikacji zmianę ustawień i skrótów strony głównej."
- "Szukaj w Google"
"Problem podczas ładowania widżetu"
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index f619526085..bc6256a31c 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -30,7 +30,6 @@
"Adicionar ao ecrã principal"
"Aplicações"
"Atalhos"
- "Pesquisar"
"Nova pasta"
"Pastas"
"Widgets"
@@ -38,7 +37,6 @@
"Pasta"
"Relógio"
"Moldura de imagem"
- "Pesquisar"
"Não existe espaço suficiente neste ecrã principal."
"O atalho \"%s\" foi criado."
"O atalho \"%s\" foi removido."
@@ -59,6 +57,5 @@
"Permite que uma aplicação leia as definições e os atalhos do ecrã principal."
"escrever definições e atalhos do ecrã principal"
"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 03547d1f70..49d773a918 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -30,7 +30,6 @@
"Adicionar à tela da Página inicial"
"Aplicativos"
"Atalhos"
- "Pesquisar"
"Nova pasta"
"Pastas"
"Widgets"
@@ -38,7 +37,6 @@
"Pasta"
"Relógio"
"Frame da imagem"
- "Pesquisar"
"Não há mais espaço nesta tela da Página inicial."
"Atalho \"%s\" criado."
"O atalho \"%s\" foi removido."
@@ -59,6 +57,5 @@
"Permite que um aplicativo leia as configurações e atalhos na Página inicial."
"gravar configurações e atalhos da Página inicial"
"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 f74b5e5ddb..81a839f450 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -30,7 +30,6 @@
"Добавить на главный экран"
"Приложения"
"Ярлыки"
- "Поиск"
"Новая папка"
"Папки"
"Виджеты"
@@ -38,7 +37,6 @@
"Папка"
"Часы"
"Рамка фотографии"
- "Поиск"
"На этом главном экране нет свободного места."
"Ярлык \"%s\" создан"
"Ярлык \"%s\" удален."
@@ -59,6 +57,5 @@
"Позволяет приложению считывать настройки и ярлыки на главном экране."
"изменять настройки и ярлыки главного экрана"
"Позволяет приложению изменять настройки и ярлыки на главном экране."
- "Поиск Google"
"Не удалось загрузить виджет"
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index cf448ad60b..f6fe34f5d9 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -30,7 +30,6 @@
"Lägg till på startsidan"
"Program"
"Genvägar"
- "Sök"
"Ny mapp"
"Mappar"
"Widgetar"
@@ -38,7 +37,6 @@
"Mapp"
"Klocka"
"Bildram"
- "Sök"
"Det finns inte plats för mer på den här startsidan."
"Genvägen \"%s\" har skapats."
"Genvägen \"%s\" har tagits bort."
@@ -59,6 +57,5 @@
"Tillåter att ett program läser inställningar och genvägar på startsidan."
"skriva inställningar och genvägar för startsidan"
"Tillåter att ett program ändrar inställningar och genvägar på startsidan."
- "Sök på Google"
"Det gick inte att läsa in widgeten"
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index 9d116ff7f8..eda50b130b 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -30,7 +30,6 @@
"Ana ekrana ekle"
"Uygulamalar"
"Kısayollar"
- "Arama"
"Yeni klasör"
"Klasörler"
"Widget\'lar"
@@ -38,7 +37,6 @@
"Klasör"
"Saat"
"Resim çerçevesi"
- "Arama"
"Bu Ana ekranda başka yer yok."
"\"%s\" kısayolu oluşturuldu."
"\"%s\" kısayolu kaldırıldı."
@@ -59,6 +57,5 @@
"Bir uygulamaya Ana Sayfadaki ayarları ve kısayolları okuma izni verir."
"Ana Sayfa ayarlarını ve kısayollarını yaz"
"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 ff7f489635..77db80cac6 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -30,7 +30,6 @@
"添加到主屏幕"
"应用程序"
"快捷方式"
- "搜索"
"新建文件夹"
"文件夹"
"窗口小部件"
@@ -38,7 +37,6 @@
"文件夹"
"时钟"
"相框"
- "搜索"
"此主屏幕上已没有更多空间。"
"已创建“%s”快捷方式。"
"已删除“%s”快捷方式。"
@@ -59,6 +57,5 @@
"允许应用程序读取主屏幕上的设置和快捷方式。"
"写入主屏幕设置和快捷方式"
"允许应用程序更改主屏幕上的设置和快捷方式。"
- "Google 搜索"
"载入窗口小部件时出现问题"
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index b75995eb9c..fabb8267e4 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -30,7 +30,6 @@
"新增至首頁畫面"
"應用程式"
"捷徑"
- "搜尋"
"新資料夾"
"資料夾"
"小工具"
@@ -38,7 +37,6 @@
"資料夾"
"時鐘"
"相框"
- "搜尋"
"首頁已無空間"
"已建立「%s」捷徑。"
"已移除「%s」捷徑。"
@@ -59,6 +57,5 @@
"允許應用程式讀取首頁中的設定和捷徑。"
"寫入首頁設定和捷徑"
"允許應用程式變更首頁中的設定和捷徑。"
- "Google 搜尋"
"載入小工具時發生問題"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e0ca38469b..78756acbba 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -15,7 +15,6 @@
-->
- 19dip
8dip
64dip
56dip
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 38f27c7768..35d47338a9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -56,8 +56,6 @@
Applications
Shortcuts
-
- Search
New folder
@@ -72,8 +70,6 @@
Clock
Picture frame
-
- Search
No more room on this Home screen.
@@ -126,12 +122,6 @@
-
- Google Search
-
Problem loading widget
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index aa6b7cedf1..f07810dfc0 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -110,9 +110,6 @@ public final class Launcher extends Activity
static final String EXTRA_SHORTCUT_DUPLICATE = "duplicate";
- static final String EXTRA_CUSTOM_WIDGET = "custom_widget";
- static final String SEARCH_WIDGET = "search_widget";
-
static final int SCREEN_COUNT = 5;
static final int DEFAULT_SCREEN = 2;
static final int NUMBER_CELLS_X = 4;
@@ -180,8 +177,6 @@ public final class Launcher extends Activity
private SpannableStringBuilder mDefaultKeySsb = null;
- private boolean mIsNewIntent;
-
private boolean mWorkspaceLoading = true;
private boolean mRestoring;
@@ -406,21 +401,6 @@ public final class Launcher extends Activity
mModel.startLoader(this, true);
mRestoring = false;
}
-
- // If this was a new intent (i.e., the mIsNewIntent flag got set to true by
- // onNewIntent), then close the search dialog if needed, because it probably
- // came from the user pressing 'home' (rather than, for example, pressing 'back').
- if (mIsNewIntent) {
- // Post to a handler so that this happens after the search dialog tries to open
- // itself again.
- mWorkspace.post(new Runnable() {
- public void run() {
- stopSearch();
- }
- });
- }
-
- mIsNewIntent = false;
}
@Override
@@ -841,11 +821,6 @@ public final class Launcher extends Activity
// also will cancel mWaitingForResult.
closeSystemDialogs();
- // Set this flag so that onResume knows to close the search dialog if it's open,
- // because this was a new intent (thus a press of 'home' or some such) rather than
- // for example onResume being called when the user pressed the 'back' button.
- mIsNewIntent = true;
-
boolean alreadyOnHome = ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
!= Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
boolean allAppsVisible = isAllAppsVisible();
@@ -947,26 +922,6 @@ public final class Launcher extends Activity
closeAllApps(true);
- // Slide the search widget to the top, if it's on the current screen,
- // otherwise show the search dialog immediately.
- Search searchWidget = mWorkspace.findSearchWidgetOnCurrentScreen();
- if (searchWidget == null) {
- showSearchDialog(initialQuery, selectInitialQuery, appSearchData, globalSearch);
- } else {
- searchWidget.startSearch(initialQuery, selectInitialQuery, appSearchData, globalSearch);
- // show the currently typed text in the search widget while sliding
- searchWidget.setQuery(getTypedText());
- }
- }
-
- /**
- * Show the search dialog immediately, without changing the search widget.
- *
- * @see Activity#startSearch(String, boolean, android.os.Bundle, boolean)
- */
- void showSearchDialog(String initialQuery, boolean selectInitialQuery,
- Bundle appSearchData, boolean globalSearch) {
-
if (initialQuery == null) {
// Use any text typed in the launcher as the initial query
initialQuery = getTypedText();
@@ -979,37 +934,10 @@ public final class Launcher extends Activity
final SearchManager searchManager =
(SearchManager) getSystemService(Context.SEARCH_SERVICE);
-
- final Search searchWidget = mWorkspace.findSearchWidgetOnCurrentScreen();
- if (searchWidget != null) {
- // This gets called when the user leaves the search dialog to go back to
- // the Launcher.
- searchManager.setOnCancelListener(new SearchManager.OnCancelListener() {
- public void onCancel() {
- searchManager.setOnCancelListener(null);
- stopSearch();
- }
- });
- }
-
searchManager.startSearch(initialQuery, selectInitialQuery, getComponentName(),
appSearchData, globalSearch);
}
- /**
- * Cancel search dialog if it is open.
- */
- void stopSearch() {
- // Close search dialog
- SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- searchManager.stopSearch();
- // Restore search widget to its normal position
- Search searchWidget = mWorkspace.findSearchWidgetOnCurrentScreen();
- if (searchWidget != null) {
- searchWidget.stopSearch(false);
- }
- }
-
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (isWorkspaceLocked()) {
@@ -1094,51 +1022,21 @@ public final class Launcher extends Activity
void addAppWidget(Intent data) {
// TODO: catch bad widget exception when sent
int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
+ AppWidgetProviderInfo appWidget = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
- String customWidget = data.getStringExtra(EXTRA_CUSTOM_WIDGET);
- if (SEARCH_WIDGET.equals(customWidget)) {
- // We don't need this any more, since this isn't a real app widget.
- mAppWidgetHost.deleteAppWidgetId(appWidgetId);
- // add the search widget
- addSearch();
+ if (appWidget.configure != null) {
+ // Launch over to configure widget, if needed
+ Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
+ intent.setComponent(appWidget.configure);
+ intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
+
+ startActivityForResult(intent, REQUEST_CREATE_APPWIDGET);
} else {
- AppWidgetProviderInfo appWidget = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
-
- if (appWidget.configure != null) {
- // Launch over to configure widget, if needed
- Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
- intent.setComponent(appWidget.configure);
- intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
-
- startActivityForResult(intent, REQUEST_CREATE_APPWIDGET);
- } else {
- // Otherwise just add it
- onActivityResult(REQUEST_CREATE_APPWIDGET, Activity.RESULT_OK, data);
- }
+ // Otherwise just add it
+ onActivityResult(REQUEST_CREATE_APPWIDGET, Activity.RESULT_OK, data);
}
}
- void addSearch() {
- final Widget info = Widget.makeSearch();
- final CellLayout.CellInfo cellInfo = mAddItemCellInfo;
-
- final int[] xy = mCellCoordinates;
- final int spanX = info.spanX;
- final int spanY = info.spanY;
-
- if (!findSlot(cellInfo, xy, spanX, spanY)) return;
-
- LauncherModel.addItemToDatabase(this, info, LauncherSettings.Favorites.CONTAINER_DESKTOP,
- mWorkspace.getCurrentScreen(), xy[0], xy[1], false);
-
- final View view = mInflater.inflate(info.layoutResource, null);
- view.setTag(info);
- Search search = (Search) view.findViewById(R.id.widget_search);
- search.setLauncher(this);
-
- mWorkspace.addInCurrentScreen(view, xy[0], xy[1], info.spanX, spanY);
- }
-
void processShortcut(Intent intent, int requestCodeApplication, int requestCodeShortcut) {
// Handle case where user selected "Applications"
String applicationName = getResources().getString(R.string.group_applications);
@@ -1937,22 +1835,6 @@ public final class Launcher extends Activity
Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
- // add the search widget
- ArrayList customInfo =
- new ArrayList();
- AppWidgetProviderInfo info = new AppWidgetProviderInfo();
- info.provider = new ComponentName(getPackageName(), "XXX.YYY");
- info.label = getString(R.string.group_search);
- info.icon = R.drawable.ic_search_widget;
- customInfo.add(info);
- pickIntent.putParcelableArrayListExtra(
- AppWidgetManager.EXTRA_CUSTOM_INFO, customInfo);
- ArrayList customExtras = new ArrayList();
- Bundle b = new Bundle();
- b.putString(EXTRA_CUSTOM_WIDGET, SEARCH_WIDGET);
- customExtras.add(b);
- pickIntent.putParcelableArrayListExtra(
- AppWidgetManager.EXTRA_CUSTOM_EXTRAS, customExtras);
// start the pick activity
startActivityForResult(pickIntent, REQUEST_PICK_APPWIDGET);
break;
@@ -2097,19 +1979,6 @@ public final class Launcher extends Activity
workspace.addInScreen(newLiveFolder, item.screen, item.cellX, item.cellY, 1, 1,
false);
break;
- case LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH:
- final int screen = workspace.getCurrentScreen();
- final View view = mInflater.inflate(R.layout.widget_search,
- (ViewGroup) workspace.getChildAt(screen), false);
-
- Search search = (Search) view.findViewById(R.id.widget_search);
- search.setLauncher(this);
-
- final Widget widget = (Widget) item;
- view.setTag(widget);
-
- workspace.addWidget(view, widget, false);
- break;
}
}
@@ -2230,7 +2099,6 @@ public final class Launcher extends Activity
public void dumpState() {
Log.d(TAG, "BEGIN launcher2 dump state for launcher " + this);
Log.d(TAG, "mSavedState=" + mSavedState);
- Log.d(TAG, "mIsNewIntent=" + mIsNewIntent);
Log.d(TAG, "mWorkspaceLoading=" + mWorkspaceLoading);
Log.d(TAG, "mRestoring=" + mRestoring);
Log.d(TAG, "mWaitingForResult=" + mWaitingForResult);
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 97fa554c2f..cafb9fabeb 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -651,7 +651,6 @@ public class LauncherModel extends BroadcastReceiver {
ApplicationInfo info;
String intentDescription;
- Widget widgetInfo;
LauncherAppWidgetInfo appWidgetInfo;
int container;
long id;
@@ -770,25 +769,6 @@ public class LauncherModel extends BroadcastReceiver {
mFolders.put(liveFolderInfo.id, liveFolderInfo);
break;
- case LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH:
- widgetInfo = Widget.makeSearch();
-
- container = c.getInt(containerIndex);
- if (container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
- Log.e(TAG, "Widget found where container "
- + "!= CONTAINER_DESKTOP ignoring!");
- continue;
- }
-
- widgetInfo.id = c.getLong(idIndex);
- widgetInfo.screen = c.getInt(screenIndex);
- widgetInfo.container = container;
- widgetInfo.cellX = c.getInt(cellXIndex);
- widgetInfo.cellY = c.getInt(cellYIndex);
-
- mItems.add(widgetInfo);
- break;
-
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
// Read all Launcher-specific widget details
int appWidgetId = c.getInt(appWidgetIdIndex);
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index c3ceefdd32..47d8991259 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -58,7 +58,7 @@ public class LauncherProvider extends ContentProvider {
private static final String DATABASE_NAME = "launcher.db";
- private static final int DATABASE_VERSION = 6;
+ private static final int DATABASE_VERSION = 7;
static final String AUTHORITY = "com.android.launcher2.settings";
@@ -382,7 +382,13 @@ public class LauncherProvider extends ContentProvider {
version = 6;
}
}
-
+
+ if (version < 7) {
+ // Version 7 gets rid of the special search widget.
+ convertWidgets(db);
+ version = 7;
+ }
+
if (version != DATABASE_VERSION) {
Log.w(TAG, "Destroying all old data.");
db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES);
@@ -466,6 +472,7 @@ public class LauncherProvider extends ContentProvider {
final int[] bindSources = new int[] {
Favorites.ITEM_TYPE_WIDGET_CLOCK,
Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME,
+ Favorites.ITEM_TYPE_WIDGET_SEARCH,
};
final ArrayList bindTargets = new ArrayList();
@@ -473,7 +480,9 @@ public class LauncherProvider extends ContentProvider {
"com.android.alarmclock.AnalogAppWidgetProvider"));
bindTargets.add(new ComponentName("com.android.camera",
"com.android.camera.PhotoAppWidgetProvider"));
-
+ bindTargets.add(new ComponentName("com.android.quicksearchbox",
+ "com.android.quicksearchbox.SearchWidgetProvider"));
+
final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE, bindSources);
Cursor c = null;
@@ -482,7 +491,7 @@ public class LauncherProvider extends ContentProvider {
db.beginTransaction();
try {
// Select and iterate through each matching widget
- c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID },
+ c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID, Favorites.ITEM_TYPE },
selectWhere, null, null, null, null);
if (LOGD) Log.d(TAG, "found upgrade cursor count=" + c.getCount());
@@ -490,7 +499,8 @@ public class LauncherProvider extends ContentProvider {
final ContentValues values = new ContentValues();
while (c != null && c.moveToNext()) {
long favoriteId = c.getLong(0);
-
+ int favoriteType = c.getInt(1);
+
// Allocate and update database with new appWidgetId
try {
int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
@@ -499,13 +509,18 @@ public class LauncherProvider extends ContentProvider {
Log.d(TAG, "allocated appWidgetId=" + appWidgetId
+ " for favoriteId=" + favoriteId);
}
-
values.clear();
- values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId);
-
+ values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
+ values.put(Favorites.APPWIDGET_ID, appWidgetId);
+
// Original widgets might not have valid spans when upgrading
- values.put(LauncherSettings.Favorites.SPANX, 2);
- values.put(LauncherSettings.Favorites.SPANY, 2);
+ if (favoriteType == Favorites.ITEM_TYPE_WIDGET_SEARCH) {
+ values.put(LauncherSettings.Favorites.SPANX, 4);
+ values.put(LauncherSettings.Favorites.SPANY, 1);
+ } else {
+ values.put(LauncherSettings.Favorites.SPANX, 2);
+ values.put(LauncherSettings.Favorites.SPANY, 2);
+ }
String updateWhere = Favorites._ID + "=" + favoriteId;
db.update(TABLE_FAVORITES, values, updateWhere, null);
@@ -646,13 +661,9 @@ public class LauncherProvider extends ContentProvider {
}
private boolean addSearchWidget(SQLiteDatabase db, ContentValues values) {
- // Add a search box
- values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_WIDGET_SEARCH);
- values.put(Favorites.SPANX, 4);
- values.put(Favorites.SPANY, 1);
- db.insert(TABLE_FAVORITES, null, values);
-
- return true;
+ ComponentName cn = new ComponentName("com.android.quicksearchbox",
+ "com.android.quicksearchbox.SearchWidgetProvider");
+ return addAppWidget(db, values, cn, 4, 1);
}
private boolean addClockWidget(SQLiteDatabase db, ContentValues values) {
@@ -698,7 +709,13 @@ public class LauncherProvider extends ContentProvider {
}
ComponentName cn = new ComponentName(packageName, className);
-
+ int spanX = a.getInt(R.styleable.Favorite_spanX, 0);
+ int spanY = a.getInt(R.styleable.Favorite_spanY, 0);
+ return addAppWidget(db, values, cn, spanX, spanY);
+ }
+
+ private boolean addAppWidget(SQLiteDatabase db, ContentValues values, ComponentName cn,
+ int spanX, int spanY) {
boolean allocatedAppWidgets = false;
final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
@@ -706,8 +723,8 @@ public class LauncherProvider extends ContentProvider {
int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
- values.put(Favorites.SPANX, a.getString(R.styleable.Favorite_spanX));
- values.put(Favorites.SPANY, a.getString(R.styleable.Favorite_spanY));
+ values.put(Favorites.SPANX, spanX);
+ values.put(Favorites.SPANY, spanY);
values.put(Favorites.APPWIDGET_ID, appWidgetId);
db.insert(TABLE_FAVORITES, null, values);
diff --git a/src/com/android/launcher2/Search.java b/src/com/android/launcher2/Search.java
deleted file mode 100644
index 283042d19b..0000000000
--- a/src/com/android/launcher2/Search.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright (C) 2008 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.launcher2;
-
-import android.app.Activity;
-import android.content.ActivityNotFoundException;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.res.Configuration;
-import android.graphics.drawable.Drawable;
-import android.os.Bundle;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnKeyListener;
-import android.view.View.OnLongClickListener;
-import android.view.animation.AccelerateDecelerateInterpolator;
-import android.view.animation.Animation;
-import android.view.animation.Interpolator;
-import android.view.animation.Transformation;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class Search extends LinearLayout
- implements OnClickListener, OnKeyListener, OnLongClickListener {
-
- // Speed at which the widget slides up/down, in pixels/ms.
- private static final float ANIMATION_VELOCITY = 1.0f;
-
- /** The distance in dips between the optical top of the widget and the top if its bounds */
- private static final float WIDGET_TOP_OFFSET = 9;
-
-
- private final String TAG = "Launcher.SearchWidget";
-
- private Launcher mLauncher;
-
- private TextView mSearchText;
- private ImageButton mVoiceButton;
-
- /** The animation that morphs the search widget to the search dialog. */
- private Animation mMorphAnimation;
-
- /** The animation that morphs the search widget back to its normal position. */
- private Animation mUnmorphAnimation;
-
- // These four are passed to Launcher.startSearch() when the search widget
- // has finished morphing. They are instance variables to make it possible to update
- // them while the widget is morphing.
- private String mInitialQuery;
- private boolean mSelectInitialQuery;
- private Bundle mAppSearchData;
- private boolean mGlobalSearch;
-
- // For voice searching
- private Intent mVoiceSearchIntent;
-
- private int mWidgetTopOffset;
-
- /**
- * Used to inflate the Workspace from XML.
- *
- * @param context The application's context.
- * @param attrs The attributes set containing the Workspace's customization values.
- */
- public Search(Context context, AttributeSet attrs) {
- super(context, attrs);
-
- final float scale = context.getResources().getDisplayMetrics().density;
- mWidgetTopOffset = Math.round(WIDGET_TOP_OFFSET * scale);
-
- Interpolator interpolator = new AccelerateDecelerateInterpolator();
-
- mMorphAnimation = new ToParentOriginAnimation();
- // no need to apply transformation before the animation starts,
- // since the gadget is already in its normal place.
- mMorphAnimation.setFillBefore(false);
- // stay in the top position after the animation finishes
- mMorphAnimation.setFillAfter(true);
- mMorphAnimation.setInterpolator(interpolator);
- mMorphAnimation.setAnimationListener(new Animation.AnimationListener() {
- // The amount of time before the animation ends to show the search dialog.
- private static final long TIME_BEFORE_ANIMATION_END = 80;
-
- // The runnable which we'll pass to our handler to show the search dialog.
- private final Runnable mShowSearchDialogRunnable = new Runnable() {
- public void run() {
- showSearchDialog();
- }
- };
-
- public void onAnimationEnd(Animation animation) { }
- public void onAnimationRepeat(Animation animation) { }
- public void onAnimationStart(Animation animation) {
- // Make the search dialog show up ideally *just* as the animation reaches
- // the top, to aid the illusion that the widget becomes the search dialog.
- // Otherwise, there is a short delay when the widget reaches the top before
- // the search dialog shows. We do this roughly 80ms before the animation ends.
- getHandler().postDelayed(
- mShowSearchDialogRunnable,
- Math.max(mMorphAnimation.getDuration() - TIME_BEFORE_ANIMATION_END, 0));
- }
- });
-
- mUnmorphAnimation = new FromParentOriginAnimation();
- // stay in the top position until the animation starts
- mUnmorphAnimation.setFillBefore(true);
- // no need to apply transformation after the animation finishes,
- // since the gadget is now back in its normal place.
- mUnmorphAnimation.setFillAfter(false);
- mUnmorphAnimation.setInterpolator(interpolator);
- mUnmorphAnimation.setAnimationListener(new Animation.AnimationListener(){
- public void onAnimationEnd(Animation animation) {
- clearAnimation();
- }
- public void onAnimationRepeat(Animation animation) { }
- public void onAnimationStart(Animation animation) { }
- });
-
- mVoiceSearchIntent = new Intent(android.speech.RecognizerIntent.ACTION_WEB_SEARCH);
- mVoiceSearchIntent.putExtra(android.speech.RecognizerIntent.EXTRA_LANGUAGE_MODEL,
- android.speech.RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
- }
-
- /**
- * Implements OnClickListener.
- */
- public void onClick(View v) {
- if (v == mVoiceButton) {
- startVoiceSearch();
- } else {
- mLauncher.onSearchRequested();
- }
- }
-
- private void startVoiceSearch() {
- try {
- getContext().startActivity(mVoiceSearchIntent);
- } catch (ActivityNotFoundException ex) {
- // Should not happen, since we check the availability of
- // voice search before showing the button. But just in case...
- Log.w(TAG, "Could not find voice search activity");
- }
- }
-
- /**
- * Sets the query text. The query field is not editable, instead we forward
- * the key events to the launcher, which keeps track of the text,
- * calls setQuery() to show it, and gives it to the search dialog.
- */
- public void setQuery(String query) {
- mSearchText.setText(query, TextView.BufferType.NORMAL);
- }
-
- /**
- * Morph the search gadget to the search dialog.
- * See {@link Activity#startSearch()} for the arguments.
- */
- public void startSearch(String initialQuery, boolean selectInitialQuery,
- Bundle appSearchData, boolean globalSearch) {
- mInitialQuery = initialQuery;
- mSelectInitialQuery = selectInitialQuery;
- mAppSearchData = appSearchData;
- mGlobalSearch = globalSearch;
-
- if (isAtTop()) {
- showSearchDialog();
- } else {
- // Call up the keyboard before we actually call the search dialog so that it
- // (hopefully) animates in at about the same time as the widget animation, and
- // so that it becomes available as soon as possible. Only do this if a hard
- // keyboard is not currently available.
- if (getContext().getResources().getConfiguration().hardKeyboardHidden ==
- Configuration.HARDKEYBOARDHIDDEN_YES) {
- InputMethodManager inputManager = (InputMethodManager)
- getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
- inputManager.showSoftInputUnchecked(0, null);
- }
-
- // Start the animation, unless it has already started.
- if (getAnimation() != mMorphAnimation) {
- mMorphAnimation.setDuration(getAnimationDuration());
- startAnimation(mMorphAnimation);
- }
- }
- }
-
- /**
- * Shows the system search dialog immediately, without any animation.
- */
- private void showSearchDialog() {
- mLauncher.showSearchDialog(
- mInitialQuery, mSelectInitialQuery, mAppSearchData, mGlobalSearch);
- }
-
- /**
- * Restore the search gadget to its normal position.
- *
- * @param animate Whether to animate the movement of the gadget.
- */
- public void stopSearch(boolean animate) {
- setQuery("");
-
- // Only restore if we are not already restored.
- if (getAnimation() == mMorphAnimation) {
- if (animate && !isAtTop()) {
- mUnmorphAnimation.setDuration(getAnimationDuration());
- startAnimation(mUnmorphAnimation);
- } else {
- clearAnimation();
- }
- }
- }
-
- private boolean isAtTop() {
- return getWidgetTop() == 0;
- }
-
- private int getAnimationDuration() {
- return (int) (getWidgetTop() / ANIMATION_VELOCITY);
- }
-
- /**
- * Modify clearAnimation() to invalidate the parent. This works around
- * an issue where the region where the end of the animation placed the view
- * was not redrawn after clearing the animation.
- */
- @Override
- public void clearAnimation() {
- Animation animation = getAnimation();
- if (animation != null) {
- super.clearAnimation();
- if (animation.hasEnded()
- && animation.getFillAfter()
- && animation.willChangeBounds()) {
- View parent = (View) getParent();
- if (parent != null) parent.invalidate();
- } else {
- invalidate();
- }
- }
- }
-
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- if (!event.isSystem() &&
- (keyCode != KeyEvent.KEYCODE_DPAD_UP) &&
- (keyCode != KeyEvent.KEYCODE_DPAD_DOWN) &&
- (keyCode != KeyEvent.KEYCODE_DPAD_LEFT) &&
- (keyCode != KeyEvent.KEYCODE_DPAD_RIGHT) &&
- (keyCode != KeyEvent.KEYCODE_DPAD_CENTER)) {
- // Forward key events to Launcher, which will forward text
- // to search dialog
- switch (event.getAction()) {
- case KeyEvent.ACTION_DOWN:
- return mLauncher.onKeyDown(keyCode, event);
- case KeyEvent.ACTION_MULTIPLE:
- return mLauncher.onKeyMultiple(keyCode, event.getRepeatCount(), event);
- case KeyEvent.ACTION_UP:
- return mLauncher.onKeyUp(keyCode, event);
- }
- }
- return false;
- }
-
- /**
- * Implements OnLongClickListener to pass long clicks on child views
- * to the widget. This makes it possible to pick up the widget by long
- * clicking on the text field or a button.
- */
- public boolean onLongClick(View v) {
- return performLongClick();
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
-
- mSearchText = (TextView) findViewById(R.id.search_src_text);
- mVoiceButton = (ImageButton) findViewById(R.id.search_voice_btn);
-
- mSearchText.setOnKeyListener(this);
-
- mSearchText.setOnClickListener(this);
- mVoiceButton.setOnClickListener(this);
- setOnClickListener(this);
-
- mSearchText.setOnLongClickListener(this);
- mVoiceButton.setOnLongClickListener(this);
-
- // Set the placeholder text to be the Google logo within the search widget.
- Drawable googlePlaceholder =
- getContext().getResources().getDrawable(R.drawable.placeholder_google);
- mSearchText.setCompoundDrawablesWithIntrinsicBounds(googlePlaceholder, null, null, null);
-
- configureVoiceSearchButton();
- }
-
- @Override
- public void onDetachedFromWindow() {
- super.onDetachedFromWindow();
- }
-
- /**
- * If appropriate & available, configure voice search
- *
- * Note: Because the home screen search widget is always web search, we only check for
- * getVoiceSearchLaunchWebSearch() modes. We don't support the alternate form of app-specific
- * voice search.
- */
- private void configureVoiceSearchButton() {
- // Enable the voice search button if there is an activity that can handle it
- PackageManager pm = getContext().getPackageManager();
- ResolveInfo ri = pm.resolveActivity(mVoiceSearchIntent,
- PackageManager.MATCH_DEFAULT_ONLY);
- boolean voiceSearchVisible = ri != null;
-
- // finally, set visible state of voice search button, as appropriate
- mVoiceButton.setVisibility(voiceSearchVisible ? View.VISIBLE : View.GONE);
- }
-
- /**
- * Sets the {@link Launcher} that this gadget will call on to display the search dialog.
- */
- public void setLauncher(Launcher launcher) {
- mLauncher = launcher;
- }
-
- /**
- * Moves the view to the top left corner of its parent.
- */
- private class ToParentOriginAnimation extends Animation {
- @Override
- protected void applyTransformation(float interpolatedTime, Transformation t) {
- float dx = -getLeft() * interpolatedTime;
- float dy = -getWidgetTop() * interpolatedTime;
- t.getMatrix().setTranslate(dx, dy);
- }
- }
-
- /**
- * Moves the view from the top left corner of its parent.
- */
- private class FromParentOriginAnimation extends Animation {
- @Override
- protected void applyTransformation(float interpolatedTime, Transformation t) {
- float dx = -getLeft() * (1.0f - interpolatedTime);
- float dy = -getWidgetTop() * (1.0f - interpolatedTime);
- t.getMatrix().setTranslate(dx, dy);
- }
- }
-
- /**
- * The widget is centered vertically within it's 4x1 slot. This is accomplished by nesting
- * the actual widget inside another view. For animation purposes, we care about the top of the
- * actual widget rather than it's container. This method return the top of the actual widget.
- */
- private int getWidgetTop() {
- return getTop() + getChildAt(0).getTop() + mWidgetTopOffset;
- }
-}
diff --git a/src/com/android/launcher2/Widget.java b/src/com/android/launcher2/Widget.java
deleted file mode 100644
index 348acee7cb..0000000000
--- a/src/com/android/launcher2/Widget.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008 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.launcher2;
-
-import android.content.ContentValues;
-import android.graphics.Bitmap;
-
-/**
- * Represents one instance of a Launcher widget, such as search.
- */
-class Widget extends ItemInfo {
- int layoutResource;
-
- static Widget makeSearch() {
- Widget w = new Widget();
- w.itemType = LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH;
- w.spanX = 4;
- w.spanY = 1;
- w.layoutResource = R.layout.widget_search;
- return w;
- }
-}
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index f1ee817da0..927bd4c0fc 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -332,16 +332,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
}
}
- void addWidget(View view, Widget widget) {
- addInScreen(view, widget.screen, widget.cellX, widget.cellY, widget.spanX,
- widget.spanY, false);
- }
-
- void addWidget(View view, Widget widget, boolean insert) {
- addInScreen(view, widget.screen, widget.cellX, widget.cellY, widget.spanX,
- widget.spanY, insert);
- }
-
CellLayout.CellInfo findAllVacantCells(boolean[] occupied) {
CellLayout group = (CellLayout) getChildAt(mCurrentScreen);
if (group != null) {
@@ -856,8 +846,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
View child = cellInfo.cell;
// Make sure the drag was started by a long press as opposed to a long click.
- // Note that Search takes focus when clicked rather than entering touch mode
- if (!child.isInTouchMode() && !(child instanceof Search)) {
+ if (!child.isInTouchMode()) {
return;
}
@@ -1123,29 +1112,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
return result;
}
- /**
- * Find a search widget on the given screen
- */
- private Search findSearchWidget(CellLayout screen) {
- final int count = screen.getChildCount();
- for (int i = 0; i < count; i++) {
- View v = screen.getChildAt(i);
- if (v instanceof Search) {
- return (Search) v;
- }
- }
- return null;
- }
-
- /**
- * Gets the first search widget on the current screen, if there is one.
- * Returns null otherwise.
- */
- public Search findSearchWidgetOnCurrentScreen() {
- CellLayout currentScreen = (CellLayout)getChildAt(mCurrentScreen);
- return findSearchWidget(currentScreen);
- }
-
public Folder getFolderForTag(Object tag) {
int screenCount = getChildCount();
for (int screen = 0; screen < screenCount; screen++) {