android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
- android:theme="@style/Theme"
+ android:theme="@android:style/Theme.Wallpaper.NoTitleBar"
android:screenOrientation="nosensor"
android:windowSoftInputMode="stateUnspecified|adjustPan">
<intent-filter>
<activity
android:name="WallpaperChooser"
android:label="@string/pick_wallpaper"
- android:icon="@drawable/ic_launcher_gallery">
+ android:icon="@drawable/ic_launcher_wallpaper"
+ android:finishOnCloseSystemDialogs="true">
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
android:layout_height="fill_parent"
android:orientation="horizontal"
- android:bottomOffset="7dip"
+ android:bottomOffset="4dip"
android:handle="@+id/all_apps"
android:content="@+id/content">
android:orientation="vertical">
<Button
- android:id="@+id/close"
+ android:id="@+id/folder_close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:layout_height="wrap_content" />
<GridView
- android:id="@id/content"
+ android:id="@+id/folder_content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="vertical">
<Button
- android:id="@+id/close"
+ android:id="@+id/folder_close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:layout_height="wrap_content" />
<GridView
- android:id="@id/content"
+ android:id="@id/folder_content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:layout_height="fill_parent"
android:topOffset="5dip"
- android:bottomOffset="7dip"
+ android:bottomOffset="4dip"
android:handle="@+id/all_apps"
android:content="@+id/content">
android:orientation="vertical">
<Button
- android:id="@+id/close"
+ android:id="@+id/folder_close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:layout_height="wrap_content" />
<GridView
- android:id="@id/content"
+ android:id="@id/folder_content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="vertical">
<Button
- android:id="@+id/close"
+ android:id="@+id/folder_close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:layout_height="wrap_content" />
<GridView
- android:id="@id/content"
+ android:id="@id/folder_content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView android:id="@+id/icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="@android:dimen/app_icon_size"
+ android:layout_height="@android:dimen/app_icon_size"
android:layout_gravity="center_vertical"
-
- android:scaleType="center" />
+ android:scaleType="fitCenter" />
<LinearLayout
android:layout_width="0dip"
android:orientation="vertical">
<Button
- android:id="@+id/close"
+ android:id="@+id/folder_close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:layout_height="wrap_content" />
<ListView
- android:id="@id/content"
+ android:id="@id/folder_content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
<com.android.launcher.Search
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher2"
android:id="@+id/widget_search"
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
+ android:layout_height="fill_parent"
android:orientation="vertical"
- android:gravity="top">
+ android:gravity="center">
<LinearLayout
android:id="@+id/search_plate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:paddingLeft="12dip"
- android:paddingRight="12dip"
- android:paddingTop="7dip"
- android:paddingBottom="13dip"
+ android:paddingLeft="14dip"
+ android:paddingRight="14dip"
+ android:paddingTop="13dip"
+ android:paddingBottom="12dip"
android:background="@drawable/search_floater" >
<TextView
android:id="@+id/search_src_text"
android:layout_width="0dip"
- android:layout_height="wrap_content"
+ android:layout_height="42dip"
android:layout_weight="1.0"
android:editable="false"
android:focusable="true"
<ImageButton
android:id="@+id/search_voice_btn"
android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_marginLeft="8dip"
+ android:layout_height="42dip"
+ android:layout_marginLeft="4dip"
android:background="@*android:drawable/btn_search_dialog_voice"
android:src="@*android:drawable/ic_btn_speak_now"
/>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Nastavit tapetu"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galerie tapet"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Aplikace není v telefonu nainstalována."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurace..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Název složky"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Přejmenovat složku"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Rámeček fotografie"</string>
<string name="add_search" msgid="7104834713685095105">"Vyhledávání"</string>
<string name="out_of_space" msgid="8365249326091984698">"Na této ploše již není místo."</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"Byl vytvořen zástupce %s."</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"Zástupce %s byl odebrán."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"Zástupce %s již existuje."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"Zástupce <xliff:g id="NAME">%s</xliff:g> byl vytvořen."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Zástupce <xliff:g id="NAME">%s</xliff:g> byl odebrán."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Zástupce <xliff:g id="NAME">%s</xliff:g> již existuje."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Vyberte zástupce"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Vybrat složku"</string>
<string name="menu_add" msgid="3065046628354640854">"Přidat"</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Start"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Android-kerneprogrammer"</string>
<string name="folder_name" msgid="4588446541914685904">"Mappe"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Vælg tapet fra"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Angiv tapet"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Tapetgalleri"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Programmet er ikke installeret på din telefon."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurer ..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Mappenavn"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Omdøb mappe"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Billedramme"</string>
<string name="add_search" msgid="7104834713685095105">"Søg"</string>
<string name="out_of_space" msgid="8365249326091984698">"Der er ikke mere plads på Startskærmen."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"Genvejen \"<xliff:g id="NAME">%s</xliff:g>\" blev oprettet."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Genvejen \"<xliff:g id="NAME">%s</xliff:g>\" blev fjernet."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Genvejen \"<xliff:g id="NAME">%s</xliff:g>\" findes allerede."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Vælg genvej"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Vælg mappe"</string>
<string name="menu_add" msgid="3065046628354640854">"Tilføj"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Tapet"</string>
<string name="menu_search" msgid="4826514464423239041">"Søg"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Meddelelser"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Gestus"</string>
<string name="menu_settings" msgid="6233960148378443661">"Indstillinger"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"installer genveje"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Tillader et program at tilføje genveje uden brugerindgriben."</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Hintergrund festlegen"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galerie"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Anwendung ist nicht auf dem Telefon installiert."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurieren..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Ordnername"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Ordner umbenennen"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Bildrahmen"</string>
<string name="add_search" msgid="7104834713685095105">"Suchen"</string>
<string name="out_of_space" msgid="8365249326091984698">"Auf dem Startbildschirm ist kein Platz mehr vorhanden."</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"Verknüpfung \"%s\" erstellt"</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"Verknüpfung \"%s\" wurde entfernt."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"Verknüpfung \"%s\" ist bereits vorhanden."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"\"<xliff:g id="NAME">%s</xliff:g>\"-Verknüpfung wurde erstellt."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"\"<xliff:g id="NAME">%s</xliff:g>\"-Verknüpfung wurde entfernt."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"\"<xliff:g id="NAME">%s</xliff:g>\"-Verknüpfung ist bereits vorhanden."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Tastenkürzel auswählen"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Ordner auswählen"</string>
<string name="menu_add" msgid="3065046628354640854">"Hinzufügen"</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Αρχική οθόνη"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Βασικές εφαρμογές Android"</string>
<string name="folder_name" msgid="4588446541914685904">"Φάκελος"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Επιλογή ταπετσαρίας από"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Ορισμός ταπετσαρίας"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Συλλογή ταπετσαριών"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Η εφαρμογή δεν έχει εγκατασταθεί στο τηλέφωνό σας."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Διαμόρφωση..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Όνομα φακέλου"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Μετονομασία φακέλου"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Πλαίσιο εικόνας"</string>
<string name="add_search" msgid="7104834713685095105">"Αναζήτηση"</string>
<string name="out_of_space" msgid="8365249326091984698">"Δεν υπάρχει χώρος σε αυτήν την αρχική οθόνη."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"Δημιουργήθηκε η συντόμευση \"<xliff:g id="NAME">%s</xliff:g>\"."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Η συντόμευση \"<xliff:g id="NAME">%s</xliff:g>\" καταργήθηκε."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Η συντόμευση \"<xliff:g id="NAME">%s</xliff:g>\" υπάρχει ήδη."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Επιλογή συντόμευσης"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Επιλογή φακέλου"</string>
<string name="menu_add" msgid="3065046628354640854">"Προσθήκη"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Ταπετσαρία"</string>
<string name="menu_search" msgid="4826514464423239041">"Αναζήτηση"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Ειδοποιήσεις"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Χειρονομίες"</string>
<string name="menu_settings" msgid="6233960148378443661">"Ρυθμίσεις"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"εγκατάσταση συντομεύσεων"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Επιτρέπει σε μια εφαρμογή την προσθήκη συντομεύσεων χωρίς την παρέμβαση του χρήστη."</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Página principal"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Aplicaciones del núcleo de Android"</string>
<string name="folder_name" msgid="4588446541914685904">"Carpeta"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Seleccionar papel tapiz desde"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Definir papel tapiz"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galería de papel tapiz"</string>
<string name="activity_not_found" msgid="3571057450431950427">"La aplicación no está instalada en tu computadora."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nombre de carpeta"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Cambiar nombre de carpeta"</string>
<string name="rename_action" msgid="6016003384693240896">"Aceptar"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Marco de imagen"</string>
<string name="add_search" msgid="7104834713685095105">"Buscar"</string>
<string name="out_of_space" msgid="8365249326091984698">"No hay más espacio en esta pantalla de la página principal"</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"Acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" creado."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"El acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" ha sido eliminado."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"El acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" ya existe."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Seleccionar acceso directo"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Seleccionar carpeta"</string>
<string name="menu_add" msgid="3065046628354640854">"Agregar"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Papel tapiz"</string>
<string name="menu_search" msgid="4826514464423239041">"Buscar"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Notificaciones"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Gestos"</string>
<string name="menu_settings" msgid="6233960148378443661">"Configuración"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar accesos directos"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permite a una aplicación agregar accesos directos sin intervención del usuario."</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Establecer fondo de pantalla"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galería de fondos de pantalla"</string>
<string name="activity_not_found" msgid="3571057450431950427">"La aplicación no está instalada en el teléfono."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nombre de carpeta"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Cambiar nombre de carpeta"</string>
<string name="rename_action" msgid="6016003384693240896">"Aceptar"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Picture frame"</string>
<string name="add_search" msgid="7104834713685095105">"Búsqueda de Google"</string>
<string name="out_of_space" msgid="8365249326091984698">"No queda espacio en esta pantalla de página principal."</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"Se ha creado el acceso directo \"%s\"."</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"Se ha eliminado el acceso directo \"%s\"."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"El acceso directo \"%s\" ya existe."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"Se ha creado el acceso directo \"<xliff:g id="NAME">%s</xliff:g>\"."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Se ha eliminado el acceso directo \"<xliff:g id="NAME">%s</xliff:g>\"."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"El acceso directo \"<xliff:g id="NAME">%s</xliff:g>\" ya existe."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Seleccionar acceso directo"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Seleccionar carpeta"</string>
<string name="menu_add" msgid="3065046628354640854">"Añadir"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Sélectionner"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galerie"</string>
<string name="activity_not_found" msgid="3571057450431950427">"L\'application n\'est pas installée sur votre téléphone."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Configurer..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nom du dossier"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Renommer le dossier"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Cadre d\'image"</string>
<string name="add_search" msgid="7104834713685095105">"Recherche"</string>
<string name="out_of_space" msgid="8365249326091984698">"Plus d\'espace libre sur l\'écran d\'accueil."</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"Raccourci \"%s\" créé."</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"Le raccourci \"%s\" a été supprimé."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"Le raccourci \"%s\" existe déjà."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"Le raccourci \"<xliff:g id="NAME">%s</xliff:g>\" a été créé."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Le raccourci \"<xliff:g id="NAME">%s</xliff:g>\" a été supprimé."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Le raccourci \"<xliff:g id="NAME">%s</xliff:g>\" existe déjà."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Sélectionner un raccourci"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Sélectionner le dossier"</string>
<string name="menu_add" msgid="3065046628354640854">"Ajouter"</string>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2009 Google Inc.
+ *
+ * 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.
+ -->
+
+<resources>
+ <string-array name="wallpapers" translatable="false">
+ <item>wallpaper_bentgrass</item>
+ <item>wallpaper_canyon</item>
+ <item>wallpaper_despair</item>
+ <item>wallpaper_electric</item>
+ <item>wallpaper_goldengate</item>
+ <item>wallpaper_grass</item>
+ <item>wallpaper_jellyfish</item>
+ <item>wallpaper_leaves</item>
+ <item>wallpaper_monumentvalley</item>
+ <item>wallpaper_paradise</item>
+ <item>wallpaper_rainbokeh</item>
+ <item>wallpaper_ricefield</item>
+ <item>wallpaper_sunset</item>
+ <item>wallpaper_tree</item>
+ <item>wallpaper_valley</item>
+ </string-array>
+</resources>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Imposta sfondo"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galleria sfondi"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Applicazione non installata sul telefono."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Configura..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nome cartella"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Rinomina cartella"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Cornice immagini"</string>
<string name="add_search" msgid="7104834713685095105">"Ricerca"</string>
<string name="out_of_space" msgid="8365249326091984698">"Spazio nella schermata Home esaurito."</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"Collegamento \"%s\" creato."</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"La scorciatoia \"%s\" è stata rimossa."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"Scorciatoia \"%s\" già presente."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"Collegamento \"<xliff:g id="NAME">%s</xliff:g>\" creato."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Il collegamento \"<xliff:g id="NAME">%s</xliff:g>\" è stato rimosso."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Collegamento \"<xliff:g id="NAME">%s</xliff:g>\" già presente."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Seleziona collegamento"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Seleziona cartella"</string>
<string name="menu_add" msgid="3065046628354640854">"Aggiungi"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"壁紙に設定"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"壁紙ギャラリー"</string>
<string name="activity_not_found" msgid="3571057450431950427">"アプリケーションがインストールされていません。"</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"設定..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"フォルダ名"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"フォルダ名を変更"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"写真フレーム"</string>
<string name="add_search" msgid="7104834713685095105">"検索"</string>
<string name="out_of_space" msgid="8365249326091984698">"ホーム画面に空きスペースがありません。"</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"ショートカット「%s」を作成しました。"</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"ショートカット「%s」が削除されました。"</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"ショートカット「%s」は既に存在します。"</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"ショートカット「<xliff:g id="NAME">%s</xliff:g>」を作成しました。"</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"ショートカット「<xliff:g id="NAME">%s</xliff:g>」を削除しました。"</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"ショートカット「<xliff:g id="NAME">%s</xliff:g>」は既に存在します。"</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"ショートカットを選択"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"フォルダの選択"</string>
<string name="menu_add" msgid="3065046628354640854">"追加"</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"홈"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Android Core 애플리케이션"</string>
<string name="folder_name" msgid="4588446541914685904">"폴더"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"배경화면 선택"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"배경화면 설정"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"배경화면 갤러리"</string>
<string name="activity_not_found" msgid="3571057450431950427">"휴대전화에 설치되어 있지 않은 응용프로그램입니다."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"구성..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"폴더 이름"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"폴더 이름 바꾸기"</string>
<string name="rename_action" msgid="6016003384693240896">"확인"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"사진 프레임"</string>
<string name="add_search" msgid="7104834713685095105">"검색"</string>
<string name="out_of_space" msgid="8365249326091984698">"홈 화면에 더 이상 공간이 없습니다."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"바로가기(\'<xliff:g id="NAME">%s</xliff:g>\')가 생성되었습니다."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"바로가기(\'<xliff:g id="NAME">%s</xliff:g>\')가 삭제되었습니다."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"바로가기(\'<xliff:g id="NAME">%s</xliff:g>\')가 이미 있습니다."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"바로가기 선택"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"폴더 선택"</string>
<string name="menu_add" msgid="3065046628354640854">"추가"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"배경화면"</string>
<string name="menu_search" msgid="4826514464423239041">"검색"</string>
<string name="menu_notifications" msgid="6424587053194766192">"알림"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"동작"</string>
<string name="menu_settings" msgid="6233960148378443661">"설정"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"바로가기 설치"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"응용프로그램이 사용자의 작업 없이 바로가기를 추가할 수 있도록 합니다."</string>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources>
+ <dimen name="search_widget_inset">19dip</dimen>
+ <dimen name="gesture_thumbnail_inset">8dip</dimen>
+ <dimen name="gesture_thumbnail_size">64dip</dimen>
+ <dimen name="cell_width">106dip</dimen>
+ <dimen name="cell_height">74dip</dimen>
+</resources>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2009 Google Inc.
+ *
+ * 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.
+ -->
+
+<resources>
+ <string-array name="wallpapers" translatable="false">
+ <item>wallpaper_lake</item>
+ <item>wallpaper_sunset</item>
+ <item>wallpaper_beach</item>
+ <item>wallpaper_snow_leopard</item>
+ <item>wallpaper_path</item>
+ <item>wallpaper_sunrise</item>
+ <item>wallpaper_mountain</item>
+ <item>wallpaper_road</item>
+ <item>wallpaper_jellyfish</item>
+ <item>wallpaper_zanzibar</item>
+ <item>wallpaper_blue</item>
+ <item>wallpaper_grey</item>
+ <item>wallpaper_green</item>
+ <item>wallpaper_pink</item>
+ </string-array>
+</resources>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Velg bakgrunnsbilde"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Bildegalleri"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Applikasjonen er ikke installert."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurer"</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Mappenavn"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Gi nytt navn til mappe"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Bilderamme"</string>
<string name="add_search" msgid="7104834713685095105">"Søk"</string>
<string name="out_of_space" msgid="8365249326091984698">"Ikke nok plass på skrivebordet."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"Fjernet snarveien «%s»."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"Snarveien «%s» finnes allerede."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"Opprettet snarveien «<xliff:g id="NAME">%s</xliff:g>»."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Fjernet snarveien «<xliff:g id="NAME">%s</xliff:g>»."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Snarveien «<xliff:g id="NAME">%s</xliff:g>» fins allerede."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Velg snarvei"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Velg mappe"</string>
<string name="menu_add" msgid="3065046628354640854">"Legg til"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Achtergrond instellen"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Achtergrondgalerij"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Deze toepassing is niet geïnstalleerd op uw telefoon."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Configureren..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Mapnaam"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Naam van map wijzigen"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Fotolijstje"</string>
<string name="add_search" msgid="7104834713685095105">"Zoeken"</string>
<string name="out_of_space" msgid="8365249326091984698">"Er is geen ruimte meer op dit startscherm."</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"Snelkoppeling \'%s\' gemaakt."</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"Snelkoppeling \'%s\' is verwijderd."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"Snelkoppeling \'%s\' bestaat al."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"Snelkoppeling \'<xliff:g id="NAME">%s</xliff:g>\' is gemaakt."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Snelkoppeling \'<xliff:g id="NAME">%s</xliff:g>\' is verwijderd."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Snelkoppeling \'<xliff:g id="NAME">%s</xliff:g>\' bestaat al."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Snelkoppeling selecteren"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Map selecteren"</string>
<string name="menu_add" msgid="3065046628354640854">"Toevoegen"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Ustaw tapetę"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galeria tapet"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Aplikacja nie jest zainstalowana w telefonie."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Konfiguruj..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nazwa folderu"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Zmień nazwę folderu"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Ramka obrazu"</string>
<string name="add_search" msgid="7104834713685095105">"Wyszukiwarka"</string>
<string name="out_of_space" msgid="8365249326091984698">"Brak miejsca na tej stronie głównej"</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"Utworzono skrót „%s”."</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"Skrót „%s” został usunięty."</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"Skrót „%s” już istnieje."</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"Skrót „<xliff:g id="NAME">%s</xliff:g>” został utworzony."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Skrót „<xliff:g id="NAME">%s</xliff:g>” został usunięty."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Skrót „<xliff:g id="NAME">%s</xliff:g>” już istnieje."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Wybierz skrót"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Wybierz folder"</string>
<string name="menu_add" msgid="3065046628354640854">"Dodaj"</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Home"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Aplicações Principais do Android"</string>
<string name="folder_name" msgid="4588446541914685904">"Pasta"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Seleccionar imagem de fundo a partir de"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Definir imagem de fundo"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galeria de imagens de fundo"</string>
<string name="activity_not_found" msgid="3571057450431950427">"A aplicação não está instalada no telefone."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nome da pasta"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Mudar o nome da pasta"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Moldura de imagem"</string>
<string name="add_search" msgid="7104834713685095105">"Pesquisar"</string>
<string name="out_of_space" msgid="8365249326091984698">"Não existe espaço suficiente neste ecrã principal."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" foi criado."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" foi removido."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" já existe."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Seleccione o atalho"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Seleccione a pasta"</string>
<string name="menu_add" msgid="3065046628354640854">"Adicionar"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Imagem de fundo"</string>
<string name="menu_search" msgid="4826514464423239041">"Pesquisar"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Notificações"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Gestos"</string>
<string name="menu_settings" msgid="6233960148378443661">"Definições"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar atalhos"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permite que uma aplicação adicione atalhos sem a intervenção do utilizador."</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Página inicial"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Principais aplicativos do Android"</string>
<string name="folder_name" msgid="4588446541914685904">"Pasta"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Selecionar papel de parede de"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Definir papel de parede"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Galeria de papel de parede"</string>
<string name="activity_not_found" msgid="3571057450431950427">"O aplicativo não está instalado no seu telefone."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Configurar..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Nome da pasta"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Renomear pasta"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Frame da imagem"</string>
<string name="add_search" msgid="7104834713685095105">"Pesquisar"</string>
<string name="out_of_space" msgid="8365249326091984698">"Não há mais espaço nesta tela da Página inicial."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"Atalho \"<xliff:g id="NAME">%s</xliff:g>\" criado."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" foi removido."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"O atalho \"<xliff:g id="NAME">%s</xliff:g>\" já existe."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Selecionar atalho"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Selecionar pasta"</string>
<string name="menu_add" msgid="3065046628354640854">"Adicionar"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Papel de parede"</string>
<string name="menu_search" msgid="4826514464423239041">"Pesquisar"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Notificações"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Gestos"</string>
<string name="menu_settings" msgid="6233960148378443661">"Configurações"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"instalar atalhos"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Permite que um aplicativo adicione os atalhos sem a intervenção do usuário."</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Главный экран"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Основные приложения Android"</string>
<string name="folder_name" msgid="4588446541914685904">"Папка"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Выбрать обои из:"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Установить обои"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Фотоальбом: обои"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Приложение не установлено на телефоне."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Настроить..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Название папки"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Переименовать папку"</string>
<string name="rename_action" msgid="6016003384693240896">"ОК"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Рамка фотографии"</string>
<string name="add_search" msgid="7104834713685095105">"Поиск"</string>
<string name="out_of_space" msgid="8365249326091984698">"На этом главном экране нет свободного места."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"Ярлык \"<xliff:g id="NAME">%s</xliff:g>\" создан"</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Ярлык \"<xliff:g id="NAME">%s</xliff:g>\" удален."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Ярлык \"<xliff:g id="NAME">%s</xliff:g>\" уже существует."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Выберите ярлык"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Выбор папки"</string>
<string name="menu_add" msgid="3065046628354640854">"Добавить"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Обои"</string>
<string name="menu_search" msgid="4826514464423239041">"Поиск"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Уведомления"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Жесты"</string>
<string name="menu_settings" msgid="6233960148378443661">"Настройки"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"устанавливать ярлыки"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Позволяет приложению добавлять ярлыки без вмешательства пользователя"</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Start"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="4588446541914685904">"Mapp"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Välj bakgrund från"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Ange bakgrund"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Bakgrundsgalleri"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Programmet är inte installerat på din telefon."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Konfigurera..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Mappnamn"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Byt namn på mapp"</string>
<string name="rename_action" msgid="6016003384693240896">"OK"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Bildram"</string>
<string name="add_search" msgid="7104834713685095105">"Sök"</string>
<string name="out_of_space" msgid="8365249326091984698">"Det finns inte plats för mer på den här startsidan."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"Genvägen \"<xliff:g id="NAME">%s</xliff:g>\" har skapats."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"Genvägen \"<xliff:g id="NAME">%s</xliff:g>\" har tagits bort."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"Genvägen \"<xliff:g id="NAME">%s</xliff:g>\" finns redan."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Välj genväg"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Välj mapp"</string>
<string name="menu_add" msgid="3065046628354640854">"Lägg till"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Bakgrund"</string>
<string name="menu_search" msgid="4826514464423239041">"Sök"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Aviseringar"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Gester"</string>
<string name="menu_settings" msgid="6233960148378443661">"Inställningar"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"installera genvägar"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Tillåter att ett program lägger till genvägar utan åtgärd från användaren."</string>
<string name="permdesc_read_settings" msgid="8377434937176025492">"Tillåter att ett program läser inställningar och genvägar på startsidan."</string>
<string name="permlab_write_settings" msgid="1360567537236705628">"skriva inställningar och genvägar för startsidan"</string>
<string name="permdesc_write_settings" msgid="1098648778383349818">"Tillåter att ett program ändrar inställningar och genvägar på startsidan."</string>
- <string name="search_hint" msgid="6974176141372467453">"Google-sökning"</string>
+ <string name="search_hint" msgid="6974176141372467453">"Sök på Google"</string>
<string name="gadget_error_text" msgid="8359351016167075858">"Det gick inte att läsa in widgeten"</string>
</resources>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"Ana Sayfa"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string>
<string name="folder_name" msgid="4588446541914685904">"Klasör"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"Buradan duvar kağıdını seçin:"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"Duvar kağıdını ayarla"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"Duvar kağıdı galerisi"</string>
<string name="activity_not_found" msgid="3571057450431950427">"Uygulama telefonunuza yüklenmemiş."</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"Yapılandır..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"Klasör adı"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"Klasörü yeniden adlandır"</string>
<string name="rename_action" msgid="6016003384693240896">"Tamam"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"Resim çerçevesi"</string>
<string name="add_search" msgid="7104834713685095105">"Arama"</string>
<string name="out_of_space" msgid="8365249326091984698">"Bu Ana ekranda başka yer yok."</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu oluşturuldu."</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu kaldırıldı."</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"\"<xliff:g id="NAME">%s</xliff:g>\" kısayolu zaten var."</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"Kısayolu seçin"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"Klasörü seçin"</string>
<string name="menu_add" msgid="3065046628354640854">"Ekle"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"Duvar Kağıdı"</string>
<string name="menu_search" msgid="4826514464423239041">"Ara"</string>
<string name="menu_notifications" msgid="6424587053194766192">"Bildirimler"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"Hareketler"</string>
<string name="menu_settings" msgid="6233960148378443661">"Ayarlar"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"kısayolları yükle"</string>
<string name="permdesc_install_shortcut" msgid="7429365847558984148">"Bir uygulamaya, kısayolları kullanıcı müdahale etmeden ekleme izni verir."</string>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name" msgid="5865630159700533006">"主屏幕"</string>
- <!-- no translation found for uid_name (3371120195364560632) -->
- <skip />
+ <string name="uid_name" msgid="3371120195364560632">"Android 核心应用程序"</string>
<string name="folder_name" msgid="4588446541914685904">"文件夹"</string>
<string name="chooser_wallpaper" msgid="5988031014201479733">"选择壁纸来源"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"设置壁纸"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"壁纸图库"</string>
<string name="activity_not_found" msgid="3571057450431950427">"您的手机上未安装应用程序。"</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"配置..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"文件夹名称"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"重命名文件夹"</string>
<string name="rename_action" msgid="6016003384693240896">"确定"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"相框"</string>
<string name="add_search" msgid="7104834713685095105">"搜索"</string>
<string name="out_of_space" msgid="8365249326091984698">"此主屏幕上已没有更多空间。"</string>
- <!-- no translation found for shortcut_installed (6179314539443046225) -->
- <skip />
- <!-- no translation found for shortcut_uninstalled (2758997515869993129) -->
- <skip />
- <!-- no translation found for shortcut_duplicate (4887186782641532074) -->
- <skip />
+ <string name="shortcut_installed" msgid="7071557296331322355">"已创建“<xliff:g id="NAME">%s</xliff:g>”快捷方式。"</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"已删除“<xliff:g id="NAME">%s</xliff:g>”快捷方式。"</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"“<xliff:g id="NAME">%s</xliff:g>”快捷方式已存在。"</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"选择快捷方式"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"选择文件夹"</string>
<string name="menu_add" msgid="3065046628354640854">"添加"</string>
<string name="menu_wallpaper" msgid="5837429080911269832">"壁纸"</string>
<string name="menu_search" msgid="4826514464423239041">"搜索"</string>
<string name="menu_notifications" msgid="6424587053194766192">"通知"</string>
- <!-- no translation found for menu_gestures (514678675575912237) -->
- <skip />
+ <string name="menu_gestures" msgid="514678675575912237">"手势"</string>
<string name="menu_settings" msgid="6233960148378443661">"设置"</string>
<string name="permlab_install_shortcut" msgid="1201690825493376489">"安装快捷方式"</string>
- <string name="permdesc_install_shortcut" msgid="7429365847558984148">"允许应用程序在无用户操作的情况下添加快捷方式。"</string>
+ <string name="permdesc_install_shortcut" msgid="7429365847558984148">"允许应用程序在无人操作的情况下添加快捷方式。"</string>
<string name="permlab_uninstall_shortcut" msgid="7696645932555926449">"卸载快捷方式"</string>
- <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"允许应用程序在无用户操作的情况下删除快捷方式。"</string>
+ <string name="permdesc_uninstall_shortcut" msgid="959972195916090900">"允许应用程序在无人操作的情况下删除快捷方式。"</string>
<string name="permlab_read_settings" msgid="3452408290738106747">"读取主屏幕设置和快捷方式"</string>
<string name="permdesc_read_settings" msgid="8377434937176025492">"允许应用程序读取主屏幕上的设置和快捷方式。"</string>
<string name="permlab_write_settings" msgid="1360567537236705628">"写入主屏幕设置和快捷方式"</string>
<string name="wallpaper_instructions" msgid="4215640646180727542">"設定桌布"</string>
<string name="pick_wallpaper" msgid="2674908923379130941">"桌布集"</string>
<string name="activity_not_found" msgid="3571057450431950427">"應用程式未安裝到手機。"</string>
+ <string name="configure_wallpaper" msgid="2820186271419674623">"設定..."</string>
<string name="rename_folder_label" msgid="5646236631298452787">"資料夾名稱"</string>
<string name="rename_folder_title" msgid="4544573104191526550">"重新命名資料夾"</string>
<string name="rename_action" msgid="6016003384693240896">"確定"</string>
<string name="add_photo_frame" msgid="3154058437359487954">"相框"</string>
<string name="add_search" msgid="7104834713685095105">"搜尋"</string>
<string name="out_of_space" msgid="8365249326091984698">"首頁已無空間"</string>
- <string name="shortcut_installed" msgid="6179314539443046225">"已建立「%s」捷徑。"</string>
- <string name="shortcut_uninstalled" msgid="2758997515869993129">"已移除「%s」捷徑"</string>
- <string name="shortcut_duplicate" msgid="4887186782641532074">"已有「%s」捷徑。"</string>
+ <string name="shortcut_installed" msgid="7071557296331322355">"已建立「<xliff:g id="NAME">%s</xliff:g>」捷徑。"</string>
+ <string name="shortcut_uninstalled" msgid="2129499669449749995">"已移除「<xliff:g id="NAME">%s</xliff:g>」捷徑。"</string>
+ <string name="shortcut_duplicate" msgid="4757756326465060694">"「<xliff:g id="NAME">%s</xliff:g>」捷徑已經存在。"</string>
<string name="title_select_shortcut" msgid="2858897527672831763">"選取捷徑"</string>
<string name="title_select_live_folder" msgid="3753447798805166749">"選取資料夾"</string>
<string name="menu_add" msgid="3065046628354640854">"新增"</string>
<attr name="screen" format="string" />
<attr name="x" format="string" />
<attr name="y" format="string" />
+ <attr name="icon" format="reference" />
+ <attr name="title" format="reference" />
+ <attr name="uri" format="string" />
</declare-styleable>
</resources>
<dimen name="search_widget_inset">19dip</dimen>
<dimen name="gesture_thumbnail_inset">8dip</dimen>
<dimen name="gesture_thumbnail_size">64dip</dimen>
+ <dimen name="cell_width">80dip</dimen>
+ <dimen name="cell_height">100dip</dimen>
</resources>
<string name="pick_wallpaper">Wallpaper gallery</string>
<!-- Displayed when user selects a shortcut for an app that was uninstalled -->
<string name="activity_not_found">Application is not installed on your phone.</string>
+ <!-- List item for configuring the current wallpaper -->
+ <string name="configure_wallpaper">Configure...</string>
<!-- Folders -->
<skip />
<!-- Error message when user has filled a home screen, possibly not used -->
<string name="out_of_space">No more room on this Home screen.</string>
<!-- Message displayed when a shortcut is created by an external application -->
- <string name="shortcut_installed">Shortcut \"%s\" created.</string>
+ <string name="shortcut_installed">Shortcut \"<xliff:g id="name" example="Browser">%s</xliff:g>\" created.</string>
<!-- Message displayed when a shortcut is uninstalled by an external application -->
- <string name="shortcut_uninstalled">Shortcut \"%s\" was removed.</string>
+ <string name="shortcut_uninstalled">Shortcut \"<xliff:g id="name" example="Browser">%s</xliff:g>\" was removed.</string>
<!-- Message displayed when an external application attemps to create a shortcut that already exists -->
- <string name="shortcut_duplicate">Shortcut \"%s\" already exists.</string>
+ <string name="shortcut_duplicate">Shortcut \"<xliff:g id="name" example="Browser">%s</xliff:g>\" already exists.</string>
<!-- Title of dialog when user is selecting shortcut to add to homescreen -->
<string name="title_select_shortcut">Select shortcut</string>
-->
<resources>
- <style name="Theme" parent="android:Theme">
- <item name="android:windowBackground">@null</item>
- <item name="android:windowNoTitle">true</item>
- </style>
-
<style name="WorkspaceIcon">
<item name="android:textSize">13dip</item>
<item name="android:singleLine">true</item>
R.drawable.ic_launcher_appwidget, ITEM_APPWIDGET));
mItems.add(new ListItem(res, R.string.group_live_folders,
- R.drawable.ic_launcher_folder_live, ITEM_LIVE_FOLDER));
+ R.drawable.ic_launcher_add_folder, ITEM_LIVE_FOLDER));
mItems.add(new ListItem(res, R.string.group_wallpapers,
- R.drawable.ic_launcher_gallery, ITEM_WALLPAPER));
+ R.drawable.ic_launcher_wallpaper, ITEM_WALLPAPER));
}
}
@Override
+ public boolean isOpaque() {
+ return !mTexture.hasAlpha();
+ }
+
+ @Override
protected void onFinishInflate() {
setOnItemClickListener(this);
setOnItemLongClickListener(this);
import android.content.Context;
import android.content.res.TypedArray;
+import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
// Generate an id for each view, this assumes we have at most 256x256 cells
// per workspace screen
final LayoutParams cellParams = (LayoutParams) params;
- child.setId(((getId() & 0xFF) << 16) |
- (cellParams.cellX & 0xFF) << 8 | (cellParams.cellY & 0xFF));
+ cellParams.regenerateId = true;
super.addView(child, index, params);
}
findOccupiedCells(xCount, yCount, occupied, ignoreView);
}
+ return findAllVacantCellsFromOccupied(occupied, xCount, yCount);
+ }
+
+ /**
+ * Variant of findAllVacantCells that uses LauncerModel as its source rather than the
+ * views.
+ */
+ CellInfo findAllVacantCellsFromOccupied(boolean[][] occupied,
+ final int xCount, final int yCount) {
CellInfo cellInfo = new CellInfo();
cellInfo.cellX = -1;
}
/**
- * Given a point, return the cell that most closely encloses that point
- * @param x X coordinate of the point
- * @param y Y coordinate of the point
- * @param result Array of 2 ints to hold the x and y coordinate of the cell
- */
- void pointToCellRounded(int x, int y, int[] result) {
- pointToCellExact(x + (mCellWidth / 2), y + (mCellHeight / 2), result);
- }
-
- /**
* Given a cell coordinate, return the point that represents the upper left corner of that cell
*
* @param cellX X coordinate of the cell
lp.setup(cellWidth, cellHeight, mWidthGap, mHeightGap, longAxisStartPadding,
shortAxisStartPadding);
}
+
+ if (lp.regenerateId) {
+ child.setId(((getId() & 0xFF) << 16) | (lp.cellX & 0xFF) << 8 | (lp.cellY & 0xFF));
+ lp.regenerateId = false;
+ }
int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY);
int childheightMeasureSpec =
* @param targetXY Destination area to move to
*/
void onDropChild(View child, int[] targetXY) {
- LayoutParams lp = (LayoutParams) child.getLayoutParams();
- lp.cellX = targetXY[0];
- lp.cellY = targetXY[1];
- lp.isDragging = false;
- mDragRect.setEmpty();
- child.requestLayout();
- invalidate();
+ if (child != null) {
+ LayoutParams lp = (LayoutParams) child.getLayoutParams();
+ lp.cellX = targetXY[0];
+ lp.cellY = targetXY[1];
+ lp.isDragging = false;
+ mDragRect.setEmpty();
+ child.requestLayout();
+ invalidate();
+ }
}
void onDropAborted(View child) {
}
/**
- * Drag a child over the specified position
- *
- * @param child The child that is being dropped
- * @param cellX The child's new x cell location
- * @param cellY The child's new y cell location
- */
- void onDragOverChild(View child, int cellX, int cellY) {
- int[] cellXY = mCellXY;
- pointToCellRounded(cellX, cellY, cellXY);
- LayoutParams lp = (LayoutParams) child.getLayoutParams();
- cellToRect(cellXY[0], cellXY[1], lp.cellHSpan, lp.cellVSpan, mDragRect);
- invalidate();
- }
-
- /**
- * Computes a bounding rectangle for a range of cells
- *
- * @param cellX X coordinate of upper left corner expressed as a cell position
- * @param cellY Y coordinate of upper left corner expressed as a cell position
- * @param cellHSpan Width in cells
- * @param cellVSpan Height in cells
- * @param dragRect Rectnagle into which to put the results
- */
- public void cellToRect(int cellX, int cellY, int cellHSpan, int cellVSpan, RectF dragRect) {
- final boolean portrait = mPortrait;
- final int cellWidth = mCellWidth;
- final int cellHeight = mCellHeight;
- final int widthGap = mWidthGap;
- final int heightGap = mHeightGap;
-
- final int hStartPadding = portrait ? mShortAxisStartPadding : mLongAxisStartPadding;
- final int vStartPadding = portrait ? mLongAxisStartPadding : mShortAxisStartPadding;
-
- int width = cellHSpan * cellWidth + ((cellHSpan - 1) * widthGap);
- int height = cellVSpan * cellHeight + ((cellVSpan - 1) * heightGap);
-
- int x = hStartPadding + cellX * (cellWidth + widthGap);
- int y = vStartPadding + cellY * (cellHeight + heightGap);
-
- dragRect.set(x, y, x + width, y + height);
- }
-
- /**
* Computes the required horizontal and vertical cell spans to always
* fit the given rectangle.
*
public int[] rectToCell(int width, int height) {
// Always assume we're working with the smallest span to make sure we
// reserve enough space in both orientations.
- int actualWidth = mCellWidth + mWidthGap;
- int actualHeight = mCellHeight + mHeightGap;
+ final Resources resources = getResources();
+ int actualWidth = resources.getDimensionPixelSize(R.dimen.cell_width);
+ int actualHeight = resources.getDimensionPixelSize(R.dimen.cell_height);
int smallerSize = Math.min(actualWidth, actualHeight);
-
+
// Always round up to next largest cell
int spanX = (width + smallerSize) / smallerSize;
int spanY = (height + smallerSize) / smallerSize;
+
return new int[] { spanX, spanY };
}
@ViewDebug.ExportedProperty
int y;
+ boolean regenerateId;
+
public LayoutParams(Context c, AttributeSet attrs) {
super(c, attrs);
cellHSpan = 1;
* {@link #DRAG_ACTION_COPY}
*/
void startDrag(View v, DragSource source, Object info, int dragAction);
-
- /**
- * Sets the drag listner which will be notified when a drag starts or ends.
- */
- void setDragListener(DragListener l);
-
- /**
- * Remove a previously installed drag listener.
- */
- void removeDragListener(DragListener l);
}
private DropTarget mLastDropTarget;
private final Paint mTrashPaint = new Paint();
- private final Paint mEstimatedPaint = new Paint();
private Paint mDragPaint;
- /**
- * If true, draw a "snag" showing where the object currently being dragged
- * would end up if dropped from current location.
- */
- private static final boolean DRAW_TARGET_SNAG = false;
-
- private Rect mEstimatedRect = new Rect();
- private float[] mDragCenter = new float[2];
- private float[] mEstimatedCenter = new float[2];
- private boolean mDrawEstimated = false;
-
- private int mTriggerWidth = -1;
- private int mTriggerHeight = -1;
-
- private static final int DISTANCE_DRAW_SNAG = 20;
-
private static final int ANIMATION_STATE_STARTING = 1;
private static final int ANIMATION_STATE_RUNNING = 2;
private static final int ANIMATION_STATE_DONE = 3;
// Make estimated paint area in gray
int snagColor = context.getResources().getColor(R.color.snag_callout_color);
- mEstimatedPaint.setColor(snagColor);
- mEstimatedPaint.setStrokeWidth(3);
- mEstimatedPaint.setAntiAlias(true);
+ Paint estimatedPaint = new Paint();
+ estimatedPaint.setColor(snagColor);
+ estimatedPaint.setStrokeWidth(3);
+ estimatedPaint.setAntiAlias(true);
}
int width = viewBitmap.getWidth();
int height = viewBitmap.getHeight();
- mTriggerWidth = width * 2 / 3;
- mTriggerHeight = height * 2 / 3;
-
Matrix scale = new Matrix();
float scaleFactor = v.getWidth();
scaleFactor = (scaleFactor + DRAG_SCALE) /scaleFactor;
break;
}
} else {
- // Only draw estimate drop "snag" when requested
- if (DRAW_TARGET_SNAG && mDrawEstimated) {
- canvas.drawLine(mDragCenter[0], mDragCenter[1], mEstimatedCenter[0], mEstimatedCenter[1], mEstimatedPaint);
- canvas.drawCircle(mEstimatedCenter[0], mEstimatedCenter[1], 8, mEstimatedPaint);
- }
-
// Draw actual icon being dragged
canvas.drawBitmap(mDragBitmap,
mScrollX + mLastMotionX - mTouchOffsetX - mBitmapOffsetX,
// Invalidate current icon position
rect.union(left - 1, top - 1, left + width + 1, top + height + 1);
- mDragCenter[0] = rect.centerX();
- mDragCenter[1] = rect.centerY();
-
- // Invalidate any old estimated location
- if (DRAW_TARGET_SNAG && mDrawEstimated) {
- rect.union(mEstimatedRect);
- }
-
final int[] coordinates = mDropCoordinates;
DropTarget dropTarget = findDropTarget((int) x, (int) y, coordinates);
if (dropTarget != null) {
}
}
- // Render estimated drop "snag" only outside of width
- mDrawEstimated = false;
- if (DRAW_TARGET_SNAG && dropTarget != null) {
- Rect foundEstimate = dropTarget.estimateDropLocation(mDragSource,
- (int) (scrollX + mLastMotionX), (int) (scrollY + mLastMotionY),
- (int) mTouchOffsetX, (int) mTouchOffsetY, mDragInfo, mEstimatedRect);
-
- if (foundEstimate != null) {
- mEstimatedCenter[0] = foundEstimate.centerX();
- mEstimatedCenter[1] = foundEstimate.centerY();
-
- int deltaX = (int) Math.abs(mEstimatedCenter[0] - mDragCenter[0]);
- int deltaY = (int) Math.abs(mEstimatedCenter[1] - mDragCenter[1]);
-
- if (deltaX > mTriggerWidth || deltaY > mTriggerHeight) {
- mDrawEstimated = true;
- }
- }
- }
-
- // Include new estimated area in invalidated rectangle
- if (DRAW_TARGET_SNAG && mDrawEstimated) {
- rect.union(mEstimatedRect);
- }
invalidate(rect);
mLastDropTarget = dropTarget;
mListener = l;
}
+ @SuppressWarnings({"UnusedDeclaration"})
public void removeDragListener(DragListener l) {
mListener = null;
}
public void run() {
if (mDragScroller != null) {
- mDrawEstimated = false;
if (mDirection == SCROLL_LEFT) {
mDragScroller.scrollLeft();
} else {
*
*/
public interface DragSource {
- void setDragger(DragController dragger);
void onDropCompleted(View target, boolean success);
}
* @return True if the drop will be accepted, false otherwise.
*/
boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
-
- /**
- * Estimate the surface area where this object would land if dropped at the
- * given location.
- *
- * @param source DragSource where the drag started
- * @param x X coordinate of the drop location
- * @param y Y coordinate of the drop location
- * @param xOffset Horizontal offset with the object being dragged where the
- * original touch happened
- * @param yOffset Vertical offset with the object being dragged where the
- * original touch happened
- * @param dragInfo Data associated with the object being dragged
- * @param recycle {@link Rect} object to be possibly recycled.
- * @return Estimated area that would be occupied if object was dropped at
- * the given location. Should return null if no estimate is found,
- * or if this target doesn't provide estimations.
- */
- Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo, Rect recycle);
}
* Which item is being dragged
*/
protected ApplicationInfo mDragItem;
- private boolean mCloneInfo;
/**
* Used to inflate the Workspace from XML.
protected void onFinishInflate() {
super.onFinishInflate();
- mContent = (AbsListView) findViewById(R.id.content);
+ mContent = (AbsListView) findViewById(R.id.folder_content);
mContent.setOnItemClickListener(this);
mContent.setOnItemLongClickListener(this);
- mCloseButton = (Button) findViewById(R.id.close);
+ mCloseButton = (Button) findViewById(R.id.folder_close);
mCloseButton.setOnClickListener(this);
mCloseButton.setOnLongClickListener(this);
}
}
ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
- if (mCloneInfo) {
- app = new ApplicationInfo(app);
- }
mDragger.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
mLauncher.closeFolder(this);
return true;
}
- void setCloneInfo(boolean cloneInfo) {
- mCloneInfo = cloneInfo;
- }
-
public void setDragger(DragController dragger) {
mDragger = dragger;
}
import android.app.Activity;
import android.app.AlertDialog;
-import android.app.Application;
import android.app.Dialog;
import android.app.ISearchManager;
-import android.app.IWallpaperService;
import android.app.SearchManager;
import android.app.StatusBarManager;
+import android.app.WallpaperInfo;
+import android.app.WallpaperManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.IntentFilter;
import android.content.Intent.ShortcutIconResource;
import android.content.pm.ActivityInfo;
+import android.content.pm.LabeledIntent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.Rect;
-import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.os.Bundle;
import android.os.Handler;
-import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.MessageQueue;
import android.text.TextUtils;
import android.text.method.TextKeyListener;
import static android.util.Log.*;
+import android.util.SparseArray;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
private static final boolean PROFILE_ROTATE = false;
private static final boolean DEBUG_USER_INTERFACE = false;
- private static final int WALLPAPER_SCREENS_SPAN = 2;
-
private static final int MENU_GROUP_ADD = 1;
private static final int MENU_ADD = Menu.FIRST + 1;
private static final int MENU_WALLPAPER_SETTINGS = MENU_ADD + 1;
static final String EXTRA_CUSTOM_WIDGET = "custom_widget";
static final String SEARCH_WIDGET = "search_widget";
+ static final int WALLPAPER_SCREENS_SPAN = 2;
static final int SCREEN_COUNT = 3;
static final int DEFAULT_SCREN = 1;
static final int NUMBER_CELLS_X = 4;
private static final LauncherModel sModel = new LauncherModel();
- private static Bitmap sWallpaper;
-
private static final Object sLock = new Object();
private static int sScreen = DEFAULT_SCREN;
- private static WallpaperIntentReceiver sWallpaperReceiver;
-
private final BroadcastReceiver mApplicationsReceiver = new ApplicationsIntentReceiver();
+ private final BroadcastReceiver mCloseSystemDialogsReceiver = new CloseSystemDialogsIntentReceiver();
private final ContentObserver mObserver = new FavoritesChangeObserver();
+ private final ContentObserver mWidgetObserver = new AppWidgetResetObserver();
private LayoutInflater mInflater;
}
private void setWallpaperDimension() {
- IBinder binder = ServiceManager.getService(WALLPAPER_SERVICE);
- IWallpaperService wallpaperService = IWallpaperService.Stub.asInterface(binder);
+ WallpaperManager wpm = (WallpaperManager)getSystemService(WALLPAPER_SERVICE);
Display display = getWindowManager().getDefaultDisplay();
boolean isPortrait = display.getWidth() < display.getHeight();
final int width = isPortrait ? display.getWidth() : display.getHeight();
final int height = isPortrait ? display.getHeight() : display.getWidth();
- try {
- wallpaperService.setDimensionHints(width * WALLPAPER_SCREENS_SPAN, height);
- } catch (RemoteException e) {
- // System is dead!
- }
+ wpm.suggestDesiredDimensions(width * WALLPAPER_SCREENS_SPAN, height);
}
@Override
completeAddAppWidget(data, mAddItemCellInfo, !mDesktopLocked);
break;
}
- } else if (requestCode == REQUEST_PICK_APPWIDGET &&
- resultCode == RESULT_CANCELED && data != null) {
+ } else if ((requestCode == REQUEST_PICK_APPWIDGET ||
+ requestCode == REQUEST_CREATE_APPWIDGET) && resultCode == RESULT_CANCELED &&
+ data != null) {
// Clean up the appWidgetId if we canceled
int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
if (appWidgetId != -1) {
workspace.setOnLongClickListener(this);
workspace.setDragger(dragLayer);
workspace.setLauncher(this);
- loadWallpaper();
deleteZone.setLauncher(this);
deleteZone.setDragController(dragLayer);
Bundle extras = data.getExtras();
int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
- d(LOG_TAG, "dumping extras content="+extras.toString());
+ if (LOGD) d(LOG_TAG, "dumping extras content="+extras.toString());
AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
// Try finding open space on Launcher screen
final int[] xy = mCellCoordinates;
- if (!findSlot(cellInfo, xy, spans[0], spans[1])) return;
+ if (!findSlot(cellInfo, xy, spans[0], spans[1])) {
+ if (appWidgetId != -1) mAppWidgetHost.deleteAppWidgetId(appWidgetId);
+ return;
+ }
// Build Launcher-specific widget info and save to database
LauncherAppWidgetInfo launcherInfo = new LauncherAppWidgetInfo(appWidgetId);
return info;
}
+ void closeSystemDialogs() {
+ getWindow().closeAllPanels();
+
+ try {
+ dismissDialog(DIALOG_CREATE_SHORTCUT);
+ // Unlock the workspace if the dialog was showing
+ mWorkspace.unlock();
+ } catch (Exception e) {
+ // An exception is thrown if the dialog is not visible, which is fine
+ }
+
+ try {
+ dismissDialog(DIALOG_RENAME_FOLDER);
+ // Unlock the workspace if the dialog was showing
+ mWorkspace.unlock();
+ } catch (Exception e) {
+ // An exception is thrown if the dialog is not visible, which is fine
+ }
+ }
+
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// Close the menu
if (Intent.ACTION_MAIN.equals(intent.getAction())) {
- getWindow().closeAllPanels();
+ closeSystemDialogs();
// Set this flag so that onResume knows to close the search dialog if it's open,
// because this was a new intent (thus a press of 'home' or some such) rather than
// for example onResume being called when the user pressed the 'back' button.
mIsNewIntent = true;
- try {
- dismissDialog(DIALOG_CREATE_SHORTCUT);
- // Unlock the workspace if the dialog was showing
- mWorkspace.unlock();
- } catch (Exception e) {
- // An exception is thrown if the dialog is not visible, which is fine
- }
-
- try {
- dismissDialog(DIALOG_RENAME_FOLDER);
- // Unlock the workspace if the dialog was showing
- mWorkspace.unlock();
- } catch (Exception e) {
- // An exception is thrown if the dialog is not visible, which is fine
- }
-
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) !=
Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) {
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
- // Do not call super here
+ // NOTE: Do NOT do this. Ever. This is a terrible and horrifying hack.
+ //
+ // Home loads the content of the workspace on a background thread. This means that
+ // a previously focused view will be, after orientation change, added to the view
+ // hierarchy at an undeterminate time in the future. If we were to invoke
+ // super.onRestoreInstanceState() here, the focus restoration would fail because the
+ // view to focus does not exist yet.
+ //
+ // However, not invoking super.onRestoreInstanceState() is equally bad. In such a case,
+ // panels would not be restored properly. For instance, if the menu is open then the
+ // user changes the orientation, the menu would not be opened in the new orientation.
+ //
+ // To solve both issues Home messes up with the internal state of the bundle to remove
+ // the properties it does not want to see restored at this moment. After invoking
+ // super.onRestoreInstanceState(), it removes the panels state.
+ //
+ // Later, when the workspace is done loading, Home calls super.onRestoreInstanceState()
+ // again to restore focus and other view properties. It will not, however, restore
+ // the panels since at this point the panels' state has been removed from the bundle.
+ //
+ // This is a bad example, do not do this.
+ //
+ // If you are curious on how this code was put together, take a look at the following
+ // in Android's source code:
+ // - Activity.onRestoreInstanceState()
+ // - PhoneWindow.restoreHierarchyState()
+ // - PhoneWindow.DecorView.onAttachedToWindow()
+ //
+ // The source code of these various methods shows what states should be kept to
+ // achieve what we want here.
+
+ Bundle windowState = savedInstanceState.getBundle("android:viewHierarchyState");
+ SparseArray<Parcelable> savedStates = null;
+ int focusedViewId = View.NO_ID;
+
+ if (windowState != null) {
+ savedStates = windowState.getSparseParcelableArray("android:views");
+ windowState.remove("android:views");
+ focusedViewId = windowState.getInt("android:focusedViewId", View.NO_ID);
+ windowState.remove("android:focusedViewId");
+ }
+
+ super.onRestoreInstanceState(savedInstanceState);
+
+ if (windowState != null) {
+ windowState.putSparseParcelableArray("android:views", savedStates);
+ windowState.putInt("android:focusedViewId", focusedViewId);
+ windowState.remove("android:Panels");
+ }
+
mSavedInstanceState = savedInstanceState;
}
@Override
protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+
outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getCurrentScreen());
final ArrayList<Folder> folders = mWorkspace.getOpenFolders();
ids[i] = info.id;
}
outState.putLongArray(RUNTIME_STATE_USER_FOLDERS, ids);
- } else {
- super.onSaveInstanceState(outState);
}
final boolean isConfigurationChange = getChangingConfigurations() != 0;
sModel.abortLoaders();
getContentResolver().unregisterContentObserver(mObserver);
+ getContentResolver().unregisterContentObserver(mWidgetObserver);
unregisterReceiver(mApplicationsReceiver);
+ unregisterReceiver(mCloseSystemDialogsReceiver);
}
@Override
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- if (mDesktopLocked) return false;
+ if (mDesktopLocked && mSavedInstanceState == null) return false;
super.onCreateOptionsMenu(menu);
menu.add(MENU_GROUP_ADD, MENU_ADD, 0, R.string.menu_add)
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
- mMenuAddInfo = mWorkspace.findAllVacantCells(null);
+ // We can't trust the view state here since views we may not be done binding.
+ // Get the vacancy state from the model instead.
+ mMenuAddInfo = mWorkspace.findAllVacantCellsFromModel();
menu.setGroupEnabled(MENU_GROUP_ADD, mMenuAddInfo != null && mMenuAddInfo.valid);
return true;
private void startWallpaper() {
final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
- startActivity(Intent.createChooser(pickWallpaper, getString(R.string.chooser_wallpaper)));
+ Intent chooser = Intent.createChooser(pickWallpaper,
+ getText(R.string.chooser_wallpaper));
+ WallpaperManager wm = (WallpaperManager)
+ getSystemService(Context.WALLPAPER_SERVICE);
+ WallpaperInfo wi = wm.getWallpaperInfo();
+ if (wi != null && wi.getSettingsActivity() != null) {
+ LabeledIntent li = new LabeledIntent(getPackageName(),
+ R.string.configure_wallpaper, 0);
+ li.setClassName(wi.getPackageName(), wi.getSettingsActivity());
+ chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { li });
+ }
+ startActivity(chooser);
}
/**
* wallpaper.
*/
private void registerIntentReceivers() {
- if (sWallpaperReceiver == null) {
- final Application application = getApplication();
-
- sWallpaperReceiver = new WallpaperIntentReceiver(application, this);
-
- IntentFilter filter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED);
- application.registerReceiver(sWallpaperReceiver, filter);
- } else {
- sWallpaperReceiver.setLauncher(this);
- }
-
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
filter.addDataScheme("package");
registerReceiver(mApplicationsReceiver, filter);
+ filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
+ registerReceiver(mCloseSystemDialogsReceiver, filter);
}
/**
private void registerContentObservers() {
ContentResolver resolver = getContentResolver();
resolver.registerContentObserver(LauncherSettings.Favorites.CONTENT_URI, true, mObserver);
+ resolver.registerContentObserver(LauncherProvider.CONTENT_APPWIDGET_RESET_URI,
+ true, mWidgetObserver);
}
@Override
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_BACK:
- mWorkspace.dispatchKeyEvent(event);
- if (mDrawer.isOpened()) {
- closeDrawer();
- } else {
- closeFolder();
+ return true;
+ case KeyEvent.KEYCODE_HOME:
+ return true;
+ }
+ } else if (event.getAction() == KeyEvent.ACTION_UP) {
+ switch (event.getKeyCode()) {
+ case KeyEvent.KEYCODE_BACK:
+ if (!event.isCanceled()) {
+ mWorkspace.dispatchKeyEvent(event);
+ if (mDrawer.isOpened()) {
+ closeDrawer();
+ } else {
+ closeFolder();
+ }
}
return true;
case KeyEvent.KEYCODE_HOME:
sModel.loadUserItems(false, this, false, false);
}
+ /**
+ * Re-listen when widgets are reset.
+ */
+ private void onAppWidgetReset() {
+ mAppWidgetHost.startListening();
+ }
+
void onDesktopItemsLoaded(ArrayList<ItemInfo> shortcuts,
ArrayList<LauncherAppWidgetInfo> appWidgets) {
if (mDestroyed) {
}
}
- DragController getDragController() {
- return mDragLayer;
- }
-
/**
* Launches the intent referred by the clicked shortcut.
*
}
}
- private void loadWallpaper() {
- // The first time the application is started, we load the wallpaper from
- // the ApplicationContext
- if (sWallpaper == null) {
- final Drawable drawable = getWallpaper();
- if (drawable instanceof BitmapDrawable) {
- sWallpaper = ((BitmapDrawable) drawable).getBitmap();
- } else {
- throw new IllegalStateException("The wallpaper must be a BitmapDrawable.");
- }
- }
- mWorkspace.loadWallpaper(sWallpaper);
- }
-
/**
* Opens the user fodler described by the specified tag. The opening of the folder
* is animated relative to the specified View. If the View is null, no animation
}
/**
+ * Receives notifications when applications are added/removed.
+ */
+ private class CloseSystemDialogsIntentReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ closeSystemDialogs();
+ }
+ }
+
+ /**
* Receives notifications whenever the user favorites have changed.
*/
private class FavoritesChangeObserver extends ContentObserver {
}
/**
- * Receives intents from other applications to change the wallpaper.
+ * Receives notifications whenever the appwidgets are reset.
*/
- private static class WallpaperIntentReceiver extends BroadcastReceiver {
- private final Application mApplication;
- private WeakReference<Launcher> mLauncher;
-
- WallpaperIntentReceiver(Application application, Launcher launcher) {
- mApplication = application;
- setLauncher(launcher);
- }
-
- void setLauncher(Launcher launcher) {
- mLauncher = new WeakReference<Launcher>(launcher);
+ private class AppWidgetResetObserver extends ContentObserver {
+ public AppWidgetResetObserver() {
+ super(new Handler());
}
@Override
- public void onReceive(Context context, Intent intent) {
- // Load the wallpaper from the ApplicationContext and store it locally
- // until the Launcher Activity is ready to use it
- final Drawable drawable = mApplication.getWallpaper();
- if (drawable instanceof BitmapDrawable) {
- sWallpaper = ((BitmapDrawable) drawable).getBitmap();
- } else {
- throw new IllegalStateException("The wallpaper must be a BitmapDrawable.");
- }
-
- // If Launcher is alive, notify we have a new wallpaper
- if (mLauncher != null) {
- final Launcher launcher = mLauncher.get();
- if (launcher != null) {
- launcher.loadWallpaper();
- }
- }
+ public void onChange(boolean selfChange) {
+ onAppWidgetReset();
}
}
* for the Launcher.
*/
public class LauncherModel {
- static final boolean DEBUG_LOADERS = true;
+ static final boolean DEBUG_LOADERS = false;
static final String LOG_TAG = "HomeLoaders";
private static final int UI_NOTIFICATION_RATE = 4;
Utilities.createIconThumbnail(info.activityInfo.loadIcon(manager), context);
application.filtered = false;
}
-
+
private static final AtomicInteger sAppsLoaderCount = new AtomicInteger(1);
private static final AtomicInteger sWorkspaceLoaderCount = new AtomicInteger(1);
}
/**
- * @return The current list of applications
+ * Fills in the occupied structure with all of the shortcuts, apps, folders and widgets in
+ * the model.
*/
- ApplicationsAdapter getApplicationsAdapter() {
- return mApplicationsAdapter;
+ void findAllOccupiedCells(boolean[][] occupied, int countX, int countY, int screen) {
+ final ArrayList<ItemInfo> desktopItems = mDesktopItems;
+ if (desktopItems != null) {
+ final int count = desktopItems.size();
+ for (int i = 0; i < count; i++) {
+ ItemInfo item = desktopItems.get(i);
+ addOccupiedCells(occupied, screen, desktopItems.get(i));
+ }
+ }
+
+ final ArrayList<LauncherAppWidgetInfo> desktopAppWidgets = mDesktopAppWidgets;
+ if (desktopAppWidgets != null) {
+ final int count = desktopAppWidgets.size();
+ for (int i = 0; i < count; i++) {
+ addOccupiedCells(occupied, screen, desktopAppWidgets.get(i));
+ }
+ }
}
/**
- * @return The current list of desktop items
+ * Add the footprint of the specified item to the occupied array
*/
- ArrayList<ItemInfo> getDesktopItems() {
- return mDesktopItems;
+ private void addOccupiedCells(boolean[][] occupied, int screen,
+ ItemInfo item) {
+ if (item.screen == screen) {
+ for (int xx = item.cellX; xx < item.cellX + item.spanX; xx++) {
+ for (int yy = item.cellY; yy < item.cellY + item.spanY; yy++) {
+ occupied[xx][yy] = true;
+ }
+ }
+ }
}
-
+
/**
- * @return The current list of desktop items
+ * @return The current list of applications
*/
- ArrayList<LauncherAppWidgetInfo> getDesktopAppWidgets() {
- return mDesktopAppWidgets;
+ ApplicationsAdapter getApplicationsAdapter() {
+ return mApplicationsAdapter;
}
/**
}
/**
- * Add an item to the database in a specified container. Sets the container, screen, cellX and
- * cellY fields of the item. Also assigns an ID to the item.
- */
- static boolean addGestureToDatabase(Context context, ItemInfo item, boolean notify) {
- final ContentValues values = new ContentValues();
- final ContentResolver cr = context.getContentResolver();
-
- item.onAddToDatabase(values);
-
- Uri result = cr.insert(notify ? LauncherSettings.Gestures.CONTENT_URI :
- LauncherSettings.Gestures.CONTENT_URI_NO_NOTIFICATION, values);
-
- if (result != null) {
- item.id = Integer.parseInt(result.getPathSegments().get(1));
- }
-
- return result != null;
- }
-
- /**
* Update an item to the database in a specified container.
*/
static void updateItemInDatabase(Context context, ItemInfo item) {
cr.delete(LauncherSettings.Favorites.CONTENT_URI,
LauncherSettings.Favorites.CONTAINER + "=" + info.id, null);
}
-
- static void deleteGestureFromDatabase(Context context, ItemInfo item) {
- final ContentResolver cr = context.getContentResolver();
-
- cr.delete(LauncherSettings.Gestures.getContentUri(item.id, false), null, null);
- }
-
- static void updateGestureInDatabase(Context context, ItemInfo item) {
- final ContentValues values = new ContentValues();
- final ContentResolver cr = context.getContentResolver();
-
- item.onAddToDatabase(values);
-
- cr.update(LauncherSettings.Gestures.getContentUri(item.id, false), values, null, null);
- }
-
-
- ApplicationInfo queryGesture(Context context, String id) {
- final ContentResolver contentResolver = context.getContentResolver();
- final PackageManager manager = context.getPackageManager();
- final Cursor c = contentResolver.query(
- LauncherSettings.Gestures.CONTENT_URI, null, LauncherSettings.Gestures._ID + "=?",
- new String[] { id }, null);
-
- ApplicationInfo info = null;
-
- try {
- final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures._ID);
- final int intentIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures.INTENT);
- final int titleIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures.TITLE);
- final int iconTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures.ICON_TYPE);
- final int iconIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures.ICON);
- final int iconPackageIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures.ICON_PACKAGE);
- final int iconResourceIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures.ICON_RESOURCE);
- final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Gestures.ITEM_TYPE);
-
- String intentDescription;
- Intent intent;
-
- if (c.moveToNext()) {
- int itemType = c.getInt(itemTypeIndex);
-
- switch (itemType) {
- case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
- case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
- intentDescription = c.getString(intentIndex);
- try {
- intent = Intent.parseUri(intentDescription, 0);
- } catch (java.net.URISyntaxException e) {
- return null;
- }
-
- if (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION) {
- info = getApplicationInfo(manager, intent, context);
- } else {
- info = getApplicationInfoShortcut(c, context, iconTypeIndex,
- iconPackageIndex, iconResourceIndex, iconIndex);
- }
-
- if (info == null) {
- info = new ApplicationInfo();
- info.icon = manager.getDefaultActivityIcon();
- }
-
- info.isGesture = true;
- info.title = c.getString(titleIndex);
- info.intent = intent;
- info.id = c.getLong(idIndex);
-
- break;
- }
- }
- } catch (Exception e) {
- w(LOG_TAG, "Could not load gesture with name " + id);
- } finally {
- c.close();
- }
-
- return info;
- }
}
package com.android.launcher;
+import static android.util.Log.d;
+import static android.util.Log.w;
+
import android.appwidget.AppWidgetHost;
import android.content.ContentProvider;
import android.content.Context;
import android.content.ComponentName;
import android.content.ContentUris;
import android.content.ContentResolver;
+import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.content.res.TypedArray;
import android.content.pm.PackageManager;
import android.provider.Settings;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import org.xmlpull.v1.XmlPullParserException;
private static class DatabaseHelper extends SQLiteOpenHelper {
private static final String TAG_FAVORITES = "favorites";
private static final String TAG_FAVORITE = "favorite";
+ private static final String TAG_SHORTCUT = "shortcut";
private static final String TAG_CLOCK = "clock";
private static final String TAG_SEARCH = "search";
a.getString(R.styleable.Favorite_y));
if (TAG_FAVORITE.equals(name)) {
- added = addShortcut(db, values, a, packageManager, intent);
+ added = addAppShortcut(db, values, a, packageManager, intent);
} else if (TAG_SEARCH.equals(name)) {
added = addSearchWidget(db, values);
} else if (TAG_CLOCK.equals(name)) {
added = addClockWidget(db, values);
+ } else if (TAG_SHORTCUT.equals(name)) {
+ added = addShortcut(db, values, a);
}
if (added) i++;
return i;
}
- private boolean addShortcut(SQLiteDatabase db, ContentValues values, TypedArray a,
+ private boolean addAppShortcut(SQLiteDatabase db, ContentValues values, TypedArray a,
PackageManager packageManager, Intent intent) {
ActivityInfo info;
}
return true;
}
+
+ private boolean addShortcut(SQLiteDatabase db, ContentValues values, TypedArray a) {
+ Resources r = mContext.getResources();
+
+ final int iconResId = a.getResourceId(R.styleable.Favorite_icon, 0);
+ final int titleResId = a.getResourceId(R.styleable.Favorite_title, 0);
+
+ Intent intent = null;
+ String uri = null;
+ try {
+ uri = a.getString(R.styleable.Favorite_uri);
+ intent = Intent.parseUri(uri, 0);
+ } catch (URISyntaxException e) {
+ w(LauncherModel.LOG_TAG, "Shortcut has malformed uri: " + uri);
+ return false; // Oh well
+ }
+
+ if (iconResId == 0 || titleResId == 0) {
+ w(LauncherModel.LOG_TAG, "Shortcut is missing title or icon resource ID");
+ return false;
+ }
+
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ values.put(Favorites.INTENT, intent.toUri(0));
+ values.put(Favorites.TITLE, r.getString(titleResId));
+ values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_SHORTCUT);
+ values.put(Favorites.SPANX, 1);
+ values.put(Favorites.SPANY, 1);
+ values.put(Favorites.ICON_TYPE, Favorites.ICON_TYPE_RESOURCE);
+ values.put(Favorites.ICON_PACKAGE, mContext.getPackageName());
+ values.put(Favorites.ICON_RESOURCE, mContext.getResources().getResourceName(iconResId));
+
+ db.insert(TABLE_FAVORITES, null, values);
+
+ return true;
+ }
private boolean addSearchWidget(SQLiteDatabase db, ContentValues values) {
// Add a search box
static final String ICON = "icon";
}
- static final class Gestures implements BaseLauncherColumns {
- /**
- * The content:// style URL for this table
- */
- static final Uri CONTENT_URI = Uri.parse("content://" +
- LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_GESTURES +
- "?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
-
- /**
- * The content:// style URL for this table. When this Uri is used, no notification is
- * sent if the content changes.
- */
- static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
- LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_GESTURES +
- "?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
-
- /**
- * The content:// style URL for a given row, identified by its id.
- *
- * @param id The row id.
- * @param notify True to send a notification is the content changes.
- *
- * @return The unique content URL for the specified row.
- */
- static Uri getContentUri(long id, boolean notify) {
- return Uri.parse("content://" + LauncherProvider.AUTHORITY +
- "/" + LauncherProvider.TABLE_GESTURES + "/" + id + "?" +
- LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
- }
- }
-
/**
* Favorites. When changing these values, be sure to update
* {@link com.android.settings.LauncherAppWidgetBinder} as needed.
package com.android.launcher;
-import android.app.SearchManager;
import android.content.ActivityNotFoundException;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.server.search.SearchableInfo;
-import android.server.search.Searchables;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
// Speed at which the widget slides up/down, in pixels/ms.
private static final float ANIMATION_VELOCITY = 1.0f;
+ /** The distance in dips between the optical top of the widget and the top if its bounds */
+ private static final float WIDGET_TOP_OFFSET = 9;
+
private final String TAG = "SearchWidget";
private Launcher mLauncher;
// For voice searching
private Intent mVoiceSearchIntent;
-
- private SearchManager mSearchManager;
+
+ private int mWidgetTopOffset;
/**
* Used to inflate the Workspace from XML.
public Search(Context context, AttributeSet attrs) {
super(context, attrs);
+ final float scale = context.getResources().getDisplayMetrics().density;
+ mWidgetTopOffset = Math.round(WIDGET_TOP_OFFSET * scale);
+
Interpolator interpolator = new AccelerateDecelerateInterpolator();
mMorphAnimation = new ToParentOriginAnimation();
mVoiceSearchIntent = new Intent(android.speech.RecognizerIntent.ACTION_WEB_SEARCH);
mVoiceSearchIntent.putExtra(android.speech.RecognizerIntent.EXTRA_LANGUAGE_MODEL,
android.speech.RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
-
- mSearchManager = (SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE);
}
/**
/**
* Morph the search gadget to the search dialog.
- * See {@link Activity.startSearch()} for the arguments.
+ * See {@link Activity#startSearch()} for the arguments.
*/
public void startSearch(String initialQuery, boolean selectInitialQuery,
Bundle appSearchData, boolean globalSearch) {
}
private boolean isAtTop() {
- return getTop() == 0;
+ return getWidgetTop() == 0;
}
private int getAnimationDuration() {
- return (int) (getTop() / ANIMATION_VELOCITY);
+ return (int) (getWidgetTop() / ANIMATION_VELOCITY);
}
/**
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float dx = -getLeft() * interpolatedTime;
- float dy = -getTop() * interpolatedTime;
+ float dy = -getWidgetTop() * interpolatedTime;
t.getMatrix().setTranslate(dx, dy);
}
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float dx = -getLeft() * (1.0f - interpolatedTime);
- float dy = -getTop() * (1.0f - interpolatedTime);
+ float dy = -getWidgetTop() * (1.0f - interpolatedTime);
t.getMatrix().setTranslate(dx, dy);
}
}
+
+ /**
+ * The widget is centered vertically within it's 4x1 slot. This is
+ * accomplished by nesting the actual widget inside another view. For
+ * animation purposes, we care about the top of the actual widget rather
+ * than it's container. This method return the top of the actual widget.
+ */
+ private int getWidgetTop() {
+ return getTop() + getChildAt(0).getTop() + mWidgetTopOffset;
+ }
}
public void add(ApplicationInfo item) {
contents.add(item);
}
-
- /**
- * Remove an app or shortcut
- *
- * @param item
- */
- public void remove(ApplicationInfo item) {
- contents.remove(item);
- }
-
+
@Override
void onAddToDatabase(ContentValues values) {
super.onAddToDatabase(values);
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.Paint;
import android.graphics.Rect;
-import android.util.DisplayMetrics;
import android.content.res.Resources;
import android.content.Context;
Paint.FILTER_BITMAP_FLAG));
}
- static Bitmap centerToFit(Bitmap bitmap, int width, int height, Context context) {
- final int bitmapWidth = bitmap.getWidth();
- final int bitmapHeight = bitmap.getHeight();
-
- if (bitmapWidth < width || bitmapHeight < height) {
- int color = context.getResources().getColor(R.color.window_background);
-
- Bitmap centered = Bitmap.createBitmap(bitmapWidth < width ? width : bitmapWidth,
- bitmapHeight < height ? height : bitmapHeight, Bitmap.Config.RGB_565);
- centered.setDensity(bitmap.getDensity());
- Canvas canvas = new Canvas(centered);
- canvas.drawColor(color);
- canvas.drawBitmap(bitmap, (width - bitmapWidth) / 2.0f, (height - bitmapHeight) / 2.0f,
- null);
-
- bitmap = centered;
- }
-
- return bitmap;
- }
-
/**
* Returns a Drawable representing the thumbnail of the specified Drawable.
* The size of the thumbnail is defined by the dimension
final int bitmapWidth = bitmap.getWidth();
final int bitmapHeight = bitmap.getHeight();
- if (width > 0 && height > 0 && (width < bitmapWidth || height < bitmapHeight)) {
- final float ratio = (float) bitmapWidth / bitmapHeight;
-
- if (bitmapWidth > bitmapHeight) {
- height = (int) (width / ratio);
- } else if (bitmapHeight > bitmapWidth) {
- width = (int) (height * ratio);
+ if (width > 0 && height > 0) {
+ if (width < bitmapWidth || height < bitmapHeight) {
+ final float ratio = (float) bitmapWidth / bitmapHeight;
+
+ if (bitmapWidth > bitmapHeight) {
+ height = (int) (width / ratio);
+ } else if (bitmapHeight > bitmapWidth) {
+ width = (int) (height * ratio);
+ }
+
+ final Bitmap.Config c = (width == sIconWidth && height == sIconHeight) ?
+ bitmap.getConfig() : Bitmap.Config.ARGB_8888;
+ final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
+ final Canvas canvas = sCanvas;
+ final Paint paint = sPaint;
+ canvas.setBitmap(thumb);
+ paint.setDither(false);
+ paint.setFilterBitmap(true);
+ sBounds.set((sIconWidth - width) / 2, (sIconHeight - height) / 2, width, height);
+ sOldBounds.set(0, 0, bitmapWidth, bitmapHeight);
+ canvas.drawBitmap(bitmap, sOldBounds, sBounds, paint);
+ return thumb;
+ } else if (bitmapWidth < width || bitmapHeight < height) {
+ final Bitmap.Config c = Bitmap.Config.ARGB_8888;
+ final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
+ final Canvas canvas = sCanvas;
+ final Paint paint = sPaint;
+ canvas.setBitmap(thumb);
+ paint.setDither(false);
+ paint.setFilterBitmap(true);
+ canvas.drawBitmap(bitmap, (sIconWidth - bitmapWidth) / 2,
+ (sIconHeight - bitmapHeight) / 2, paint);
+ return thumb;
}
-
- final Bitmap.Config c = (width == sIconWidth && height == sIconHeight) ?
- bitmap.getConfig() : Bitmap.Config.ARGB_8888;
- final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
- final Canvas canvas = sCanvas;
- final Paint paint = sPaint;
- canvas.setBitmap(thumb);
- paint.setDither(false);
- paint.setFilterBitmap(true);
- sBounds.set((sIconWidth - width) / 2, (sIconHeight - height) / 2, width, height);
- sOldBounds.set(0, 0, bitmapWidth, bitmapHeight);
- canvas.drawBitmap(bitmap, sOldBounds, sBounds, paint);
- return thumb;
}
return bitmap;
package com.android.launcher;
import android.app.Activity;
+import android.app.WallpaperManager;
+import android.content.res.Resources;
+import android.graphics.BitmapFactory;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.os.AsyncTask;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
-import android.widget.Button;
import android.widget.Gallery;
import android.widget.ImageView;
-import android.graphics.BitmapFactory;
-import android.graphics.Bitmap;
-import android.graphics.drawable.Drawable;
-import android.content.res.Resources;
import java.io.IOException;
-import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Collections;
public class WallpaperChooser extends Activity implements AdapterView.OnItemSelectedListener,
OnClickListener {
- private static final Integer[] THUMB_IDS = {
- R.drawable.wallpaper_lake_small,
- R.drawable.wallpaper_sunset_small,
- R.drawable.wallpaper_beach_small,
- R.drawable.wallpaper_snow_leopard_small,
- R.drawable.wallpaper_path_small,
- R.drawable.wallpaper_sunrise_small,
- R.drawable.wallpaper_mountain_small,
- R.drawable.wallpaper_road_small,
- R.drawable.wallpaper_jellyfish_small,
- R.drawable.wallpaper_zanzibar_small,
- R.drawable.wallpaper_blue_small,
- R.drawable.wallpaper_grey_small,
- R.drawable.wallpaper_green_small,
- R.drawable.wallpaper_pink_small,
- };
-
- private static final Integer[] IMAGE_IDS = {
- R.drawable.wallpaper_lake,
- R.drawable.wallpaper_sunset,
- R.drawable.wallpaper_beach,
- R.drawable.wallpaper_snow_leopard,
- R.drawable.wallpaper_path,
- R.drawable.wallpaper_sunrise,
- R.drawable.wallpaper_mountain,
- R.drawable.wallpaper_road,
- R.drawable.wallpaper_jellyfish,
- R.drawable.wallpaper_zanzibar,
- R.drawable.wallpaper_blue,
- R.drawable.wallpaper_grey,
- R.drawable.wallpaper_green,
- R.drawable.wallpaper_pink,
- };
-
private Gallery mGallery;
private ImageView mImageView;
private boolean mIsWallpaperSet;
- private BitmapFactory.Options mOptions;
private Bitmap mBitmap;
private ArrayList<Integer> mThumbs;
private ArrayList<Integer> mImages;
+ private WallpaperLoader mLoader;
@Override
public void onCreate(Bundle icicle) {
setContentView(R.layout.wallpaper_chooser);
- mOptions = new BitmapFactory.Options();
- mOptions.inDither = false;
- mOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;
-
mGallery = (Gallery) findViewById(R.id.gallery);
mGallery.setAdapter(new ImageAdapter(this));
mGallery.setOnItemSelectedListener(this);
mGallery.setCallbackDuringFling(false);
- Button b = (Button) findViewById(R.id.set);
- b.setOnClickListener(this);
+ findViewById(R.id.set).setOnClickListener(this);
mImageView = (ImageView) findViewById(R.id.wallpaper);
}
private void findWallpapers() {
- mThumbs = new ArrayList<Integer>(THUMB_IDS.length + 4);
- Collections.addAll(mThumbs, THUMB_IDS);
-
- mImages = new ArrayList<Integer>(IMAGE_IDS.length + 4);
- Collections.addAll(mImages, IMAGE_IDS);
+ mThumbs = new ArrayList<Integer>(24);
+ mImages = new ArrayList<Integer>(24);
final Resources resources = getResources();
- final String[] extras = resources.getStringArray(R.array.extra_wallpapers);
final String packageName = getApplication().getPackageName();
+ addWallpapers(resources, packageName, R.array.wallpapers);
+ addWallpapers(resources, packageName, R.array.extra_wallpapers);
+ }
+
+ private void addWallpapers(Resources resources, String packageName, int list) {
+ final String[] extras = resources.getStringArray(list);
for (String extra : extras) {
int res = resources.getIdentifier(extra, "drawable", packageName);
if (res != 0) {
mIsWallpaperSet = false;
}
- public void onItemSelected(AdapterView parent, View v, int position, long id) {
- final ImageView view = mImageView;
- Bitmap b = BitmapFactory.decodeResource(getResources(), mImages.get(position), mOptions);
- view.setImageBitmap(b);
-
- // Help the GC
- if (mBitmap != null) {
- mBitmap.recycle();
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+
+ if (mLoader != null && mLoader.getStatus() != WallpaperLoader.Status.FINISHED) {
+ mLoader.cancel(true);
+ mLoader = null;
}
- mBitmap = b;
+ }
- final Drawable drawable = view.getDrawable();
- drawable.setFilterBitmap(true);
- drawable.setDither(true);
+ public void onItemSelected(AdapterView parent, View v, int position, long id) {
+ if (mLoader != null && mLoader.getStatus() != WallpaperLoader.Status.FINISHED) {
+ mLoader.cancel();
+ }
+ mLoader = (WallpaperLoader) new WallpaperLoader().execute(position);
}
/*
mIsWallpaperSet = true;
try {
- InputStream stream = getResources().openRawResource(mImages.get(position));
- setWallpaper(stream);
+ WallpaperManager wpm = (WallpaperManager)getSystemService(WALLPAPER_SERVICE);
+ wpm.setResource(mImages.get(position));
setResult(RESULT_OK);
finish();
} catch (IOException e) {
} else {
image = (ImageView) convertView;
}
-
- image.setImageResource(mThumbs.get(position));
- image.getDrawable().setDither(true);
+
+ int thumbRes = mThumbs.get(position);
+ image.setImageResource(thumbRes);
+ Drawable thumbDrawable = image.getDrawable();
+ if (thumbDrawable != null) {
+ thumbDrawable.setDither(true);
+ } else {
+ Log.e(Launcher.LOG_TAG, String.format(
+ "Error decoding thumbnail resId=%d for wallpaper #%d",
+ thumbRes, position));
+ }
return image;
}
}
public void onClick(View v) {
selectWallpaper(mGallery.getSelectedItemPosition());
}
+
+ class WallpaperLoader extends AsyncTask<Integer, Void, Bitmap> {
+ BitmapFactory.Options mOptions;
+
+ WallpaperLoader() {
+ mOptions = new BitmapFactory.Options();
+ mOptions.inDither = false;
+ mOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;
+ }
+
+ protected Bitmap doInBackground(Integer... params) {
+ if (isCancelled()) return null;
+ try {
+ return BitmapFactory.decodeResource(getResources(),
+ mImages.get(params[0]), mOptions);
+ } catch (OutOfMemoryError e) {
+ return null;
+ }
+ }
+
+ @Override
+ protected void onPostExecute(Bitmap b) {
+ if (b == null) return;
+
+ if (!isCancelled() && !mOptions.mCancel) {
+ // Help the GC
+ if (mBitmap != null) {
+ mBitmap.recycle();
+ }
+
+ final ImageView view = mImageView;
+ view.setImageBitmap(b);
+
+ mBitmap = b;
+
+ final Drawable drawable = view.getDrawable();
+ drawable.setFilterBitmap(true);
+ drawable.setDither(true);
+
+ view.postInvalidate();
+
+ mLoader = null;
+ } else {
+ b.recycle();
+ }
+ }
+
+ void cancel() {
+ mOptions.requestCancelDecode();
+ super.cancel(true);
+ }
+ }
}
package com.android.launcher;
+import android.app.WallpaperManager;
import android.content.Context;
import android.content.Intent;
import android.content.ComponentName;
import android.content.res.TypedArray;
-import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.RectF;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
private int mDefaultScreen;
- private Paint mPaint;
- private Bitmap mWallpaper;
-
- private int mWallpaperWidth;
- private int mWallpaperHeight;
- private float mWallpaperOffset;
- private boolean mWallpaperLoaded;
+ private final WallpaperManager mWallpaperManager;
private boolean mFirstLayout = true;
public Workspace(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+ mWallpaperManager = WallpaperManager.getInstance(context);
+
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Workspace, defStyle, 0);
mDefaultScreen = a.getInt(R.styleable.Workspace_defaultScreen, 1);
a.recycle();
mCurrentScreen = mDefaultScreen;
Launcher.setScreen(mCurrentScreen);
- mPaint = new Paint();
- mPaint.setDither(false);
-
final ViewConfiguration configuration = ViewConfiguration.get(getContext());
mTouchSlop = configuration.getScaledTouchSlop();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}
- /**
- * Set the background's wallpaper.
- */
- void loadWallpaper(Bitmap bitmap) {
- mWallpaper = bitmap;
- mWallpaperLoaded = true;
- requestLayout();
- invalidate();
- }
-
@Override
public void addView(View child, int index, LayoutParams params) {
if (!(child instanceof CellLayout)) {
}
/**
- * Computes a bounding rectangle for a range of cells
- *
- * @param cellX X coordinate of upper left corner expressed as a cell position
- * @param cellY Y coordinate of upper left corner expressed as a cell position
- * @param cellHSpan Width in cells
- * @param cellVSpan Height in cells
- * @param rect Rectnagle into which to put the results
- */
- public void cellToRect(int cellX, int cellY, int cellHSpan, int cellVSpan, RectF rect) {
- ((CellLayout)getChildAt(mCurrentScreen)).cellToRect(cellX, cellY,
- cellHSpan, cellVSpan, rect);
- }
-
- /**
* Sets the current screen.
*
* @param currentScreen
}
/**
- * Shows the default screen (defined by the firstScreen attribute in XML.)
- */
- void showDefaultScreen() {
- setCurrentScreen(mDefaultScreen);
- }
-
- /**
* Adds the specified child in the current screen. The position and dimension of
* the child are defined by x, y, spanX and spanY.
*
}
}
- void addWidget(View view, Widget widget) {
- addInScreen(view, widget.screen, widget.cellX, widget.cellY, widget.spanX,
- widget.spanY, false);
- }
-
void addWidget(View view, Widget widget, boolean insert) {
addInScreen(view, widget.screen, widget.cellX, widget.cellY, widget.spanX,
widget.spanY, insert);
}
return null;
}
-
- private void clearVacantCache() {
- if (mVacantCache != null) {
- mVacantCache.clearVacantCells();
- mVacantCache = null;
- }
- }
- /**
- * Returns the coordinate of a vacant cell for the current screen.
- */
- boolean getVacantCell(int[] vacant, int spanX, int spanY) {
+ CellLayout.CellInfo findAllVacantCellsFromModel() {
CellLayout group = (CellLayout) getChildAt(mCurrentScreen);
if (group != null) {
- return group.getVacantCell(vacant, spanX, spanY);
+ int countX = group.getCountX();
+ int countY = group.getCountY();
+ boolean occupied[][] = new boolean[countX][countY];
+ Launcher.getModel().findAllOccupiedCells(occupied, countX, countY, mCurrentScreen);
+ return group.findAllVacantCellsFromOccupied(occupied, countX, countY);
}
- return false;
- }
-
- /**
- * Adds the specified child in the current screen. The position and dimension of
- * the child are defined by x, y, spanX and spanY.
- *
- * @param child The child to add in one of the workspace's screens.
- * @param spanX The number of cells spanned horizontally by the child.
- * @param spanY The number of cells spanned vertically by the child.
- */
- void fitInCurrentScreen(View child, int spanX, int spanY) {
- fitInScreen(child, mCurrentScreen, spanX, spanY);
+ return null;
}
- /**
- * Adds the specified child in the specified screen. The position and dimension of
- * the child are defined by x, y, spanX and spanY.
- *
- * @param child The child to add in one of the workspace's screens.
- * @param screen The screen in which to add the child.
- * @param spanX The number of cells spanned horizontally by the child.
- * @param spanY The number of cells spanned vertically by the child.
- */
- void fitInScreen(View child, int screen, int spanX, int spanY) {
- if (screen < 0 || screen >= getChildCount()) {
- throw new IllegalStateException("The screen must be >= 0 and < " + getChildCount());
- }
-
- final CellLayout group = (CellLayout) getChildAt(screen);
- boolean vacant = group.getVacantCell(mTempCell, spanX, spanY);
- if (vacant) {
- group.addView(child,
- new CellLayout.LayoutParams(mTempCell[0], mTempCell[1], spanX, spanY));
- child.setOnLongClickListener(mLongClickListener);
- if (!(child instanceof Folder)) {
- child.setOnLongClickListener(mLongClickListener);
- }
+ private void clearVacantCache() {
+ if (mVacantCache != null) {
+ mVacantCache.clearVacantCells();
+ mVacantCache = null;
}
}
}
}
+ private void updateWallpaperOffset() {
+ updateWallpaperOffset(getChildAt(getChildCount() - 1).getRight() - (mRight - mLeft));
+ }
+
+ private void updateWallpaperOffset(int scrollRange) {
+ mWallpaperManager.setWallpaperOffsetSteps(1.0f / (getChildCount() - 1), 0 );
+ mWallpaperManager.setWallpaperOffsets(getWindowToken(), mScrollX / (float) scrollRange, 0);
+ }
+
@Override
public void computeScroll() {
if (mScroller.computeScrollOffset()) {
mScrollX = mScroller.getCurrX();
mScrollY = mScroller.getCurrY();
+ updateWallpaperOffset();
postInvalidate();
} else if (mNextScreen != INVALID_SCREEN) {
mCurrentScreen = Math.max(0, Math.min(mNextScreen, getChildCount() - 1));
@Override
public boolean isOpaque() {
- return !mWallpaper.hasAlpha();
+ return false;
}
@Override
top + mDrawerContentHeight, Region.Op.DIFFERENCE);
}
- float x = mScrollX * mWallpaperOffset;
- if (x + mWallpaperWidth < mRight - mLeft) {
- x = mRight - mLeft - mWallpaperWidth;
- }
-
- canvas.drawBitmap(mWallpaper, x, (mBottom - mTop - mWallpaperHeight) / 2, mPaint);
-
// ViewGroup.dispatchDraw() supports many features we don't need:
// clip to padding, layout animation, animation listener, disappearing
// children, etc. The following implementation attempts to fast-track
getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec);
}
- if (mWallpaperLoaded) {
- mWallpaperLoaded = false;
- mWallpaper = Utilities.centerToFit(mWallpaper, width,
- MeasureSpec.getSize(heightMeasureSpec), getContext());
- mWallpaperWidth = mWallpaper.getWidth();
- mWallpaperHeight = mWallpaper.getHeight();
- }
-
- final int wallpaperWidth = mWallpaperWidth;
- mWallpaperOffset = wallpaperWidth > width ? (count * width - wallpaperWidth) /
- ((count - 1) * (float) width) : 1.0f;
-
if (mFirstLayout) {
scrollTo(mCurrentScreen * width, 0);
+ updateWallpaperOffset(width * (getChildCount() - 1));
mFirstLayout = false;
}
}
if (deltaX < 0) {
if (mScrollX > 0) {
scrollBy(Math.max(-mScrollX, deltaX), 0);
+ updateWallpaperOffset();
}
} else if (deltaX > 0) {
final int availableToScroll = getChildAt(getChildCount() - 1).getRight() -
mScrollX - getWidth();
if (availableToScroll > 0) {
scrollBy(Math.min(availableToScroll, deltaX), 0);
+ updateWallpaperOffset();
}
}
}
}
}
- void addApplicationShortcut(ApplicationInfo info, CellLayout.CellInfo cellInfo) {
- addApplicationShortcut(info, cellInfo, false);
- }
-
void addApplicationShortcut(ApplicationInfo info, CellLayout.CellInfo cellInfo,
boolean insertAtFirst) {
final CellLayout layout = (CellLayout) getChildAt(cellInfo.screen);
// Move internally
if (mDragInfo != null) {
final View cell = mDragInfo.cell;
- if (mCurrentScreen != mDragInfo.screen) {
+ int index = mScroller.isFinished() ? mCurrentScreen : mNextScreen;
+ if (index != mDragInfo.screen) {
final CellLayout originalCellLayout = (CellLayout) getChildAt(mDragInfo.screen);
originalCellLayout.removeView(cell);
cellLayout.addView(cell);
final ItemInfo info = (ItemInfo)cell.getTag();
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) cell.getLayoutParams();
LauncherModel.moveItemInDatabase(mLauncher, info,
- LauncherSettings.Favorites.CONTAINER_DESKTOP, mCurrentScreen, lp.cellX, lp.cellY);
+ LauncherSettings.Favorites.CONTAINER_DESKTOP, index, lp.cellX, lp.cellY);
}
}
}
/**
* {@inheritDoc}
*/
- public Rect estimateDropLocation(DragSource source, int x, int y,
- int xOffset, int yOffset, Object dragInfo, Rect recycle) {
+ public Rect estimateDropLocation(int x, int y, int xOffset, int yOffset, Rect recycle) {
final CellLayout layout = getCurrentDropLayout();
final CellLayout.CellInfo cellInfo = mDragInfo;
}
// Find the best target drop location
- return layout.findNearestVacantArea(pixelX, pixelY,
- spanX, spanY, mVacantCache, recycle);
+ return layout.findNearestVacantArea(pixelX, pixelY, spanX, spanY, mVacantCache, recycle);
}
void setLauncher(Launcher launcher) {
}
public void onDropCompleted(View target, boolean success) {
+ // This is a bit expensive but safe
+ clearVacantCache();
+
if (success){
if (target != this && mDragInfo != null) {
final CellLayout cellLayout = (CellLayout) getChildAt(mDragInfo.screen);