auto import from //depot/cupcake/@132589
This commit is contained in:
parent
b28e1b7d95
commit
38a75b2d89
|
@ -70,8 +70,7 @@
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:clearTaskOnLaunch="true"
|
android:clearTaskOnLaunch="true"
|
||||||
android:stateNotNeeded="true"
|
android:stateNotNeeded="true"
|
||||||
android:theme="@style/Theme"
|
android:theme="@style/Theme">
|
||||||
android:windowSoftInputMode="stateUnspecified|adjustPan">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.HOME"/>
|
<category android:name="android.intent.category.HOME"/>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
|
@ -66,7 +66,7 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
|
||||||
launcher:texture="@drawable/texture_brushed_steel"
|
android:background="@color/grid_dark_background"
|
||||||
|
|
||||||
android:scrollbarStyle="outsideInset"
|
android:scrollbarStyle="outsideInset"
|
||||||
android:drawSelectorOnTop="false"
|
android:drawSelectorOnTop="false"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
android:paddingTop="5dip"
|
android:paddingTop="5dip"
|
||||||
android:paddingBottom="2dip"
|
android:paddingBottom="2dip"
|
||||||
android:drawablePadding="0dip"
|
android:drawablePadding="0dip"
|
||||||
|
|
||||||
android:textSize="13dip"
|
android:textSize="13dip"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
|
||||||
launcher:texture="@drawable/texture_brushed_steel"
|
android:background="@color/grid_dark_background"
|
||||||
|
|
||||||
android:scrollbarStyle="outsideInset"
|
android:scrollbarStyle="outsideInset"
|
||||||
android:drawSelectorOnTop="false"
|
android:drawSelectorOnTop="false"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/google_logo" />
|
android:src="@drawable/google_logo" />
|
||||||
|
|
||||||
<com.android.launcher.SearchAutoCompleteTextView
|
<AutoCompleteTextView
|
||||||
android:id="@+id/input"
|
android:id="@+id/input"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
@ -36,8 +36,7 @@
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:selectAllOnFocus="true"
|
android:selectAllOnFocus="true"
|
||||||
android:completionThreshold="1"
|
android:completionThreshold="1"
|
||||||
android:inputType="textAutoComplete"
|
android:inputType="textAutoComplete|textSearch"
|
||||||
android:imeOptions="actionSearch"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageButton android:id="@+id/search_go_btn"
|
<ImageButton android:id="@+id/search_go_btn"
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"Složka"</string>
|
<string name="group_folder">"Složka"</string>
|
||||||
<string name="group_live_folders">"Složka Live"</string>
|
<string name="group_live_folders">"Složka Live"</string>
|
||||||
<string name="group_widgets">"Miniaplikace"</string>
|
<string name="group_widgets">"Miniaplikace"</string>
|
||||||
|
<string name="group_gadgets">"Gadget"</string>
|
||||||
<string name="group_wallpapers">"Tapeta"</string>
|
<string name="group_wallpapers">"Tapeta"</string>
|
||||||
<string name="add_folder">"Složka"</string>
|
<string name="add_folder">"Složka"</string>
|
||||||
<string name="add_clock">"Hodiny"</string>
|
<string name="add_clock">"Hodiny"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"zápis nastavení a odkazů plochy"</string>
|
<string name="permlab_write_settings">"zápis nastavení a odkazů plochy"</string>
|
||||||
<string name="permdesc_write_settings">"Povoluje aplikaci změnit nastavení a odkazy plochy."</string>
|
<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="search_hint">"Vyhledávání Google"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Při načítání gadgetu došlo k problému"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"Ordner"</string>
|
<string name="group_folder">"Ordner"</string>
|
||||||
<string name="group_live_folders">"Live-Ordner"</string>
|
<string name="group_live_folders">"Live-Ordner"</string>
|
||||||
<string name="group_widgets">"Widget"</string>
|
<string name="group_widgets">"Widget"</string>
|
||||||
|
<string name="group_gadgets">"Gadget"</string>
|
||||||
<string name="group_wallpapers">"Hintergrund"</string>
|
<string name="group_wallpapers">"Hintergrund"</string>
|
||||||
<string name="add_folder">"Ordner"</string>
|
<string name="add_folder">"Ordner"</string>
|
||||||
<string name="add_clock">"Uhr"</string>
|
<string name="add_clock">"Uhr"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"Einstellungen und Shortcuts für Startseite schreiben"</string>
|
<string name="permlab_write_settings">"Einstellungen und Shortcuts für Startseite schreiben"</string>
|
||||||
<string name="permdesc_write_settings">"Ermöglicht einer Anwendung, die Einstellungen und Shortcuts auf der Startseite zu ändern."</string>
|
<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="search_hint">"Google-Suche"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Problem beim Laden von Gadget"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -28,10 +28,11 @@
|
||||||
<string name="menu_item_add_item">"Añadir a pantalla de página principal"</string>
|
<string name="menu_item_add_item">"Añadir a pantalla de página principal"</string>
|
||||||
<string name="group_applications">"Aplicación"</string>
|
<string name="group_applications">"Aplicación"</string>
|
||||||
<string name="group_shortcuts">"Acceso directo"</string>
|
<string name="group_shortcuts">"Acceso directo"</string>
|
||||||
<string name="group_search">"Búsqueda"</string>
|
<string name="group_search">"Buscar"</string>
|
||||||
<string name="group_folder">"Carpeta"</string>
|
<string name="group_folder">"Carpeta"</string>
|
||||||
<string name="group_live_folders">"Carpeta activa"</string>
|
<string name="group_live_folders">"Carpeta activa"</string>
|
||||||
<string name="group_widgets">"Widget"</string>
|
<string name="group_widgets">"Widget"</string>
|
||||||
|
<string name="group_gadgets">"Gadget"</string>
|
||||||
<string name="group_wallpapers">"Fondo de pantalla"</string>
|
<string name="group_wallpapers">"Fondo de pantalla"</string>
|
||||||
<string name="add_folder">"Carpeta"</string>
|
<string name="add_folder">"Carpeta"</string>
|
||||||
<string name="add_clock">"Reloj"</string>
|
<string name="add_clock">"Reloj"</string>
|
||||||
|
@ -42,7 +43,7 @@
|
||||||
<string name="title_select_live_folder">"Seleccionar carpeta activa"</string>
|
<string name="title_select_live_folder">"Seleccionar carpeta activa"</string>
|
||||||
<string name="menu_add">"Añadir"</string>
|
<string name="menu_add">"Añadir"</string>
|
||||||
<string name="menu_wallpaper">"Fondo de pantalla"</string>
|
<string name="menu_wallpaper">"Fondo de pantalla"</string>
|
||||||
<string name="menu_search">"Buscar con Google"</string>
|
<string name="menu_search">"Búsqueda de Google"</string>
|
||||||
<string name="menu_notifications">"Notificaciones"</string>
|
<string name="menu_notifications">"Notificaciones"</string>
|
||||||
<string name="menu_settings">"Ajustes"</string>
|
<string name="menu_settings">"Ajustes"</string>
|
||||||
<string name="permlab_install_shortcut">"instalar accesos directos"</string>
|
<string name="permlab_install_shortcut">"instalar accesos directos"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"escribir información de accesos directos y de configuración de la página principal"</string>
|
<string name="permlab_write_settings">"escribir información de accesos directos y de configuración de la página principal"</string>
|
||||||
<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="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="search_hint">"Búsqueda de Google"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Problema la cargar gadget"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<string name="application_name">"Accueil"</string>
|
<string name="application_name">"Accueil"</string>
|
||||||
<string name="folder_name">"Dossier"</string>
|
<string name="folder_name">"Dossier"</string>
|
||||||
<string name="chooser_wallpaper">"Sélectionner à partir de..."</string>
|
<string name="chooser_wallpaper">"Sélectionner l\'arrière-plan à partir de"</string>
|
||||||
<string name="wallpaper_instructions">"Sélectionner"</string>
|
<string name="wallpaper_instructions">"Configurer l\'arrière-plan"</string>
|
||||||
<string name="pick_wallpaper">"Galerie"</string>
|
<string name="pick_wallpaper">"Galerie des arrière-plans"</string>
|
||||||
<string name="activity_not_found">"L\'application n\'est pas installée sur votre téléphone."</string>
|
<string name="activity_not_found">"L\'application n\'est pas installée sur votre téléphone."</string>
|
||||||
<string name="rename_folder_label">"Nom du dossier"</string>
|
<string name="rename_folder_label">"Nom du dossier"</string>
|
||||||
<string name="rename_folder_title">"Renommer le dossier"</string>
|
<string name="rename_folder_title">"Renommer le dossier"</string>
|
||||||
|
@ -30,16 +30,17 @@
|
||||||
<string name="group_shortcuts">"Raccourci"</string>
|
<string name="group_shortcuts">"Raccourci"</string>
|
||||||
<string name="group_search">"Recherche"</string>
|
<string name="group_search">"Recherche"</string>
|
||||||
<string name="group_folder">"Dossier"</string>
|
<string name="group_folder">"Dossier"</string>
|
||||||
<string name="group_live_folders">"Dossier actif"</string>
|
<string name="group_live_folders">"Dossier live"</string>
|
||||||
<string name="group_widgets">"Widget"</string>
|
<string name="group_widgets">"Widget"</string>
|
||||||
|
<string name="group_gadgets">"Gadgets"</string>
|
||||||
<string name="group_wallpapers">"Arrière-plan"</string>
|
<string name="group_wallpapers">"Arrière-plan"</string>
|
||||||
<string name="add_folder">"Dossier"</string>
|
<string name="add_folder">"Dossier"</string>
|
||||||
<string name="add_clock">"Horloge"</string>
|
<string name="add_clock">"Horloge"</string>
|
||||||
<string name="add_photo_frame">"Cadre d\'image"</string>
|
<string name="add_photo_frame">"Cadre d\'image"</string>
|
||||||
<string name="add_search">"Rechercher"</string>
|
<string name="add_search">"Rechercher"</string>
|
||||||
<string name="out_of_space">"Plus d\'espace libre sur l\'écran d\'accueil."</string>
|
<string name="out_of_space">"Plus d\'espace libre sur l\'écran Accueil."</string>
|
||||||
<string name="title_select_shortcut">"Sélectionner un raccourci"</string>
|
<string name="title_select_shortcut">"Sélectionner un raccourci"</string>
|
||||||
<string name="title_select_live_folder">"Sélectionner dossier actif"</string>
|
<string name="title_select_live_folder">"Sélectionner Live Folder"</string>
|
||||||
<string name="menu_add">"Ajouter"</string>
|
<string name="menu_add">"Ajouter"</string>
|
||||||
<string name="menu_wallpaper">"Arrière-plan"</string>
|
<string name="menu_wallpaper">"Arrière-plan"</string>
|
||||||
<string name="menu_search">"Rechercher"</string>
|
<string name="menu_search">"Rechercher"</string>
|
||||||
|
@ -49,11 +50,10 @@
|
||||||
<string name="permdesc_install_shortcut">"Permet à une application d\'ajouter des raccourcis sans l\'intervention de l\'utilisateur."</string>
|
<string name="permdesc_install_shortcut">"Permet à une application d\'ajouter des raccourcis sans l\'intervention de l\'utilisateur."</string>
|
||||||
<string name="permlab_uninstall_shortcut">"désinstaller les raccourcis"</string>
|
<string name="permlab_uninstall_shortcut">"désinstaller les raccourcis"</string>
|
||||||
<string name="permdesc_uninstall_shortcut">"Permet à une application de supprimer les raccourcis sans l\'intervention de l\'utilisateur."</string>
|
<string name="permdesc_uninstall_shortcut">"Permet à une application de supprimer les raccourcis sans l\'intervention de l\'utilisateur."</string>
|
||||||
<string name="permlab_read_settings">"Lire les paramètres et les raccourcis de la page d\'accueil"</string>
|
<string name="permlab_read_settings">"lire les paramètres et les raccourcis de la page d\'accueil"</string>
|
||||||
<string name="permdesc_read_settings">"Permet à une application de lire les paramètres et raccourcis de la page d\'accueil."</string>
|
<string name="permdesc_read_settings">"Permet à une application de lire les paramètres et raccourcis de la page d\'accueil."</string>
|
||||||
<string name="permlab_write_settings">"Enregistrer les paramètres de la page d\'accueil et des raccourcis"</string>
|
<string name="permlab_write_settings">"écrire les paramètres de la page d\'accueil et des raccourcis"</string>
|
||||||
<string name="permdesc_write_settings">"Permet à une application de modifier les paramètres et les raccourcis de la page d\'accueil."</string>
|
<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="search_hint">"Recherche Google"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Problème lors du chargement du gadget"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -27,11 +27,12 @@
|
||||||
<string name="cancel_action">"Annulla"</string>
|
<string name="cancel_action">"Annulla"</string>
|
||||||
<string name="menu_item_add_item">"Aggiungi a schermata Home"</string>
|
<string name="menu_item_add_item">"Aggiungi a schermata Home"</string>
|
||||||
<string name="group_applications">"Applicazione"</string>
|
<string name="group_applications">"Applicazione"</string>
|
||||||
<string name="group_shortcuts">"Scorciatoia"</string>
|
<string name="group_shortcuts">"Collegamento"</string>
|
||||||
<string name="group_search">"Ricerca"</string>
|
<string name="group_search">"Cerca"</string>
|
||||||
<string name="group_folder">"Cartella"</string>
|
<string name="group_folder">"Cartella"</string>
|
||||||
<string name="group_live_folders">"Cartella dinamica"</string>
|
<string name="group_live_folders">"Cartella dinamica"</string>
|
||||||
<string name="group_widgets">"Widget"</string>
|
<string name="group_widgets">"Widget"</string>
|
||||||
|
<string name="group_gadgets">"Gadget"</string>
|
||||||
<string name="group_wallpapers">"Sfondo"</string>
|
<string name="group_wallpapers">"Sfondo"</string>
|
||||||
<string name="add_folder">"Cartella"</string>
|
<string name="add_folder">"Cartella"</string>
|
||||||
<string name="add_clock">"Orologio"</string>
|
<string name="add_clock">"Orologio"</string>
|
||||||
|
@ -45,15 +46,14 @@
|
||||||
<string name="menu_search">"Cerca"</string>
|
<string name="menu_search">"Cerca"</string>
|
||||||
<string name="menu_notifications">"Notifiche"</string>
|
<string name="menu_notifications">"Notifiche"</string>
|
||||||
<string name="menu_settings">"Impostazioni"</string>
|
<string name="menu_settings">"Impostazioni"</string>
|
||||||
<string name="permlab_install_shortcut">"aggiungere scorciatorie"</string>
|
<string name="permlab_install_shortcut">"aggiungere collegamenti"</string>
|
||||||
<string name="permdesc_install_shortcut">"Consente a un\'applicazione di aggiungere scorciatoie automaticamente."</string>
|
<string name="permdesc_install_shortcut">"Consente a un\'applicazione di aggiungere collegamenti automaticamente."</string>
|
||||||
<string name="permlab_uninstall_shortcut">"eliminare scorciatoie"</string>
|
<string name="permlab_uninstall_shortcut">"eliminare collegamenti"</string>
|
||||||
<string name="permdesc_uninstall_shortcut">"Consente a un\'applicazione di rimuovere scorciatoie automaticamente."</string>
|
<string name="permdesc_uninstall_shortcut">"Consente a un\'applicazione di rimuovere collegamenti automaticamente."</string>
|
||||||
<string name="permlab_read_settings">"leggere impostazioni e scorciatoie in Home"</string>
|
<string name="permlab_read_settings">"leggere impostazioni e collegamenti in Home"</string>
|
||||||
<string name="permdesc_read_settings">"Consente a un\'applicazione di leggere le impostazioni e le scorciatoie in Home."</string>
|
<string name="permdesc_read_settings">"Consente a un\'applicazione di leggere le impostazioni e i collegamenti in Home."</string>
|
||||||
<string name="permlab_write_settings">"creare impostazioni e scorciatoie in Home"</string>
|
<string name="permlab_write_settings">"creare impostazioni e collegamenti in Home"</string>
|
||||||
<string name="permdesc_write_settings">"Consente a un\'applicazione di modificare le impostazioni e le scorciatoie in Home."</string>
|
<string name="permdesc_write_settings">"Consente a un\'applicazione di modificare le impostazioni e i collegamenti in Home."</string>
|
||||||
<string name="search_hint">"Ricerca Google"</string>
|
<string name="search_hint">"Ricerca Google"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Errore durante caricamento del gadget"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"フォルダ"</string>
|
<string name="group_folder">"フォルダ"</string>
|
||||||
<string name="group_live_folders">"ライブフォルダ"</string>
|
<string name="group_live_folders">"ライブフォルダ"</string>
|
||||||
<string name="group_widgets">"ウィジェット"</string>
|
<string name="group_widgets">"ウィジェット"</string>
|
||||||
|
<string name="group_gadgets">"ガジェット"</string>
|
||||||
<string name="group_wallpapers">"壁紙"</string>
|
<string name="group_wallpapers">"壁紙"</string>
|
||||||
<string name="add_folder">"フォルダ"</string>
|
<string name="add_folder">"フォルダ"</string>
|
||||||
<string name="add_clock">"時計"</string>
|
<string name="add_clock">"時計"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"ホームの設定とショートカットの書き込み"</string>
|
<string name="permlab_write_settings">"ホームの設定とショートカットの書き込み"</string>
|
||||||
<string name="permdesc_write_settings">"ホームの設定とショートカットの変更をアプリケーションに許可します。"</string>
|
<string name="permdesc_write_settings">"ホームの設定とショートカットの変更をアプリケーションに許可します。"</string>
|
||||||
<string name="search_hint">"Google検索"</string>
|
<string name="search_hint">"Google検索"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"ガジェットをロードできません"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"폴더"</string>
|
<string name="group_folder">"폴더"</string>
|
||||||
<string name="group_live_folders">"라이브 폴더"</string>
|
<string name="group_live_folders">"라이브 폴더"</string>
|
||||||
<string name="group_widgets">"위젯"</string>
|
<string name="group_widgets">"위젯"</string>
|
||||||
|
<string name="group_gadgets">"가젯"</string>
|
||||||
<string name="group_wallpapers">"배경화면"</string>
|
<string name="group_wallpapers">"배경화면"</string>
|
||||||
<string name="add_folder">"폴더"</string>
|
<string name="add_folder">"폴더"</string>
|
||||||
<string name="add_clock">"시계"</string>
|
<string name="add_clock">"시계"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"홈 설정 및 바로가기 쓰기"</string>
|
<string name="permlab_write_settings">"홈 설정 및 바로가기 쓰기"</string>
|
||||||
<string name="permdesc_write_settings">"응용프로그램이 홈에 있는 설정 및 바로가기를 변경할 수 있습니다."</string>
|
<string name="permdesc_write_settings">"응용프로그램이 홈에 있는 설정 및 바로가기를 변경할 수 있습니다."</string>
|
||||||
<string name="search_hint">"Google 검색"</string>
|
<string name="search_hint">"Google 검색"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"가젯 로드 중 문제 발생"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"Mappe"</string>
|
<string name="group_folder">"Mappe"</string>
|
||||||
<string name="group_live_folders">"Aktiv mappe"</string>
|
<string name="group_live_folders">"Aktiv mappe"</string>
|
||||||
<string name="group_widgets">"Skrivebordselement"</string>
|
<string name="group_widgets">"Skrivebordselement"</string>
|
||||||
|
<string name="group_gadgets">"Gadget"</string>
|
||||||
<string name="group_wallpapers">"Bakgrunnsbilde"</string>
|
<string name="group_wallpapers">"Bakgrunnsbilde"</string>
|
||||||
<string name="add_folder">"Mappe"</string>
|
<string name="add_folder">"Mappe"</string>
|
||||||
<string name="add_clock">"Klokke"</string>
|
<string name="add_clock">"Klokke"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"skrive skrivebordsinnstillinger og -snarveier"</string>
|
<string name="permlab_write_settings">"skrive skrivebordsinnstillinger og -snarveier"</string>
|
||||||
<string name="permdesc_write_settings">"Lar applikasjonen endre innstillinger og snarveier på skrivebordet."</string>
|
<string name="permdesc_write_settings">"Lar applikasjonen endre innstillinger og snarveier på skrivebordet."</string>
|
||||||
<string name="search_hint">"Google-søk"</string>
|
<string name="search_hint">"Google-søk"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Problem under lasting av gadget"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"Map"</string>
|
<string name="group_folder">"Map"</string>
|
||||||
<string name="group_live_folders">"Live map"</string>
|
<string name="group_live_folders">"Live map"</string>
|
||||||
<string name="group_widgets">"Widget"</string>
|
<string name="group_widgets">"Widget"</string>
|
||||||
|
<string name="group_gadgets">"Gadget"</string>
|
||||||
<string name="group_wallpapers">"Achtergrond"</string>
|
<string name="group_wallpapers">"Achtergrond"</string>
|
||||||
<string name="add_folder">"Map"</string>
|
<string name="add_folder">"Map"</string>
|
||||||
<string name="add_clock">"Klok"</string>
|
<string name="add_clock">"Klok"</string>
|
||||||
|
@ -53,7 +54,6 @@
|
||||||
<string name="permdesc_read_settings">"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina lezen."</string>
|
<string name="permdesc_read_settings">"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina lezen."</string>
|
||||||
<string name="permlab_write_settings">"instellingen en snelkoppelingen voor de startpagina schrijven"</string>
|
<string name="permlab_write_settings">"instellingen en snelkoppelingen voor de startpagina schrijven"</string>
|
||||||
<string name="permdesc_write_settings">"Hiermee kan een toepassing de instellingen en snelkoppelingen op de startpagina wijzigen."</string>
|
<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="search_hint">"Zoeken met Google"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Probleem bij het laden van gadget"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -28,15 +28,16 @@
|
||||||
<string name="menu_item_add_item">"Dodaj do strony głównej"</string>
|
<string name="menu_item_add_item">"Dodaj do strony głównej"</string>
|
||||||
<string name="group_applications">"Aplikacja"</string>
|
<string name="group_applications">"Aplikacja"</string>
|
||||||
<string name="group_shortcuts">"Skrót"</string>
|
<string name="group_shortcuts">"Skrót"</string>
|
||||||
<string name="group_search">"Wyszukiwarka"</string>
|
<string name="group_search">"Szukaj"</string>
|
||||||
<string name="group_folder">"Folder"</string>
|
<string name="group_folder">"Folder"</string>
|
||||||
<string name="group_live_folders">"Folder aktywny"</string>
|
<string name="group_live_folders">"Folder Live"</string>
|
||||||
<string name="group_widgets">"Widget"</string>
|
<string name="group_widgets">"Widget"</string>
|
||||||
|
<string name="group_gadgets">"Gadżet"</string>
|
||||||
<string name="group_wallpapers">"Tapeta"</string>
|
<string name="group_wallpapers">"Tapeta"</string>
|
||||||
<string name="add_folder">"Folder"</string>
|
<string name="add_folder">"Folder"</string>
|
||||||
<string name="add_clock">"Zegar"</string>
|
<string name="add_clock">"Zegar"</string>
|
||||||
<string name="add_photo_frame">"Ramka obrazu"</string>
|
<string name="add_photo_frame">"Ramka obrazu"</string>
|
||||||
<string name="add_search">"Wyszukiwarka"</string>
|
<string name="add_search">"Szukaj"</string>
|
||||||
<string name="out_of_space">"Brak miejsca na tej stronie głównej"</string>
|
<string name="out_of_space">"Brak miejsca na tej stronie głównej"</string>
|
||||||
<string name="title_select_shortcut">"Wybierz skrót"</string>
|
<string name="title_select_shortcut">"Wybierz skrót"</string>
|
||||||
<string name="title_select_live_folder">"Wybierz folder aktywny"</string>
|
<string name="title_select_live_folder">"Wybierz folder aktywny"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"zapisywanie ustawień i skrótów strony głównej"</string>
|
<string name="permlab_write_settings">"zapisywanie ustawień i skrótów strony głównej"</string>
|
||||||
<string name="permdesc_write_settings">"Umożliwia aplikacji zmianę ustawień i skrótów strony głównej."</string>
|
<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="search_hint">"Szukaj w Google"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Wystąpił problem podczas ładowania gadżetu"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"Папка"</string>
|
<string name="group_folder">"Папка"</string>
|
||||||
<string name="group_live_folders">"Динамическая папка"</string>
|
<string name="group_live_folders">"Динамическая папка"</string>
|
||||||
<string name="group_widgets">"Виджет"</string>
|
<string name="group_widgets">"Виджет"</string>
|
||||||
|
<string name="group_gadgets">"Гаджет"</string>
|
||||||
<string name="group_wallpapers">"Фоновый рисунок"</string>
|
<string name="group_wallpapers">"Фоновый рисунок"</string>
|
||||||
<string name="add_folder">"Папка"</string>
|
<string name="add_folder">"Папка"</string>
|
||||||
<string name="add_clock">"Часы"</string>
|
<string name="add_clock">"Часы"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"записывать ярлыки и настройки главного экрана"</string>
|
<string name="permlab_write_settings">"записывать ярлыки и настройки главного экрана"</string>
|
||||||
<string name="permdesc_write_settings">"Позволяет приложению изменять настройки и ярлыки на главном экране."</string>
|
<string name="permdesc_write_settings">"Позволяет приложению изменять настройки и ярлыки на главном экране."</string>
|
||||||
<string name="search_hint">"Поиск Google"</string>
|
<string name="search_hint">"Поиск Google"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"Проблема загрузки гаджета"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"文件夹"</string>
|
<string name="group_folder">"文件夹"</string>
|
||||||
<string name="group_live_folders">"活动的文件夹"</string>
|
<string name="group_live_folders">"活动的文件夹"</string>
|
||||||
<string name="group_widgets">"小工具"</string>
|
<string name="group_widgets">"小工具"</string>
|
||||||
|
<string name="group_gadgets">"小工具"</string>
|
||||||
<string name="group_wallpapers">"壁纸"</string>
|
<string name="group_wallpapers">"壁纸"</string>
|
||||||
<string name="add_folder">"文件夹"</string>
|
<string name="add_folder">"文件夹"</string>
|
||||||
<string name="add_clock">"时钟"</string>
|
<string name="add_clock">"时钟"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"写入“主页”设置和快捷键"</string>
|
<string name="permlab_write_settings">"写入“主页”设置和快捷键"</string>
|
||||||
<string name="permdesc_write_settings">"允许应用程序更改“主页”中的设置和快捷键。"</string>
|
<string name="permdesc_write_settings">"允许应用程序更改“主页”中的设置和快捷键。"</string>
|
||||||
<string name="search_hint">"Google 搜索"</string>
|
<string name="search_hint">"Google 搜索"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"载入小工具时出现问题"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="group_folder">"資料夾"</string>
|
<string name="group_folder">"資料夾"</string>
|
||||||
<string name="group_live_folders">"使用中的資料夾"</string>
|
<string name="group_live_folders">"使用中的資料夾"</string>
|
||||||
<string name="group_widgets">"Widget"</string>
|
<string name="group_widgets">"Widget"</string>
|
||||||
|
<string name="group_gadgets">"小工具"</string>
|
||||||
<string name="group_wallpapers">"桌布"</string>
|
<string name="group_wallpapers">"桌布"</string>
|
||||||
<string name="add_folder">"資料夾"</string>
|
<string name="add_folder">"資料夾"</string>
|
||||||
<string name="add_clock">"時鐘"</string>
|
<string name="add_clock">"時鐘"</string>
|
||||||
|
@ -54,6 +55,5 @@
|
||||||
<string name="permlab_write_settings">"寫入首頁設定和捷徑"</string>
|
<string name="permlab_write_settings">"寫入首頁設定和捷徑"</string>
|
||||||
<string name="permdesc_write_settings">"允許應用程式變更首頁中的設定和捷徑。"</string>
|
<string name="permdesc_write_settings">"允許應用程式變更首頁中的設定和捷徑。"</string>
|
||||||
<string name="search_hint">"Google 搜尋"</string>
|
<string name="search_hint">"Google 搜尋"</string>
|
||||||
<!-- no translation found for gadget_error_text (8359351016167075858) -->
|
<string name="gadget_error_text">"載入小工具時發生問題"</string>
|
||||||
<skip />
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -69,11 +69,4 @@
|
||||||
<attr name="direction" />
|
<attr name="direction" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<!-- AllAppsGridView specific attributes. These attributes are used to customize
|
|
||||||
the list of all apps in XML files. -->
|
|
||||||
<declare-styleable name="AllAppsGridView">
|
|
||||||
<!-- The background texture. -->
|
|
||||||
<attr name="texture" format="reference" />
|
|
||||||
</declare-styleable>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -58,8 +58,10 @@
|
||||||
<string name="group_folder">Folder</string>
|
<string name="group_folder">Folder</string>
|
||||||
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all live folders -->
|
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all live folders -->
|
||||||
<string name="group_live_folders">Live folder</string>
|
<string name="group_live_folders">Live folder</string>
|
||||||
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all widgets/gadgets -->
|
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all widgets -->
|
||||||
<string name="group_widgets">Widget</string>
|
<string name="group_widgets">Widget</string>
|
||||||
|
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all gadgets -->
|
||||||
|
<string name="group_gadgets">Gadget</string>
|
||||||
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of apps that can set the wallpaper-->
|
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of apps that can set the wallpaper-->
|
||||||
<string name="group_wallpapers">Wallpaper</string>
|
<string name="group_wallpapers">Wallpaper</string>
|
||||||
<!-- Options in "Add to Home" dialog box; Name of the Folder widget-->
|
<!-- Options in "Add to Home" dialog box; Name of the Folder widget-->
|
||||||
|
@ -113,6 +115,6 @@
|
||||||
<string name="search_hint">Google Search</string>
|
<string name="search_hint">Google Search</string>
|
||||||
|
|
||||||
<!-- Text to show user in place of a gadget when we can't display it properly -->
|
<!-- 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>
|
<string name="gadget_error_text">Problem loading gadget</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class AddAdapter extends BaseAdapter {
|
||||||
mItems.add(new ListItem(res, R.string.group_search,
|
mItems.add(new ListItem(res, R.string.group_search,
|
||||||
R.drawable.ic_search_gadget, ITEM_SEARCH));
|
R.drawable.ic_search_gadget, ITEM_SEARCH));
|
||||||
|
|
||||||
mItems.add(new ListItem(res, R.string.group_widgets,
|
mItems.add(new ListItem(res, R.string.group_gadgets,
|
||||||
R.drawable.ic_launcher_gadget, ITEM_GADGET));
|
R.drawable.ic_launcher_gadget, ITEM_GADGET));
|
||||||
|
|
||||||
mItems.add(new ListItem(res, R.string.group_live_folders,
|
mItems.add(new ListItem(res, R.string.group_live_folders,
|
||||||
|
|
|
@ -19,46 +19,25 @@ package com.android.launcher;
|
||||||
import android.widget.GridView;
|
import android.widget.GridView;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
|
|
||||||
public class AllAppsGridView extends GridView implements AdapterView.OnItemClickListener,
|
public class AllAppsGridView extends GridView implements AdapterView.OnItemClickListener,
|
||||||
AdapterView.OnItemLongClickListener, DragSource {
|
AdapterView.OnItemLongClickListener, DragSource {
|
||||||
|
|
||||||
private DragController mDragger;
|
private DragController mDragger;
|
||||||
private Launcher mLauncher;
|
private Launcher mLauncher;
|
||||||
private Bitmap mTexture;
|
|
||||||
private Paint mPaint;
|
|
||||||
private int mTextureWidth;
|
|
||||||
private int mTextureHeight;
|
|
||||||
|
|
||||||
public AllAppsGridView(Context context) {
|
public AllAppsGridView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AllAppsGridView(Context context, AttributeSet attrs) {
|
public AllAppsGridView(Context context, AttributeSet attrs) {
|
||||||
this(context, attrs, com.android.internal.R.attr.gridViewStyle);
|
super(context, attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AllAppsGridView(Context context, AttributeSet attrs, int defStyle) {
|
public AllAppsGridView(Context context, AttributeSet attrs, int defStyle) {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
|
|
||||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AllAppsGridView, defStyle, 0);
|
|
||||||
final int textureId = a.getResourceId(R.styleable.AllAppsGridView_texture, 0);
|
|
||||||
if (textureId != 0) {
|
|
||||||
mTexture = BitmapFactory.decodeResource(getResources(), textureId);
|
|
||||||
mTextureWidth = mTexture.getWidth();
|
|
||||||
mTextureHeight = mTexture.getHeight();
|
|
||||||
|
|
||||||
mPaint = new Paint();
|
|
||||||
mPaint.setDither(false);
|
|
||||||
}
|
|
||||||
a.recycle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -67,32 +46,6 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
|
||||||
setOnItemLongClickListener(this);
|
setOnItemLongClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(Canvas canvas) {
|
|
||||||
final Bitmap texture = mTexture;
|
|
||||||
final Paint paint = mPaint;
|
|
||||||
|
|
||||||
final int width = getWidth();
|
|
||||||
final int height = getHeight();
|
|
||||||
|
|
||||||
final int textureWidth = mTextureWidth;
|
|
||||||
final int textureHeight = mTextureHeight;
|
|
||||||
|
|
||||||
int x = 0;
|
|
||||||
int y;
|
|
||||||
|
|
||||||
while (x < width) {
|
|
||||||
y = 0;
|
|
||||||
while (y < height) {
|
|
||||||
canvas.drawBitmap(texture, x, y, paint);
|
|
||||||
y += textureHeight;
|
|
||||||
}
|
|
||||||
x += textureWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.draw(canvas);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onItemClick(AdapterView parent, View v, int position, long id) {
|
public void onItemClick(AdapterView parent, View v, int position, long id) {
|
||||||
ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
|
ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
|
||||||
mLauncher.startActivitySafely(app.intent);
|
mLauncher.startActivitySafely(app.intent);
|
||||||
|
|
|
@ -85,11 +85,7 @@ public class DeleteZone extends ImageView implements DropTarget, DragController.
|
||||||
|
|
||||||
final LauncherModel model = Launcher.getModel();
|
final LauncherModel model = Launcher.getModel();
|
||||||
if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
|
if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
|
||||||
if (item instanceof LauncherGadgetInfo) {
|
model.removeDesktopItem(item);
|
||||||
model.removeDesktopGadget((LauncherGadgetInfo) item);
|
|
||||||
} else {
|
|
||||||
model.removeDesktopItem(item);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (source instanceof UserFolder) {
|
if (source instanceof UserFolder) {
|
||||||
final UserFolder userFolder = (UserFolder) source;
|
final UserFolder userFolder = (UserFolder) source;
|
||||||
|
|
|
@ -32,7 +32,6 @@ import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,8 +127,6 @@ public class DragLayer extends FrameLayout implements DragController {
|
||||||
private int mAnimationType;
|
private int mAnimationType;
|
||||||
private int mAnimationState = ANIMATION_STATE_DONE;
|
private int mAnimationState = ANIMATION_STATE_DONE;
|
||||||
|
|
||||||
private InputMethodManager mInputMethodManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to create a new DragLayer from XML.
|
* Used to create a new DragLayer from XML.
|
||||||
*
|
*
|
||||||
|
@ -147,14 +144,7 @@ public class DragLayer extends FrameLayout implements DragController {
|
||||||
if (PROFILE_DRAWING_DURING_DRAG) {
|
if (PROFILE_DRAWING_DURING_DRAG) {
|
||||||
android.os.Debug.startMethodTracing("Launcher");
|
android.os.Debug.startMethodTracing("Launcher");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide soft keyboard, if visible
|
|
||||||
if (mInputMethodManager == null) {
|
|
||||||
mInputMethodManager = (InputMethodManager)
|
|
||||||
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
||||||
}
|
|
||||||
mInputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0);
|
|
||||||
|
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.onDragStart(v, source, dragInfo, dragAction);
|
mListener.onDragStart(v, source, dragInfo, dragAction);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ import android.database.ContentObserver;
|
||||||
import android.gadget.GadgetProviderInfo;
|
import android.gadget.GadgetProviderInfo;
|
||||||
import android.gadget.GadgetManager;
|
import android.gadget.GadgetManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.graphics.drawable.TransitionDrawable;
|
import android.graphics.drawable.TransitionDrawable;
|
||||||
|
@ -87,7 +86,6 @@ import java.util.ArrayList;
|
||||||
*/
|
*/
|
||||||
public final class Launcher extends Activity implements View.OnClickListener, OnLongClickListener {
|
public final class Launcher extends Activity implements View.OnClickListener, OnLongClickListener {
|
||||||
static final String LOG_TAG = "Launcher";
|
static final String LOG_TAG = "Launcher";
|
||||||
static final boolean LOGD = false;
|
|
||||||
|
|
||||||
private static final boolean PROFILE_STARTUP = false;
|
private static final boolean PROFILE_STARTUP = false;
|
||||||
private static final boolean DEBUG_USER_INTERFACE = false;
|
private static final boolean DEBUG_USER_INTERFACE = false;
|
||||||
|
@ -171,7 +169,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
private GadgetManager mGadgetManager;
|
private GadgetManager mGadgetManager;
|
||||||
private LauncherGadgetHost mGadgetHost;
|
private LauncherGadgetHost mGadgetHost;
|
||||||
|
|
||||||
static final int GADGET_HOST_ID = 1024;
|
private static final int GADGET_HOST_ID = 1024;
|
||||||
|
|
||||||
private CellLayout.CellInfo mAddItemCellInfo;
|
private CellLayout.CellInfo mAddItemCellInfo;
|
||||||
private CellLayout.CellInfo mMenuAddInfo;
|
private CellLayout.CellInfo mMenuAddInfo;
|
||||||
|
@ -193,8 +191,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
private boolean mWaitingForResult;
|
private boolean mWaitingForResult;
|
||||||
private boolean mLocaleChanged;
|
private boolean mLocaleChanged;
|
||||||
|
|
||||||
private Bundle mSavedInstanceState;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -205,6 +201,8 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
mGadgetHost = new LauncherGadgetHost(this, GADGET_HOST_ID);
|
mGadgetHost = new LauncherGadgetHost(this, GADGET_HOST_ID);
|
||||||
mGadgetHost.startListening();
|
mGadgetHost.startListening();
|
||||||
|
|
||||||
|
// TODO: figure out if this is first launch and correctly clear GadgetHost database
|
||||||
|
|
||||||
if (PROFILE_STARTUP) {
|
if (PROFILE_STARTUP) {
|
||||||
android.os.Debug.startMethodTracing("/sdcard/launcher");
|
android.os.Debug.startMethodTracing("/sdcard/launcher");
|
||||||
}
|
}
|
||||||
|
@ -357,11 +355,15 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
}
|
}
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean acceptFilter() {
|
private boolean acceptFilter() {
|
||||||
|
final Configuration configuration = getResources().getConfiguration();
|
||||||
|
final boolean keyboardShowing = configuration.keyboardHidden !=
|
||||||
|
Configuration.KEYBOARDHIDDEN_YES;
|
||||||
|
final boolean hasKeyboard = configuration.keyboard != Configuration.KEYBOARD_NOKEYS;
|
||||||
final InputMethodManager inputManager = (InputMethodManager)
|
final InputMethodManager inputManager = (InputMethodManager)
|
||||||
getSystemService(Context.INPUT_METHOD_SERVICE);
|
getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
return !inputManager.isFullscreenMode();
|
return (hasKeyboard && keyboardShowing) ||
|
||||||
|
(!hasKeyboard && !inputManager.isFullscreenMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -631,7 +633,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
mWorkspace.getCurrentScreen(), xy[0], xy[1], false);
|
mWorkspace.getCurrentScreen(), xy[0], xy[1], false);
|
||||||
|
|
||||||
if (!mRestoring) {
|
if (!mRestoring) {
|
||||||
sModel.addDesktopGadget(launcherInfo);
|
sModel.addDesktopItem(launcherInfo);
|
||||||
|
|
||||||
// Perform actual inflation because we're live
|
// Perform actual inflation because we're live
|
||||||
launcherInfo.hostView = mGadgetHost.createView(this, gadgetId, gadgetInfo);
|
launcherInfo.hostView = mGadgetHost.createView(this, gadgetId, gadgetInfo);
|
||||||
|
@ -642,7 +644,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
mWorkspace.addInCurrentScreen(launcherInfo.hostView, xy[0], xy[1],
|
mWorkspace.addInCurrentScreen(launcherInfo.hostView, xy[0], xy[1],
|
||||||
launcherInfo.spanX, launcherInfo.spanY, insertAtFirst);
|
launcherInfo.spanX, launcherInfo.spanY, insertAtFirst);
|
||||||
} else if (sModel.isDesktopLoaded()) {
|
} else if (sModel.isDesktopLoaded()) {
|
||||||
sModel.addDesktopGadget(launcherInfo);
|
sModel.addDesktopItem(launcherInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,12 +745,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
|
||||||
// Do not call super here
|
|
||||||
mSavedInstanceState = savedInstanceState;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getCurrentScreen());
|
outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getCurrentScreen());
|
||||||
|
@ -797,11 +793,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
|
||||||
try {
|
mGadgetHost.stopListening();
|
||||||
mGadgetHost.stopListening();
|
|
||||||
} catch (NullPointerException ex) {
|
|
||||||
Log.w(LOG_TAG, "problem while stopping GadgetHost during Launcher destruction", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextKeyListener.getInstance().release();
|
TextKeyListener.getInstance().release();
|
||||||
|
|
||||||
|
@ -1164,8 +1156,8 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
void onDesktopItemsLoaded() {
|
void onDesktopItemsLoaded() {
|
||||||
if (mDestroyed) return;
|
if (mDestroyed) return;
|
||||||
|
|
||||||
mAllAppsGrid.setAdapter(Launcher.getModel().getApplicationsAdapter());
|
|
||||||
bindDesktopItems();
|
bindDesktopItems();
|
||||||
|
mAllAppsGrid.setAdapter(Launcher.getModel().getApplicationsAdapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1173,8 +1165,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
*/
|
*/
|
||||||
private void bindDesktopItems() {
|
private void bindDesktopItems() {
|
||||||
final ArrayList<ItemInfo> shortcuts = sModel.getDesktopItems();
|
final ArrayList<ItemInfo> shortcuts = sModel.getDesktopItems();
|
||||||
final ArrayList<LauncherGadgetInfo> gadgets = sModel.getDesktopGadgets();
|
if (shortcuts == null) {
|
||||||
if (shortcuts == null || gadgets == null) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1196,17 +1187,19 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
final DesktopBinder binder = new DesktopBinder(this, shortcuts, gadgets);
|
count = shortcuts.size();
|
||||||
binder.startBindingItems();
|
|
||||||
|
final DesktopItemsBinder binder = new DesktopItemsBinder(this, shortcuts);
|
||||||
|
binder.obtainMessage(DesktopItemsBinder.MESSAGE_BIND_ITEMS, 0, count).sendToTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindItems(Launcher.DesktopBinder binder,
|
private void bindItems(Launcher.DesktopItemsBinder binder,
|
||||||
ArrayList<ItemInfo> shortcuts, int start, int count) {
|
ArrayList<ItemInfo> shortcuts, int start, int count) {
|
||||||
|
|
||||||
final Workspace workspace = mWorkspace;
|
final Workspace workspace = mWorkspace;
|
||||||
final boolean desktopLocked = mDesktopLocked;
|
final boolean desktopLocked = mDesktopLocked;
|
||||||
|
|
||||||
final int end = Math.min(start + DesktopBinder.ITEMS_COUNT, count);
|
final int end = Math.min(start + DesktopItemsBinder.ITEMS_COUNT, count);
|
||||||
int i = start;
|
int i = start;
|
||||||
|
|
||||||
for ( ; i < end; i++) {
|
for ( ; i < end; i++) {
|
||||||
|
@ -1233,6 +1226,21 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
workspace.addInScreen(newLiveFolder, item.screen, item.cellX, item.cellY, 1, 1,
|
workspace.addInScreen(newLiveFolder, item.screen, item.cellX, item.cellY, 1, 1,
|
||||||
!desktopLocked);
|
!desktopLocked);
|
||||||
break;
|
break;
|
||||||
|
case LauncherSettings.Favorites.ITEM_TYPE_GADGET:
|
||||||
|
final LauncherGadgetInfo launcherInfo = (LauncherGadgetInfo) item;
|
||||||
|
|
||||||
|
final int gadgetId = launcherInfo.gadgetId;
|
||||||
|
GadgetProviderInfo gadgetInfo = mGadgetManager.getGadgetInfo(gadgetId);
|
||||||
|
launcherInfo.hostView = mGadgetHost.createView(this, gadgetId, gadgetInfo);
|
||||||
|
|
||||||
|
Log.d(LOG_TAG, "about to setGadget for id="+gadgetId+", info="+gadgetInfo);
|
||||||
|
launcherInfo.hostView.setGadget(gadgetId, gadgetInfo);
|
||||||
|
launcherInfo.hostView.setTag(launcherInfo);
|
||||||
|
|
||||||
|
workspace.addInScreen(launcherInfo.hostView, item.screen, item.cellX,
|
||||||
|
item.cellY, item.spanX, item.spanY, !desktopLocked);
|
||||||
|
|
||||||
|
break;
|
||||||
case LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH:
|
case LauncherSettings.Favorites.ITEM_TYPE_WIDGET_SEARCH:
|
||||||
final int screen = workspace.getCurrentScreen();
|
final int screen = workspace.getCurrentScreen();
|
||||||
final View view = mInflater.inflate(R.layout.widget_search,
|
final View view = mInflater.inflate(R.layout.widget_search,
|
||||||
|
@ -1250,17 +1258,14 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
|
|
||||||
if (end >= count) {
|
if (end >= count) {
|
||||||
finishBindDesktopItems();
|
finishBindDesktopItems();
|
||||||
binder.startBindingGadgets();
|
|
||||||
} else {
|
} else {
|
||||||
binder.obtainMessage(DesktopBinder.MESSAGE_BIND_ITEMS, i, count).sendToTarget();
|
binder.obtainMessage(DesktopItemsBinder.MESSAGE_BIND_ITEMS, i, count).sendToTarget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void finishBindDesktopItems() {
|
private void finishBindDesktopItems() {
|
||||||
if (mSavedState != null) {
|
if (mSavedState != null) {
|
||||||
if (!mWorkspace.hasFocus()) {
|
mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();
|
||||||
mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
final long[] userFolders = mSavedState.getLongArray(RUNTIME_STATE_USER_FOLDERS);
|
final long[] userFolders = mSavedState.getLongArray(RUNTIME_STATE_USER_FOLDERS);
|
||||||
if (userFolders != null) {
|
if (userFolders != null) {
|
||||||
|
@ -1273,67 +1278,24 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
final Folder openFolder = mWorkspace.getOpenFolder();
|
final Folder openFolder = mWorkspace.getOpenFolder();
|
||||||
if (openFolder != null) {
|
if (openFolder != null) {
|
||||||
openFolder.requestFocus();
|
openFolder.requestFocus();
|
||||||
|
} else {
|
||||||
|
mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean allApps = mSavedState.getBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, false);
|
final boolean allApps = mSavedState.getBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, false);
|
||||||
if (allApps) {
|
if (allApps) {
|
||||||
mDrawer.open();
|
mDrawer.open();
|
||||||
|
mDrawer.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
mSavedState = null;
|
mSavedState = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSavedInstanceState != null) {
|
|
||||||
super.onRestoreInstanceState(mSavedInstanceState);
|
|
||||||
mSavedInstanceState = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mDrawer.isOpened() && !mDrawer.hasFocus()) {
|
|
||||||
mDrawer.requestFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
mDesktopLocked = false;
|
mDesktopLocked = false;
|
||||||
mDrawer.unlock();
|
mDrawer.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindGadgets(Launcher.DesktopBinder binder,
|
|
||||||
ArrayList<LauncherGadgetInfo> gadgets, int start, int count) {
|
|
||||||
|
|
||||||
final Workspace workspace = mWorkspace;
|
|
||||||
final boolean desktopLocked = mDesktopLocked;
|
|
||||||
|
|
||||||
final int end = Math.min(start + DesktopBinder.GADGETS_COUNT, count);
|
|
||||||
int i = start;
|
|
||||||
|
|
||||||
for ( ; i < end; i++) {
|
|
||||||
final LauncherGadgetInfo item = gadgets.get(i);
|
|
||||||
|
|
||||||
final int gadgetId = item.gadgetId;
|
|
||||||
final GadgetProviderInfo gadgetInfo = mGadgetManager.getGadgetInfo(gadgetId);
|
|
||||||
item.hostView = mGadgetHost.createView(this, gadgetId, gadgetInfo);
|
|
||||||
|
|
||||||
if (LOGD) Log.d(LOG_TAG, String.format("about to setGadget for id=%d, info=%s", gadgetId, gadgetInfo));
|
|
||||||
|
|
||||||
item.hostView.setGadget(gadgetId, gadgetInfo);
|
|
||||||
item.hostView.setTag(item);
|
|
||||||
|
|
||||||
workspace.addInScreen(item.hostView, item.screen, item.cellX,
|
|
||||||
item.cellY, item.spanX, item.spanY, !desktopLocked);
|
|
||||||
}
|
|
||||||
|
|
||||||
workspace.requestLayout();
|
|
||||||
|
|
||||||
if (end >= count) {
|
|
||||||
finishBindDesktopGadgets();
|
|
||||||
} else {
|
|
||||||
binder.obtainMessage(DesktopBinder.MESSAGE_BIND_GADGETS, i, count).sendToTarget();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void finishBindDesktopGadgets() {
|
|
||||||
}
|
|
||||||
|
|
||||||
DragController getDragController() {
|
DragController getDragController() {
|
||||||
return mDragLayer;
|
return mDragLayer;
|
||||||
}
|
}
|
||||||
|
@ -1457,7 +1419,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
|
|
||||||
// This happens when long clicking an item with the dpad/trackball
|
// This happens when long clicking an item with the dpad/trackball
|
||||||
if (cellInfo == null) {
|
if (cellInfo == null) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWorkspace.allowLongPress()) {
|
if (mWorkspace.allowLongPress()) {
|
||||||
|
@ -1488,10 +1450,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
return !mDrawer.isMoving() && !mDrawer.isOpened();
|
return !mDrawer.isMoving() && !mDrawer.isOpened();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isDrawerUp() {
|
|
||||||
return mDrawer.isOpened() && !mDrawer.isMoving();
|
|
||||||
}
|
|
||||||
|
|
||||||
Workspace getWorkspace() {
|
Workspace getWorkspace() {
|
||||||
return mWorkspace;
|
return mWorkspace;
|
||||||
}
|
}
|
||||||
|
@ -1808,16 +1766,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
public void onDrawerOpened() {
|
public void onDrawerOpened() {
|
||||||
if (!mOpen) {
|
if (!mOpen) {
|
||||||
mHandleIcon.reverseTransition(150);
|
mHandleIcon.reverseTransition(150);
|
||||||
final Rect bounds = mWorkspace.mDrawerBounds;
|
|
||||||
|
|
||||||
View view = mAllAppsGrid;
|
|
||||||
view.getDrawingRect(bounds);
|
|
||||||
|
|
||||||
while (view != mDragLayer) {
|
|
||||||
bounds.offset(view.getLeft(), view.getTop());
|
|
||||||
view = (View) view.getParent();
|
|
||||||
}
|
|
||||||
|
|
||||||
mOpen = true;
|
mOpen = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1825,63 +1773,41 @@ public final class Launcher extends Activity implements View.OnClickListener, On
|
||||||
public void onDrawerClosed() {
|
public void onDrawerClosed() {
|
||||||
if (mOpen) {
|
if (mOpen) {
|
||||||
mHandleIcon.reverseTransition(150);
|
mHandleIcon.reverseTransition(150);
|
||||||
mWorkspace.mDrawerBounds.setEmpty();
|
|
||||||
mOpen = false;
|
mOpen = false;
|
||||||
}
|
}
|
||||||
mAllAppsGrid.setSelection(0);
|
mAllAppsGrid.setSelection(0);
|
||||||
mAllAppsGrid.clearTextFilter();
|
mAllAppsGrid.clearTextFilter();
|
||||||
|
mWorkspace.clearChildrenCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScrollStarted() {
|
public void onScrollStarted() {
|
||||||
|
mWorkspace.enableChildrenCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScrollEnded() {
|
public void onScrollEnded() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DesktopBinder extends Handler {
|
private static class DesktopItemsBinder extends Handler {
|
||||||
static final int MESSAGE_BIND_ITEMS = 0x1;
|
static final int MESSAGE_BIND_ITEMS = 0x1;
|
||||||
static final int MESSAGE_BIND_GADGETS = 0x2;
|
|
||||||
// Number of items to bind in every pass
|
// Number of items to bind in every pass
|
||||||
static final int ITEMS_COUNT = 6;
|
static final int ITEMS_COUNT = 6;
|
||||||
static final int GADGETS_COUNT = 1;
|
|
||||||
|
|
||||||
private final ArrayList<ItemInfo> mShortcuts;
|
private final ArrayList<ItemInfo> mShortcuts;
|
||||||
private final ArrayList<LauncherGadgetInfo> mGadgets;
|
|
||||||
private final WeakReference<Launcher> mLauncher;
|
private final WeakReference<Launcher> mLauncher;
|
||||||
|
|
||||||
DesktopBinder(Launcher launcher, ArrayList<ItemInfo> shortcuts,
|
DesktopItemsBinder(Launcher launcher, ArrayList<ItemInfo> shortcuts) {
|
||||||
ArrayList<LauncherGadgetInfo> gadgets) {
|
|
||||||
|
|
||||||
mLauncher = new WeakReference<Launcher>(launcher);
|
mLauncher = new WeakReference<Launcher>(launcher);
|
||||||
mShortcuts = shortcuts;
|
mShortcuts = shortcuts;
|
||||||
mGadgets = gadgets;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void startBindingItems() {
|
|
||||||
obtainMessage(MESSAGE_BIND_ITEMS, 0, mShortcuts.size()).sendToTarget();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startBindingGadgets() {
|
|
||||||
obtainMessage(MESSAGE_BIND_GADGETS, 0, mGadgets.size()).sendToTarget();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
Launcher launcher = mLauncher.get();
|
|
||||||
if (launcher == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case MESSAGE_BIND_ITEMS: {
|
case MESSAGE_BIND_ITEMS:
|
||||||
launcher.bindItems(this, mShortcuts, msg.arg1, msg.arg2);
|
Launcher launcher = mLauncher.get();
|
||||||
|
if (launcher != null) launcher.bindItems(this, mShortcuts, msg.arg1, msg.arg2);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case MESSAGE_BIND_GADGETS: {
|
|
||||||
launcher.bindGadgets(this, mGadgets, msg.arg1, msg.arg2);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,13 +58,13 @@ public class LauncherGadgetHostView extends GadgetHostView {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP: {
|
||||||
case MotionEvent.ACTION_CANCEL:
|
|
||||||
mHasPerformedLongPress = false;
|
mHasPerformedLongPress = false;
|
||||||
if (mPendingCheckForLongPress != null) {
|
if (mPendingCheckForLongPress != null) {
|
||||||
removeCallbacks(mPendingCheckForLongPress);
|
removeCallbacks(mPendingCheckForLongPress);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise continue letting touch events fall through to children
|
// Otherwise continue letting touch events fall through to children
|
||||||
|
|
|
@ -57,7 +57,6 @@ public class LauncherModel {
|
||||||
private boolean mDesktopItemsLoaded;
|
private boolean mDesktopItemsLoaded;
|
||||||
|
|
||||||
private ArrayList<ItemInfo> mDesktopItems;
|
private ArrayList<ItemInfo> mDesktopItems;
|
||||||
private ArrayList<LauncherGadgetInfo> mDesktopGadgets;
|
|
||||||
private HashMap<Long, FolderInfo> mFolders;
|
private HashMap<Long, FolderInfo> mFolders;
|
||||||
|
|
||||||
private ArrayList<ApplicationInfo> mApplications;
|
private ArrayList<ApplicationInfo> mApplications;
|
||||||
|
@ -203,7 +202,6 @@ public class LauncherModel {
|
||||||
final ApplicationsAdapter applicationList = mApplicationList;
|
final ApplicationsAdapter applicationList = mApplicationList;
|
||||||
final int count = buffer.size();
|
final int count = buffer.size();
|
||||||
|
|
||||||
applicationList.setNotifyOnChange(false);
|
|
||||||
applicationList.clear();
|
applicationList.clear();
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
applicationList.setNotifyOnChange(false);
|
applicationList.setNotifyOnChange(false);
|
||||||
|
@ -224,7 +222,7 @@ public class LauncherModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isDesktopLoaded() {
|
boolean isDesktopLoaded() {
|
||||||
return mDesktopItems != null && mDesktopGadgets != null && mDesktopItemsLoaded;
|
return mDesktopItems != null && mDesktopItemsLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -234,7 +232,7 @@ public class LauncherModel {
|
||||||
void loadUserItems(boolean isLaunching, Launcher launcher, boolean localeChanged,
|
void loadUserItems(boolean isLaunching, Launcher launcher, boolean localeChanged,
|
||||||
boolean loadApplications) {
|
boolean loadApplications) {
|
||||||
|
|
||||||
if (isLaunching && isDesktopLoaded()) {
|
if (isLaunching && mDesktopItems != null && mDesktopItemsLoaded) {
|
||||||
if (loadApplications) startApplicationsLoader(launcher);
|
if (loadApplications) startApplicationsLoader(launcher);
|
||||||
// We have already loaded our data from the DB
|
// We have already loaded our data from the DB
|
||||||
launcher.onDesktopItemsLoaded();
|
launcher.onDesktopItemsLoaded();
|
||||||
|
@ -360,11 +358,9 @@ public class LauncherModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
mDesktopItems = new ArrayList<ItemInfo>();
|
mDesktopItems = new ArrayList<ItemInfo>();
|
||||||
mDesktopGadgets = new ArrayList<LauncherGadgetInfo>();
|
|
||||||
mFolders = new HashMap<Long, FolderInfo>();
|
mFolders = new HashMap<Long, FolderInfo>();
|
||||||
|
|
||||||
final ArrayList<ItemInfo> desktopItems = mDesktopItems;
|
final ArrayList<ItemInfo> desktopItems = mDesktopItems;
|
||||||
final ArrayList<LauncherGadgetInfo> desktopGadgets = mDesktopGadgets;
|
|
||||||
|
|
||||||
final Cursor c = contentResolver.query(
|
final Cursor c = contentResolver.query(
|
||||||
LauncherSettings.Favorites.CONTENT_URI, null, null, null, null);
|
LauncherSettings.Favorites.CONTENT_URI, null, null, null, null);
|
||||||
|
@ -390,8 +386,8 @@ public class LauncherModel {
|
||||||
|
|
||||||
ApplicationInfo info;
|
ApplicationInfo info;
|
||||||
String intentDescription;
|
String intentDescription;
|
||||||
Widget widgetInfo;
|
Widget widgetInfo = null;
|
||||||
LauncherGadgetInfo gadgetInfo;
|
LauncherGadgetInfo gadgetInfo = null;
|
||||||
int container;
|
int container;
|
||||||
long id;
|
long id;
|
||||||
Intent intent;
|
Intent intent;
|
||||||
|
@ -540,7 +536,7 @@ public class LauncherModel {
|
||||||
}
|
}
|
||||||
gadgetInfo.container = c.getInt(containerIndex);
|
gadgetInfo.container = c.getInt(containerIndex);
|
||||||
|
|
||||||
desktopGadgets.add(gadgetInfo);
|
desktopItems.add(gadgetInfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -647,7 +643,6 @@ public class LauncherModel {
|
||||||
mApplicationsAdapter = null;
|
mApplicationsAdapter = null;
|
||||||
unbindAppDrawables(mApplications);
|
unbindAppDrawables(mApplications);
|
||||||
unbindDrawables(mDesktopItems);
|
unbindDrawables(mDesktopItems);
|
||||||
unbindGadgetHostViews(mDesktopGadgets);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -663,7 +658,6 @@ public class LauncherModel {
|
||||||
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
|
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
|
||||||
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
|
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
|
||||||
((ApplicationInfo)item).icon.setCallback(null);
|
((ApplicationInfo)item).icon.setCallback(null);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -682,19 +676,6 @@ public class LauncherModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove any {@link LauncherGadgetHostView} references in our gadgets.
|
|
||||||
*/
|
|
||||||
private void unbindGadgetHostViews(ArrayList<LauncherGadgetInfo> gadgets) {
|
|
||||||
if (gadgets != null) {
|
|
||||||
final int count = gadgets.size();
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
LauncherGadgetInfo launcherInfo = gadgets.get(i);
|
|
||||||
launcherInfo.hostView = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The current list of applications
|
* @return The current list of applications
|
||||||
*/
|
*/
|
||||||
|
@ -715,13 +696,6 @@ public class LauncherModel {
|
||||||
public ArrayList<ItemInfo> getDesktopItems() {
|
public ArrayList<ItemInfo> getDesktopItems() {
|
||||||
return mDesktopItems;
|
return mDesktopItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The current list of desktop items
|
|
||||||
*/
|
|
||||||
public ArrayList<LauncherGadgetInfo> getDesktopGadgets() {
|
|
||||||
return mDesktopGadgets;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an item to the desktop
|
* Add an item to the desktop
|
||||||
|
@ -741,20 +715,6 @@ public class LauncherModel {
|
||||||
mDesktopItems.remove(info);
|
mDesktopItems.remove(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a gadget to the desktop
|
|
||||||
*/
|
|
||||||
public void addDesktopGadget(LauncherGadgetInfo info) {
|
|
||||||
mDesktopGadgets.add(info);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove a gadget from the desktop
|
|
||||||
*/
|
|
||||||
public void removeDesktopGadget(LauncherGadgetInfo info) {
|
|
||||||
mDesktopGadgets.remove(info);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make an ApplicationInfo object for an application
|
* Make an ApplicationInfo object for an application
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -30,7 +30,6 @@ import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.database.sqlite.SQLiteQueryBuilder;
|
import android.database.sqlite.SQLiteQueryBuilder;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.SQLException;
|
import android.database.SQLException;
|
||||||
import android.gadget.GadgetHost;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -42,25 +41,19 @@ import java.io.FileReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
import com.android.internal.util.XmlUtils;
|
import com.android.internal.util.XmlUtils;
|
||||||
import com.android.launcher.LauncherSettings.Favorites;
|
|
||||||
|
|
||||||
public class LauncherProvider extends ContentProvider {
|
public class LauncherProvider extends ContentProvider {
|
||||||
private static final String LOG_TAG = "LauncherProvider";
|
private static final String LOG_TAG = "LauncherSettingsProvider";
|
||||||
private static final boolean LOGD = true;
|
|
||||||
|
|
||||||
private static final String DATABASE_NAME = "launcher.db";
|
private static final String DATABASE_NAME = "launcher.db";
|
||||||
|
|
||||||
private static final int DATABASE_VERSION = 2;
|
private static final int DATABASE_VERSION = 2;
|
||||||
|
|
||||||
static final String AUTHORITY = "com.android.launcher.settings";
|
static final String AUTHORITY = "com.android.launcher.settings";
|
||||||
|
|
||||||
static final String EXTRA_BIND_SOURCES = "com.android.launcher.settings.bindsources";
|
|
||||||
static final String EXTRA_BIND_TARGETS = "com.android.launcher.settings.bindtargets";
|
|
||||||
|
|
||||||
static final String TABLE_FAVORITES = "favorites";
|
static final String TABLE_FAVORITES = "favorites";
|
||||||
static final String PARAMETER_NOTIFY = "notify";
|
static final String PARAMETER_NOTIFY = "notify";
|
||||||
|
@ -177,18 +170,14 @@ public class LauncherProvider extends ContentProvider {
|
||||||
private static final String ATTRIBUTE_Y = "y";
|
private static final String ATTRIBUTE_Y = "y";
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final GadgetHost mGadgetHost;
|
|
||||||
|
|
||||||
DatabaseHelper(Context context) {
|
DatabaseHelper(Context context) {
|
||||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mGadgetHost = new GadgetHost(context, Launcher.GADGET_HOST_ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(SQLiteDatabase db) {
|
public void onCreate(SQLiteDatabase db) {
|
||||||
if (LOGD) Log.d(LOG_TAG, "creating new launcher database");
|
|
||||||
|
|
||||||
db.execSQL("CREATE TABLE favorites (" +
|
db.execSQL("CREATE TABLE favorites (" +
|
||||||
"_id INTEGER PRIMARY KEY," +
|
"_id INTEGER PRIMARY KEY," +
|
||||||
"title TEXT," +
|
"title TEXT," +
|
||||||
|
@ -210,11 +199,11 @@ public class LauncherProvider extends ContentProvider {
|
||||||
"displayMode INTEGER" +
|
"displayMode INTEGER" +
|
||||||
");");
|
");");
|
||||||
|
|
||||||
// Database was just created, so wipe any previous gadgets
|
// TODO: During first database creation, trigger wipe of any gadgets that
|
||||||
if (mGadgetHost != null) {
|
// might have been left around during a wipe-data.
|
||||||
mGadgetHost.deleteHost();
|
// GadgetManager gadgetManager = GadgetManager.getInstance(mContext);
|
||||||
}
|
|
||||||
|
|
||||||
if (!convertDatabase(db)) {
|
if (!convertDatabase(db)) {
|
||||||
// Populate favorites table with initial favorites
|
// Populate favorites table with initial favorites
|
||||||
loadFavorites(db, DEFAULT_FAVORITES_PATH);
|
loadFavorites(db, DEFAULT_FAVORITES_PATH);
|
||||||
|
@ -222,7 +211,6 @@ public class LauncherProvider extends ContentProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean convertDatabase(SQLiteDatabase db) {
|
private boolean convertDatabase(SQLiteDatabase db) {
|
||||||
if (LOGD) Log.d(LOG_TAG, "converting database from an older format, but not onUpgrade");
|
|
||||||
boolean converted = false;
|
boolean converted = false;
|
||||||
|
|
||||||
final Uri uri = Uri.parse("content://" + Settings.AUTHORITY +
|
final Uri uri = Uri.parse("content://" + Settings.AUTHORITY +
|
||||||
|
@ -248,12 +236,6 @@ public class LauncherProvider extends ContentProvider {
|
||||||
resolver.delete(uri, null, null);
|
resolver.delete(uri, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (converted) {
|
|
||||||
// Convert widgets from this import into gadgets
|
|
||||||
if (LOGD) Log.d(LOG_TAG, "converted and now triggering widget upgrade");
|
|
||||||
convertWidgets(db);
|
|
||||||
}
|
|
||||||
|
|
||||||
return converted;
|
return converted;
|
||||||
}
|
}
|
||||||
|
@ -317,16 +299,16 @@ public class LauncherProvider extends ContentProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
if (LOGD) Log.d(LOG_TAG, "onUpgrade triggered");
|
|
||||||
|
|
||||||
int version = oldVersion;
|
int version = oldVersion;
|
||||||
if (version == 1) {
|
if (version == 1) {
|
||||||
// upgrade 1 -> 2 added gadgetId column
|
// upgrade 1 -> 2 added gadgetId column
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
try {
|
try {
|
||||||
// Insert new column for holding gadgetIds
|
// TODO: convert any existing widgets for search and clock
|
||||||
|
// this might involve a FORCE_ADD_GADGET permission in GadgetManager that
|
||||||
|
// Launcher could then use to add these gadgets without user interaction
|
||||||
db.execSQL("ALTER TABLE favorites " +
|
db.execSQL("ALTER TABLE favorites " +
|
||||||
"ADD COLUMN gadgetId INTEGER NOT NULL DEFAULT -1;");
|
"ADD COLUMN gadgetId INTEGER NOT NULL DEFAULT -1;");
|
||||||
db.setTransactionSuccessful();
|
db.setTransactionSuccessful();
|
||||||
version = 2;
|
version = 2;
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
|
@ -335,11 +317,6 @@ public class LauncherProvider extends ContentProvider {
|
||||||
} finally {
|
} finally {
|
||||||
db.endTransaction();
|
db.endTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert existing widgets only if table upgrade was successful
|
|
||||||
if (version == 2) {
|
|
||||||
convertWidgets(db);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version != DATABASE_VERSION) {
|
if (version != DATABASE_VERSION) {
|
||||||
|
@ -348,99 +325,8 @@ public class LauncherProvider extends ContentProvider {
|
||||||
onCreate(db);
|
onCreate(db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Upgrade existing clock and photo frame widgets into their new gadget
|
|
||||||
* equivalents. This method allocates gadgetIds, and then hands off to
|
|
||||||
* LauncherGadgetBinder to finish the actual binding.
|
|
||||||
*/
|
|
||||||
private void convertWidgets(SQLiteDatabase db) {
|
|
||||||
final int[] bindSources = new int[] {
|
|
||||||
Favorites.ITEM_TYPE_WIDGET_CLOCK,
|
|
||||||
Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME,
|
|
||||||
};
|
|
||||||
|
|
||||||
final ArrayList<ComponentName> bindTargets = new ArrayList<ComponentName>();
|
|
||||||
bindTargets.add(new ComponentName("com.android.alarmclock",
|
|
||||||
"com.android.alarmclock.AnalogGadgetProvider"));
|
|
||||||
bindTargets.add(new ComponentName("com.android.camera",
|
|
||||||
"com.android.camera.PhotoGadgetProvider"));
|
|
||||||
|
|
||||||
final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE, bindSources);
|
|
||||||
|
|
||||||
Cursor c = null;
|
|
||||||
boolean allocatedGadgets = false;
|
|
||||||
|
|
||||||
db.beginTransaction();
|
|
||||||
try {
|
|
||||||
// Select and iterate through each matching widget
|
|
||||||
c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID },
|
|
||||||
selectWhere, null, null, null, null);
|
|
||||||
|
|
||||||
if (LOGD) Log.d(LOG_TAG, "found upgrade cursor count="+c.getCount());
|
|
||||||
|
|
||||||
final ContentValues values = new ContentValues();
|
|
||||||
while (c != null && c.moveToNext()) {
|
|
||||||
long favoriteId = c.getLong(0);
|
|
||||||
|
|
||||||
// Allocate and update database with new gadgetId
|
|
||||||
try {
|
|
||||||
int gadgetId = mGadgetHost.allocateGadgetId();
|
|
||||||
|
|
||||||
if (LOGD) Log.d(LOG_TAG, "allocated gadgetId="+gadgetId+" for favoriteId="+favoriteId);
|
|
||||||
|
|
||||||
values.clear();
|
|
||||||
values.put(LauncherSettings.Favorites.GADGET_ID, gadgetId);
|
|
||||||
|
|
||||||
// Original widgets might not have valid spans when upgrading
|
|
||||||
values.put(LauncherSettings.Favorites.SPANX, 2);
|
|
||||||
values.put(LauncherSettings.Favorites.SPANY, 2);
|
|
||||||
|
|
||||||
String updateWhere = Favorites._ID + "=" + favoriteId;
|
|
||||||
db.update(TABLE_FAVORITES, values, updateWhere, null);
|
|
||||||
|
|
||||||
allocatedGadgets = true;
|
|
||||||
} catch (RuntimeException ex) {
|
|
||||||
Log.e(LOG_TAG, "Problem allocating gadgetId", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
db.setTransactionSuccessful();
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
Log.w(LOG_TAG, "Problem while allocating gadgetIds for existing widgets", ex);
|
|
||||||
} finally {
|
|
||||||
db.endTransaction();
|
|
||||||
if (c != null) {
|
|
||||||
c.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If any gadgetIds allocated, then launch over to binder
|
|
||||||
if (allocatedGadgets) {
|
|
||||||
launchGadgetBinder(bindSources, bindTargets);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Launch the gadget binder that walks through the Launcher database,
|
|
||||||
* binding any matching widgets to the corresponding targets. We can't
|
|
||||||
* bind ourselves because our parent process can't obtain the
|
|
||||||
* BIND_GADGET permission.
|
|
||||||
*/
|
|
||||||
private void launchGadgetBinder(int[] bindSources, ArrayList<ComponentName> bindTargets) {
|
|
||||||
final Intent intent = new Intent();
|
|
||||||
intent.setComponent(new ComponentName("com.android.settings",
|
|
||||||
"com.android.settings.LauncherGadgetBinder"));
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
|
|
||||||
final Bundle extras = new Bundle();
|
|
||||||
extras.putIntArray(EXTRA_BIND_SOURCES, bindSources);
|
|
||||||
extras.putParcelableArrayList(EXTRA_BIND_TARGETS, bindTargets);
|
|
||||||
intent.putExtras(extras);
|
|
||||||
|
|
||||||
mContext.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the default set of favorite packages from an xml file.
|
* Loads the default set of favorite packages from an xml file.
|
||||||
*
|
*
|
||||||
|
@ -527,62 +413,13 @@ public class LauncherProvider extends ContentProvider {
|
||||||
values.put(LauncherSettings.Favorites.SPANY, 1);
|
values.put(LauncherSettings.Favorites.SPANY, 1);
|
||||||
db.insert(TABLE_FAVORITES, null, values);
|
db.insert(TABLE_FAVORITES, null, values);
|
||||||
|
|
||||||
final int[] bindSources = new int[] {
|
// TODO: automatically add clock and search gadget to
|
||||||
Favorites.ITEM_TYPE_WIDGET_CLOCK,
|
// default locations. this might need the FORCE permission mentioned above
|
||||||
};
|
|
||||||
|
|
||||||
final ArrayList<ComponentName> bindTargets = new ArrayList<ComponentName>();
|
|
||||||
bindTargets.add(new ComponentName("com.android.alarmclock",
|
|
||||||
"com.android.alarmclock.AnalogGadgetProvider"));
|
|
||||||
|
|
||||||
boolean allocatedGadgets = false;
|
|
||||||
|
|
||||||
// Try binding to an analog clock gadget
|
|
||||||
try {
|
|
||||||
int gadgetId = mGadgetHost.allocateGadgetId();
|
|
||||||
|
|
||||||
values.clear();
|
|
||||||
values.put(LauncherSettings.Favorites.CONTAINER,
|
|
||||||
LauncherSettings.Favorites.CONTAINER_DESKTOP);
|
|
||||||
values.put(LauncherSettings.Favorites.ITEM_TYPE,
|
|
||||||
LauncherSettings.Favorites.ITEM_TYPE_WIDGET_CLOCK);
|
|
||||||
values.put(LauncherSettings.Favorites.SCREEN, 1);
|
|
||||||
values.put(LauncherSettings.Favorites.CELLX, 1);
|
|
||||||
values.put(LauncherSettings.Favorites.CELLY, 0);
|
|
||||||
values.put(LauncherSettings.Favorites.SPANX, 2);
|
|
||||||
values.put(LauncherSettings.Favorites.SPANY, 2);
|
|
||||||
values.put(LauncherSettings.Favorites.GADGET_ID, gadgetId);
|
|
||||||
db.insert(TABLE_FAVORITES, null, values);
|
|
||||||
|
|
||||||
allocatedGadgets = true;
|
|
||||||
} catch (RuntimeException ex) {
|
|
||||||
Log.e(LOG_TAG, "Problem allocating gadgetId", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If any gadgetIds allocated, then launch over to binder
|
|
||||||
if (allocatedGadgets) {
|
|
||||||
launchGadgetBinder(bindSources, bindTargets);
|
|
||||||
}
|
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Build a query string that will match any row where the column matches
|
|
||||||
* anything in the values list.
|
|
||||||
*/
|
|
||||||
static String buildOrWhereString(String column, int[] values) {
|
|
||||||
StringBuilder selectWhere = new StringBuilder();
|
|
||||||
for (int i = values.length - 1; i >= 0; i--) {
|
|
||||||
selectWhere.append(column).append("=").append(values[i]);
|
|
||||||
if (i > 0) {
|
|
||||||
selectWhere.append(" OR ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return selectWhere.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
static class SqlArguments {
|
static class SqlArguments {
|
||||||
public final String table;
|
public final String table;
|
||||||
public final String where;
|
public final String where;
|
||||||
|
|
|
@ -24,8 +24,7 @@ import android.net.Uri;
|
||||||
*/
|
*/
|
||||||
class LauncherSettings {
|
class LauncherSettings {
|
||||||
/**
|
/**
|
||||||
* Favorites. When changing these values, be sure to update
|
* Favorites.
|
||||||
* {@link com.android.settings.LauncherGadgetBinder} as needed.
|
|
||||||
*/
|
*/
|
||||||
static final class Favorites implements BaseColumns {
|
static final class Favorites implements BaseColumns {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,14 +24,8 @@ import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.provider.LiveFolders;
|
import android.provider.LiveFolders;
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.database.Cursor;
|
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
|
|
||||||
public class LiveFolder extends Folder {
|
public class LiveFolder extends Folder {
|
||||||
private AsyncTask<LiveFolderInfo,Void,Cursor> mLoadingTask;
|
|
||||||
|
|
||||||
public LiveFolder(Context context, AttributeSet attrs) {
|
public LiveFolder(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
}
|
}
|
||||||
|
@ -72,10 +66,7 @@ public class LiveFolder extends Folder {
|
||||||
|
|
||||||
void bind(FolderInfo info) {
|
void bind(FolderInfo info) {
|
||||||
super.bind(info);
|
super.bind(info);
|
||||||
if (mLoadingTask != null && mLoadingTask.getStatus() == AsyncTask.Status.RUNNING) {
|
setContentAdapter(new LiveFolderAdapter(mLauncher, (LiveFolderInfo) info));
|
||||||
mLoadingTask.cancel(true);
|
|
||||||
}
|
|
||||||
mLoadingTask = new FolderLoadingTask(this).execute((LiveFolderInfo) info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,42 +78,6 @@ public class LiveFolder extends Folder {
|
||||||
@Override
|
@Override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
super.onClose();
|
super.onClose();
|
||||||
if (mLoadingTask != null && mLoadingTask.getStatus() == AsyncTask.Status.RUNNING) {
|
|
||||||
mLoadingTask.cancel(true);
|
|
||||||
}
|
|
||||||
((LiveFolderAdapter) mContent.getAdapter()).cleanup();
|
((LiveFolderAdapter) mContent.getAdapter()).cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
static class FolderLoadingTask extends AsyncTask<LiveFolderInfo, Void, Cursor> {
|
|
||||||
private final WeakReference<LiveFolder> mFolder;
|
|
||||||
private LiveFolderInfo mInfo;
|
|
||||||
|
|
||||||
FolderLoadingTask(LiveFolder folder) {
|
|
||||||
mFolder = new WeakReference<LiveFolder>(folder);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Cursor doInBackground(LiveFolderInfo... params) {
|
|
||||||
final LiveFolder folder = mFolder.get();
|
|
||||||
if (folder != null) {
|
|
||||||
mInfo = params[0];
|
|
||||||
return LiveFolderAdapter.query(folder.mLauncher, mInfo);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(Cursor cursor) {
|
|
||||||
if (!isCancelled()) {
|
|
||||||
if (cursor != null) {
|
|
||||||
final LiveFolder folder = mFolder.get();
|
|
||||||
if (folder != null) {
|
|
||||||
final Launcher launcher = folder.mLauncher;
|
|
||||||
folder.setContentAdapter(new LiveFolderAdapter(launcher, mInfo, cursor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (cursor != null) {
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,8 @@ class LiveFolderAdapter extends CursorAdapter {
|
||||||
new HashMap<Long, SoftReference<Drawable>>();
|
new HashMap<Long, SoftReference<Drawable>>();
|
||||||
private final Launcher mLauncher;
|
private final Launcher mLauncher;
|
||||||
|
|
||||||
LiveFolderAdapter(Launcher launcher, LiveFolderInfo info, Cursor cursor) {
|
LiveFolderAdapter(Launcher launcher, LiveFolderInfo info) {
|
||||||
super(launcher, cursor, true);
|
super(launcher, query(launcher, info), true);
|
||||||
mIsList = info.displayMode == LiveFolders.DISPLAY_MODE_LIST;
|
mIsList = info.displayMode == LiveFolders.DISPLAY_MODE_LIST;
|
||||||
mInflater = LayoutInflater.from(launcher);
|
mInflater = LayoutInflater.from(launcher);
|
||||||
mLauncher = launcher;
|
mLauncher = launcher;
|
||||||
|
@ -54,9 +54,8 @@ class LiveFolderAdapter extends CursorAdapter {
|
||||||
mLauncher.startManagingCursor(getCursor());
|
mLauncher.startManagingCursor(getCursor());
|
||||||
}
|
}
|
||||||
|
|
||||||
static Cursor query(Context context, LiveFolderInfo info) {
|
private static Cursor query(Context context, LiveFolderInfo info) {
|
||||||
return context.getContentResolver().query(info.uri, null, null,
|
return context.getContentResolver().query(info.uri, null, null, null, LiveFolders.NAME + " ASC");
|
||||||
null, LiveFolders.NAME + " ASC");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
||||||
|
|
|
@ -57,6 +57,8 @@ import android.widget.TextView;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
import android.widget.AdapterView.OnItemSelectedListener;
|
import android.widget.AdapterView.OnItemSelectedListener;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class Search extends LinearLayout implements OnClickListener, OnKeyListener,
|
public class Search extends LinearLayout implements OnClickListener, OnKeyListener,
|
||||||
OnLongClickListener, TextWatcher, OnItemClickListener, OnItemSelectedListener {
|
OnLongClickListener, TextWatcher, OnItemClickListener, OnItemSelectedListener {
|
||||||
|
|
||||||
|
@ -79,7 +81,6 @@ public class Search extends LinearLayout implements OnClickListener, OnKeyListen
|
||||||
private Intent mVoiceSearchIntent;
|
private Intent mVoiceSearchIntent;
|
||||||
|
|
||||||
private Rect mTempRect = new Rect();
|
private Rect mTempRect = new Rect();
|
||||||
private boolean mRestoreFocus = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to inflate the Workspace from XML.
|
* Used to inflate the Workspace from XML.
|
||||||
|
@ -169,26 +170,7 @@ public class Search extends LinearLayout implements OnClickListener, OnKeyListen
|
||||||
|
|
||||||
getContext().startActivity(launcher);
|
getContext().startActivity(launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onWindowFocusChanged(boolean hasWindowFocus) {
|
|
||||||
if (!hasWindowFocus && hasFocus()) {
|
|
||||||
mRestoreFocus = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onWindowFocusChanged(hasWindowFocus);
|
|
||||||
|
|
||||||
if (hasWindowFocus && mRestoreFocus) {
|
|
||||||
if (isInTouchMode()) {
|
|
||||||
final AutoCompleteTextView searchText = mSearchText;
|
|
||||||
searchText.setSelectAllOnFocus(false);
|
|
||||||
searchText.requestFocusFromTouch();
|
|
||||||
searchText.setSelectAllOnFocus(true);
|
|
||||||
}
|
|
||||||
mRestoreFocus = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements TextWatcher (for EditText)
|
* Implements TextWatcher (for EditText)
|
||||||
*/
|
*/
|
||||||
|
@ -388,18 +370,6 @@ public class Search extends LinearLayout implements OnClickListener, OnKeyListen
|
||||||
mSearchText.setAdapter(mSuggestionsAdapter);
|
mSearchText.setAdapter(mSuggestionsAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove internal cursor references when detaching from window which
|
|
||||||
* prevents {@link Context} leaks.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onDetachedFromWindow() {
|
|
||||||
if (mSuggestionsAdapter != null) {
|
|
||||||
mSuggestionsAdapter.changeCursor(null);
|
|
||||||
mSuggestionsAdapter = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements OnItemClickListener
|
* Implements OnItemClickListener
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,70 +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.launcher;
|
|
||||||
|
|
||||||
import android.widget.AutoCompleteTextView;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.app.Activity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class is not for the faint of heart. Home works in the pan & scan
|
|
||||||
* soft input mode. However, this mode gets rid of the soft keyboard on rotation,
|
|
||||||
* which is a probelm when the Search widget has focus. This special class
|
|
||||||
* changes Home's soft input method temporarily as long as the Search widget holds
|
|
||||||
* the focus. This way, the soft keyboard remains after rotation.
|
|
||||||
*/
|
|
||||||
public class SearchAutoCompleteTextView extends AutoCompleteTextView {
|
|
||||||
public SearchAutoCompleteTextView(Context context) {
|
|
||||||
super(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SearchAutoCompleteTextView(Context context, AttributeSet attrs) {
|
|
||||||
super(context, attrs);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SearchAutoCompleteTextView(Context context, AttributeSet attrs, int defStyle) {
|
|
||||||
super(context, attrs, defStyle);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
|
|
||||||
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
|
|
||||||
|
|
||||||
final WindowManager.LayoutParams lp = ((Activity) getContext()).getWindow().getAttributes();
|
|
||||||
if (gainFocus) {
|
|
||||||
lp.softInputMode =
|
|
||||||
(lp.softInputMode & ~WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE) |
|
|
||||||
WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED;
|
|
||||||
} else {
|
|
||||||
//noinspection PointlessBitwiseExpression
|
|
||||||
lp.softInputMode =
|
|
||||||
(lp.softInputMode & ~WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE) |
|
|
||||||
WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED;
|
|
||||||
|
|
||||||
// Hide the soft keyboard when the search widget loses the focus
|
|
||||||
InputMethodManager.peekInstance().hideSoftInputFromWindow(getWindowToken(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
final WindowManager manager = (WindowManager)
|
|
||||||
getContext().getSystemService(Context.WINDOW_SERVICE);
|
|
||||||
manager.updateViewLayout(getRootView(), lp);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -17,8 +17,6 @@
|
||||||
package com.android.launcher;
|
package com.android.launcher;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.ComponentName;
|
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
|
@ -93,9 +91,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
||||||
|
|
||||||
private int mTouchSlop;
|
private int mTouchSlop;
|
||||||
|
|
||||||
final Rect mDrawerBounds = new Rect();
|
|
||||||
final Rect mClipBounds = new Rect();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to inflate the Workspace from XML.
|
* Used to inflate the Workspace from XML.
|
||||||
*
|
*
|
||||||
|
@ -442,18 +437,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dispatchDraw(Canvas canvas) {
|
protected void dispatchDraw(Canvas canvas) {
|
||||||
// If the all apps drawer is open and the drawing region for the workspace
|
|
||||||
// is contained within the drawer's bounds, we skip the drawing. This requires
|
|
||||||
// the drawer to be fully opaque.
|
|
||||||
if (mLauncher.isDrawerUp()) {
|
|
||||||
final Rect clipBounds = mClipBounds;
|
|
||||||
canvas.getClipBounds(clipBounds);
|
|
||||||
clipBounds.offset(-mScrollX, -mScrollY);
|
|
||||||
if (mDrawerBounds.contains(clipBounds)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float x = mScrollX * mWallpaperOffset;
|
float x = mScrollX * mWallpaperOffset;
|
||||||
if (x + mWallpaperWidth < mRight - mLeft) {
|
if (x + mWallpaperWidth < mRight - mLeft) {
|
||||||
x = mRight - mLeft - mWallpaperWidth;
|
x = mRight - mLeft - mWallpaperWidth;
|
||||||
|
@ -690,7 +673,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
||||||
// Release the drag
|
// Release the drag
|
||||||
clearChildrenCache();
|
clearChildrenCache();
|
||||||
mTouchState = TOUCH_STATE_REST;
|
mTouchState = TOUCH_STATE_REST;
|
||||||
mAllowLongPress = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1170,13 +1152,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
||||||
Object tag = view.getTag();
|
Object tag = view.getTag();
|
||||||
if (tag instanceof ApplicationInfo) {
|
if (tag instanceof ApplicationInfo) {
|
||||||
ApplicationInfo info = (ApplicationInfo) tag;
|
ApplicationInfo info = (ApplicationInfo) tag;
|
||||||
// We need to check for ACTION_MAIN otherwise getComponent() might
|
if (packageName.equals(info.intent.getComponent().getPackageName())) {
|
||||||
// return null for some shortcuts (for instance, for shortcuts to
|
|
||||||
// web pages.)
|
|
||||||
final Intent intent = info.intent;
|
|
||||||
final ComponentName name = intent.getComponent();
|
|
||||||
if (Intent.ACTION_MAIN.equals(intent.getAction()) &&
|
|
||||||
name != null && packageName.equals(name.getPackageName())) {
|
|
||||||
model.removeDesktopItem(info);
|
model.removeDesktopItem(info);
|
||||||
LauncherModel.deleteItemFromDatabase(mLauncher, info);
|
LauncherModel.deleteItemFromDatabase(mLauncher, info);
|
||||||
childrenToRemove.add(view);
|
childrenToRemove.add(view);
|
||||||
|
|
Loading…
Reference in New Issue