Commit d097a188 authored by The Android Open Source Project's avatar The Android Open Source Project
Browse files

Code drop from //branches/cupcake/...@124589

parent c8f00b61
......@@ -17,41 +17,59 @@
** limitations under the License.
*/
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.launcher"
android:sharedUserId="android.uid.shared">
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.launcher"
android:sharedUserId="android.uid.shared">
<permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_install_shortcut"
android:description="@string/permdesc_install_shortcut"/>
<permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_uninstall_shortcut"
android:description="@string/permdesc_uninstall_shortcut"/>
<permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_install_shortcut"
android:description="@string/permdesc_install_shortcut" />
<permission
android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_uninstall_shortcut"
android:description="@string/permdesc_uninstall_shortcut"/>
<permission
android:name="com.android.launcher.permission.READ_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_read_settings"
android:description="@string/permdesc_read_settings"/>
<permission
android:name="com.android.launcher.permission.WRITE_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_write_settings"
android:description="@string/permdesc_write_settings"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
<application
android:name="LauncherApplication"
android:process="android.process.acore"
android:label="@string/application_name"
android:icon="@drawable/ic_launcher_home">
<activity android:name="Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme"
android:configChanges="mcc|mnc">
<activity
android:name="Launcher"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/Theme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
......@@ -60,7 +78,8 @@
</intent-filter>
</activity>
<activity android:name="WallpaperChooser"
<activity
android:name="WallpaperChooser"
android:label="@string/pick_wallpaper"
android:icon="@drawable/ic_launcher_gallery">
<intent-filter>
......@@ -70,21 +89,34 @@
</activity>
<!-- Enable system-default search mode for any activity in Home -->
<meta-data android:name="android.app.default_searchable" android:value="*" />
<meta-data
android:name="android.app.default_searchable"
android:value="*" />
<receiver android:name=".InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<!-- Intent received used to install shortcuts from other applications -->
<receiver
android:name=".InstallShortcutReceiver"
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
</intent-filter>
</receiver>
<receiver android:name=".UninstallShortcutReceiver"
android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
<!-- Intent received used to uninstall shortcuts from other applications -->
<receiver
android:name=".UninstallShortcutReceiver"
android:permission="com.android.launcher.permission.UNINSTALL_SHORTCUT">
<intent-filter>
<action android:name="com.android.launcher.action.UNINSTALL_SHORTCUT" />
</intent-filter>
</receiver>
<!-- The settings provider contains Home's data, like the workspace favorites -->
<provider
android:name="LauncherProvider"
android:authorities="com.android.launcher.settings"
android:writePermission="com.android.launcher.permission.WRITE_SETTINGS"
android:readPermission="com.android.launcher.permission.READ_SETTINGS" />
</application>
</manifest>
res/drawable/google_logo.png

5.81 KB | W: 0px | H: 0px

res/drawable/google_logo.png

3.28 KB | W: 0px | H: 0px

res/drawable/google_logo.png
res/drawable/google_logo.png
res/drawable/google_logo.png
res/drawable/google_logo.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -15,15 +15,17 @@
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="88dip"
android:paddingTop="6dip"
android:paddingBottom="3dip"
android:paddingTop="5dip"
android:paddingBottom="2dip"
android:drawablePadding="0dip"
android:textSize="13dip"
android:maxLines="2"
android:ellipsize="end"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:textColor="@color/bright_text_dark_focused"
android:gravity="top|center_horizontal" />
......@@ -16,6 +16,7 @@
<com.android.launcher.DragLayer
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/drag_layer"
......@@ -30,9 +31,9 @@
launcher:defaultScreen="1">
<include layout="@layout/workspace_screen" />
<include layout="@layout/workspace_screen" />
<include layout="@layout/workspace_screen" />
<include android:id="@+id/cell1" layout="@layout/workspace_screen" />
<include android:id="@+id/cell2" layout="@layout/workspace_screen" />
<include android:id="@+id/cell3" layout="@layout/workspace_screen" />
</com.android.launcher.Workspace>
......@@ -42,19 +43,24 @@
android:layout_height="fill_parent"
android:orientation="horizontal"
android:bottomOffset="7px"
android:handle="@+id/all_apps"
android:content="@+id/content">
<ImageView
androidprv:bottomOffset="7px"
androidprv:handle="@+id/all_apps"
androidprv:content="@+id/content">
<com.android.launcher.HandleView
android:id="@id/all_apps"
android:layout_width="56dip"
android:layout_height="fill_parent"
android:background="@drawable/handle"
android:focusable="true"
android:clickable="true"
android:scaleType="center"
android:src="@drawable/handle_icon"
android:background="@drawable/handle"
android:layout_height="fill_parent"
android:layout_width="56dip" />
launcher:direction="vertical" />
<com.android.launcher.AllAppsGridView
android:id="@id/content"
......
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2008, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<com.android.launcher.LiveFolder xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Button
android:id="@+id/close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:textColor="#404040"
android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<GridView
android:id="@id/content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@drawable/box_launcher_bottom"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="insideInset"
android:drawSelectorOnTop="false"
android:listSelector="@drawable/grid_selector"
android:verticalSpacing="10dip"
android:numColumns="5" />
</com.android.launcher.LiveFolder>
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2008, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<com.android.launcher.LiveFolderIcon xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/WorkspaceIcon.Landscape" />
......@@ -15,15 +15,17 @@
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="88dip"
android:paddingTop="6dip"
android:paddingBottom="3dip"
android:paddingTop="5dip"
android:paddingBottom="2dip"
android:drawablePadding="0dip"
android:textSize="13dip"
android:maxLines="2"
android:ellipsize="end"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:textColor="@color/bright_text_dark_focused"
android:gravity="top|center_horizontal" />
......@@ -16,6 +16,7 @@
<com.android.launcher.DragLayer
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/drag_layer"
......@@ -30,9 +31,9 @@
launcher:defaultScreen="1">
<include layout="@layout/workspace_screen" />
<include layout="@layout/workspace_screen" />
<include layout="@layout/workspace_screen" />
<include android:id="@+id/cell1" layout="@layout/workspace_screen" />
<include android:id="@+id/cell2" layout="@layout/workspace_screen" />
<include android:id="@+id/cell3" layout="@layout/workspace_screen" />
</com.android.launcher.Workspace>
......@@ -41,20 +42,25 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:topOffset="5px"
android:bottomOffset="7px"
android:handle="@+id/all_apps"
android:content="@+id/content">
androidprv:topOffset="5px"
androidprv:bottomOffset="7px"
androidprv:handle="@+id/all_apps"
androidprv:content="@+id/content">
<ImageView
<com.android.launcher.HandleView
android:id="@id/all_apps"
android:layout_width="fill_parent"
android:layout_height="56dip"
android:background="@drawable/handle"
android:focusable="true"
android:clickable="true"
android:scaleType="center"
android:src="@drawable/handle_icon"
android:background="@drawable/handle"
android:layout_width="fill_parent"
android:layout_height="56dip" />
launcher:direction="horizontal" />
<com.android.launcher.AllAppsGridView
android:id="@id/content"
......
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2008, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<com.android.launcher.LiveFolder xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Button
android:id="@+id/close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:textColor="#404040"
android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<GridView
android:id="@id/content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@drawable/box_launcher_bottom"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="insideInset"
android:drawSelectorOnTop="false"
android:listSelector="@drawable/grid_selector"
android:verticalSpacing="10dip"
android:numColumns="4" />
</com.android.launcher.LiveFolder>
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2008, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<com.android.launcher.LiveFolderIcon xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/WorkspaceIcon.Portrait" />
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2008, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:paddingLeft="10dip"
android:orientation="horizontal">
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:scaleType="center" />
<LinearLayout
android:layout_width="0dip"
android:layout_weight="1.0"
android:layout_height="fill_parent"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:orientation="vertical"
android:gravity="center_vertical">
<TextView android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/name"
android:layout_alignLeft="@id/name"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (c) 2008, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<com.android.launcher.LiveFolder xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Button
android:id="@+id/close"
android:background="@drawable/box_launcher_top"
android:gravity="left|center_vertical"
android:textSize="14sp"
android:textColor="#404040"
android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ListView
android:id="@id/content"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:cacheColorHint="#00000000"
android:background="@drawable/box_launcher_bottom" />
</com.android.launcher.LiveFolder>
......@@ -34,15 +34,15 @@
android:hint="@string/search_hint"
android:focusableInTouchMode="false"
android:singleLine="true"
android:selectAllOnFocus="true"
android:completionThreshold="1"
/>
<Button
android:id="@+id/go"
android:layout_marginLeft="4dip"
<ImageButton android:id="@+id/search_go_btn"
android:layout_marginLeft="1dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/go"/>
android:src="@android:drawable/ic_btn_search"
/>
</com.android.launcher.Search>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name">"Startseite"</string>
<string name="folder_name">"Ordner"</string>
<string name="chooser_wallpaper">"Hintergrund auswählen"</string>
<string name="wallpaper_instructions">"Hintergrund festlegen"</string>
<string name="pick_wallpaper">"Galerie"</string>
<string name="activity_not_found">"Anwendung ist nicht auf dem Telefon installiert."</string>
<!-- no translation found for rename_folder_label (5646236631298452787) -->
<skip />
<string name="rename_folder_title">"Ordner umbenennen"</string>
<string name="rename_action">"OK"</string>
<string name="cancel_action">"Abbrechen"</string>
<!-- no translation found for menu_item_add_item (6233177331075781114) -->
<skip />
<string name="group_applications">"Anwendung"</string>
<string name="group_shortcuts">"Verknüpfung"</string>
<!-- no translation found for group_live_folders (3057578584715591220) -->
<skip />
<string name="group_widgets">"Widget"</string>
<string name="group_wallpapers">"Hintergrund"</string>
<string name="add_folder">"Ordner"</string>
<string name="add_clock">"Uhr"</string>
<string name="add_photo_frame">"Bildrahmen"</string>
<string name="add_search">"Suchen"</string>
<string name="out_of_space">"Auf der Startseite ist kein Platz mehr vorhanden."</string>
<string name="menu_add">"Hinzufügen"</string>
<string name="menu_wallpaper">"Hintergrund"</string>
<string name="menu_search">"Suchen"</string>
<string name="menu_notifications">"Benachrichtigungen"</string>
<string name="menu_settings">"Einstellungen"</string>
<string name="permlab_install_shortcut">"Verknüpfungen installieren"</string>
<string name="permdesc_install_shortcut">"Ermöglicht einer Anwendung das Hinzufügen von Verknüpfungen ohne Eingriff des Benutzers."</string>
<string name="permlab_uninstall_shortcut">"Verknüpfungen deinstallieren"</string>
<string name="permdesc_uninstall_shortcut">"Ermöglicht einer Anwendung das Entfernen von Verknüpfungen ohne Eingriff des Benutzers."</string>
<!-- no translation found for permlab_read_settings (3452408290738106747) -->
<skip />
<!-- no translation found for permdesc_read_settings (8377434937176025492) -->
<skip />
<!-- no translation found for permlab_write_settings (1360567537236705628) -->
<skip />
<!-- no translation found for permdesc_write_settings (1098648778383349818) -->
<skip />
<string name="search_hint">"Google-Suche"</string>
</resources>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="application_name">"ホーム"</string>
<string name="folder_name">"フォルダ"</string>
<string name="chooser_wallpaper">"壁紙を選択"</string>
<string name="wallpaper_instructions">"壁紙に設定"</string>
<string name="pick_wallpaper">"壁紙ギャラリー"</string>
<string name="activity_not_found">"アプリケーションがインストールされていません。"</string>
<!-- no translation found for rename_folder_label (5646236631298452787) -->
<skip />
<string name="rename_folder_title">"フォルダ名を変更"</string>
<string name="rename_action">"OK"</string>
<string name="cancel_action">"キャンセル"</string>
<!-- no translation found for menu_item_add_item (6233177331075781114) -->
<skip />
<string name="group_applications">"アプリケーション"</string>
<string name="group_shortcuts">"ショートカット"</string>
<!-- no translation found for group_live_folders (3057578584715591220) -->
<skip />
<string name="group_widgets">"ウィジェット"</string>
<string name="group_wallpapers">"壁紙"</string>
<string name="add_folder">"フォルダ"</string>
<string name="add_clock">"時計"</string>
<string name="add_photo_frame">"写真フレーム"</string>
<string name="add_search">"検索"</string>
<string name="out_of_space">"このホーム画面には空きスペースがありません。"</string>
<string name="menu_add">"追加"</string>
<string name="menu_wallpaper">"壁紙"</string>
<string name="menu_search">"検索"</string>
<string name="menu_notifications">"通知"</string>
<string name="menu_settings">"設定"</string>
<string name="permlab_install_shortcut">"ショートカットのインストール"</string>
<string name="permdesc_install_shortcut">"ユーザー操作なしで、ショートカットをアプリケーションで追加できるようにします。"</string>
<string name="permlab_uninstall_shortcut">"ショートカットのアンインストール"</string>
<string name="permdesc_uninstall_shortcut">"ユーザー操作なしで、ショートカットをアプリケーションで削除できるようにします。"</string>
<!-- no translation found for permlab_read_settings (3452408290738106747) -->
<skip />
<!-- no translation found for permdesc_read_settings (8377434937176025492) -->
<skip />
<!-- no translation found for permlab_write_settings (1360567537236705628) -->
<skip />
<!-- no translation found for permdesc_write_settings (1098648778383349818) -->
<skip />
<string name="search_hint">"Google検索"</string>
</resources>
......@@ -17,6 +17,16 @@
-->
<resources>
<!-- Orientation of a widget. -->
<attr name="direction">
<!-- Vertical widget. -->
<enum name="vertical" value="0" />
<!-- Horizontal widget. -->
<enum name="horizontal" value="1" />
</attr>
<skip />
<!-- Workspace specific attributes. These attributes are used to customize
the workspace in XML files. -->
<declare-styleable name="Workspace">
......@@ -49,12 +59,14 @@
a DeleteZone view in XML files. -->
<declare-styleable name="DeleteZone">
<!-- Orientation of the delete zone. -->
<attr name="direction">
<!-- Vertical delete zone. -->
<enum name="vertical" value="0" />
<!-- Horizontal delete zone. This is the default value. -->
<enum name="horizontal" value="1" />
</attr>
<attr name="direction" />
</declare-styleable>
<!-- HandleView specific attributes. These attributes are used to customize
a HandleView view in XML files. -->
<declare-styleable name="HandleView">
<!-- Orientation of the handle. -->
<attr name="direction" />
</declare-styleable>
</resources>
......@@ -19,52 +19,66 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- General -->
<skip />
<!-- Application name -->
<string name="application_name">Home</string>
<!-- Default folder name -->
<string name="folder_name">Folder</string>
<!-- Unused string -->
<string name="all_apps_folder_name">Applications</string>
<!-- Unused string -->
<string name="delete_name">Delete</string>
<!-- Title of dialog that appears after user selects Wallpaper from menu -->
<string name="chooser_wallpaper">Select wallpaper from</string>
<!-- Button label on Wallpaper Gallery screen; user selects this button to set a specific wallpaper -->
<string name="wallpaper_instructions">Set wallpaper</string>
<!-- Option in "Select wallpaper from" dialog box -->
<string name="pick_wallpaper">Wallpaper gallery</string>
<!--Displayed when user selects a shortcut for an app that was uninstalled -->
<!-- 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>
<!-- Folders -->
<skip />
<!-- Label of Folder name field in Rename folder dialog box -->
<string name="rename_folder_label">Folder name:</string>
<string name="rename_folder_label">Folder name</string>
<!-- Title of dialog box -->
<string name="rename_folder_title">Rename folder</string>
<!-- Buttons in Rename folder dialog box: -->
<!-- Buttons in Rename folder dialog box -->
<string name="rename_action">OK</string>
<!-- Buttons in Rename folder dialog box -->
<string name="cancel_action">Cancel</string>
<!-- Shortcuts -->
<skip />
<!-- Title of dialog box -->
<string name="menu_item_add_item">Add to Home</string>
<!-- Options in "Add to Home" dialog box: -->
<string name="menu_item_add_item">Add to Home screen</string>
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all apps -->
<string name="group_applications">Application</string>
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all shortcuts -->
<string name="group_shortcuts">Shortcut</string>
<string name="group_live_folders">Live folder</string>
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of all widgets -->
<string name="group_widgets">Widget</string>
<!-- Options in "Add to Home" dialog box; Title of the group containing the list of apps that can set the wallpaper-->
<string name="group_wallpapers">Wallpaper</string>
<!-- Options in "Add to Home" dialog box; Name of the Folder widget-->
<string name="add_folder">Folder</string>
<!-- Options in "Add to Home" dialog box; Name of the Clock widget-->
<string name="add_clock">Clock</string>
<!-- Options in "Add to Home" dialog box; Name of the Picture frame widget-->
<string name="add_photo_frame">Picture frame</string>
<!-- Options in "Add to Home" dialog box; Name of the Google Search widget-->
<string name="add_search">Search</string>
<!-- 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>
<!-- Menus items: -->
<skip />
<!-- Verb, menu item used to add an item on the desktop -->
<string name="menu_add">Add</string>
<!-- Noun, menu item used to set the desktop's wallpaper -->
<string name="menu_wallpaper">Wallpaper</string>
<!-- Verb, menu item used to initiate a Google Search -->
<string name="menu_search">Search</string>
<!-- Noun, menu item used to bring down the notifications shade -->
<string name="menu_notifications">Notifications</string>
<!-- Noun, menu item used to show the system settings -->
<string name="menu_settings">Settings</string>
<!-- Permissions: -->
......@@ -74,9 +88,18 @@
<string name="permlab_uninstall_shortcut">uninstall shortcuts</string>
<string name="permdesc_uninstall_shortcut">Allows an application to remove
shortcuts without user intervention.</string>
<string name="permlab_read_settings">read Home settings and shortcuts</string>
<string name="permdesc_read_settings">Allows an application to read the settings and
shortcuts in Home.</string>
<string name="permlab_write_settings">write Home settings and shortcuts</string>
<string name="permdesc_write_settings">Allows an application to change the settings and
shortcuts in Home.</string>
<!-- Widgets: -->
<string name="go">Search</string>
<skip />
<!-- This is the hint text shown in the search widget, before text is entered.
This translation SHOULD MATCH the string "search_hint" which is found in
GoogleSearch/res/values/strings.xml -->
<string name="search_hint">Google Search</string>
</resources>
......@@ -26,7 +26,7 @@
<style name="WorkspaceIcon">
<item name="android:textSize">13dip</item>
<item name="android:singleLine">true</item>
<item name="android:ellipsize">end</item>
<item name="android:ellipsize">marquee</item>
<item name="android:shadowColor">#FF000000</item>
<item name="android:shadowRadius">2.0</item>
<item name="android:textColor">#FFF</item>
......
......@@ -28,6 +28,7 @@ import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.BaseExpandableListAdapter;
import android.graphics.drawable.Drawable;
import android.provider.LiveFolders;
import java.util.ArrayList;
import java.util.Collections;
......@@ -40,9 +41,11 @@ public final class AddAdapter extends BaseExpandableListAdapter {
private static final int GROUP_APPLICATIONS = 0;
private static final int GROUP_SHORTCUTS = 1;
private static final int GROUP_WIDGETS = 2;
private static final int GROUP_WALLPAPERS = 3;
private static final int GROUP_LIVE_FOLDERS = 3;
private static final int GROUP_WALLPAPERS = 4;
private final Intent mCreateShortcutIntent;
private final Intent mCreateLiveFolderIntent;
private Intent mSetWallpaperIntent;
private final LayoutInflater mInflater;
private Launcher mLauncher;
......@@ -52,7 +55,7 @@ public final class AddAdapter extends BaseExpandableListAdapter {
* Abstract class representing one thing that can be added
*/
public abstract class AddAction implements Runnable {
private final Context mContext;
protected final Context mContext;
AddAction(Context context) {
mContext = context;
......@@ -110,8 +113,9 @@ public final class AddAdapter extends BaseExpandableListAdapter {
mLabel = info.activityInfo.name;
}
}
if (mIcon == null) {
mIcon = info.loadIcon(pm);
mIcon = Utilities.createIconThumbnail(info.loadIcon(pm), mContext);
}
text.setText(mLabel);
......@@ -126,12 +130,32 @@ public final class AddAdapter extends BaseExpandableListAdapter {
mLauncher.addShortcut(intent);
}
}
/**
* Class representing an action that will create a specific type
* of live folder
*/
public class CreateLiveFolderAction extends CreateShortcutAction {
CreateLiveFolderAction(Context context, ResolveInfo info) {
super(context, info);
}
@Override
public void run() {
Intent intent = new Intent(mCreateLiveFolderIntent);
ActivityInfo activityInfo = mInfo.activityInfo;
intent.setComponent(new ComponentName(activityInfo.applicationInfo.packageName,
activityInfo.name));
mLauncher.addLiveFolder(intent);
}
}
/**
* Class representing an action that will add a folder
*/
public class CreateFolderAction extends AddAction {
private Drawable mIcon;
CreateFolderAction(Context context) {
super(context);
}
......@@ -140,8 +164,8 @@ public final class AddAdapter extends BaseExpandableListAdapter {
public void bindView(View view) {
TextView text = (TextView) view;
text.setText(R.string.add_folder);
text.setCompoundDrawablesWithIntrinsicBounds(getIcon(R.drawable.ic_launcher_folder),
null, null, null);
if (mIcon == null) mIcon = getIcon(R.drawable.ic_launcher_folder);
text.setCompoundDrawablesWithIntrinsicBounds(mIcon, null, null, null);
}
public void run() {
......@@ -175,6 +199,8 @@ public final class AddAdapter extends BaseExpandableListAdapter {
* Class representing an action that will add a PhotoFrame
*/
public class CreatePhotoFrameAction extends AddAction {
private Drawable mIcon;
CreatePhotoFrameAction(Context context) {
super(context);
}
......@@ -183,8 +209,8 @@ public final class AddAdapter extends BaseExpandableListAdapter {
public void bindView(View view) {
TextView text = (TextView) view;
text.setText(R.string.add_photo_frame);
Drawable icon = getIcon(R.drawable.ic_launcher_gallery);
text.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
if (mIcon == null) mIcon = getIcon(R.drawable.ic_launcher_gallery);
text.setCompoundDrawablesWithIntrinsicBounds(mIcon, null, null, null);
}
public void run() {
......@@ -197,6 +223,8 @@ public final class AddAdapter extends BaseExpandableListAdapter {
* Class representing an action that will add a Search widget
*/
public class CreateSearchAction extends AddAction {
private Drawable mIcon;
CreateSearchAction(Context context) {
super(context);
}
......@@ -205,8 +233,8 @@ public final class AddAdapter extends BaseExpandableListAdapter {
public void bindView(View view) {
TextView text = (TextView) view;
text.setText(R.string.add_search);
Drawable icon = getIcon(R.drawable.ic_search_gadget);
text.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);
if (mIcon == null) mIcon = getIcon(R.drawable.ic_search_gadget);
text.setCompoundDrawablesWithIntrinsicBounds(mIcon, null, null, null);
}
public void run() {
......@@ -296,22 +324,27 @@ public final class AddAdapter extends BaseExpandableListAdapter {
mCreateShortcutIntent = new Intent(Intent.ACTION_CREATE_SHORTCUT);
mCreateShortcutIntent.setComponent(null);
mCreateLiveFolderIntent = new Intent(LiveFolders.ACTION_CREATE_LIVE_FOLDER);
mCreateLiveFolderIntent.setComponent(null);
mSetWallpaperIntent = new Intent(Intent.ACTION_SET_WALLPAPER);
mSetWallpaperIntent.setComponent(null);
mLauncher = launcher;
mInflater = (LayoutInflater) launcher.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mGroups = new Group[forFolder ? 2 : 4];
mGroups = new Group[forFolder ? 2 : 5];
final Group[] groups = mGroups;
groups[GROUP_APPLICATIONS] = new ApplicationsGroup(mLauncher,
mLauncher.getString(R.string.group_applications));
groups[GROUP_SHORTCUTS] = new Group(mLauncher.getString(R.string.group_shortcuts));
groups[GROUP_LIVE_FOLDERS] = new Group(mLauncher.getString(R.string.group_live_folders));
if (!forFolder) {
groups[GROUP_WALLPAPERS] = new Group(mLauncher.getString(R.string.group_wallpapers));
groups[GROUP_SHORTCUTS].add(new CreateFolderAction(launcher));
groups[GROUP_WIDGETS] = new Group(mLauncher.getString(R.string.group_widgets));
final Group widgets = groups[GROUP_WIDGETS];
widgets.add(new CreateClockAction(launcher));
widgets.add(new CreatePhotoFrameAction(launcher));
......@@ -330,6 +363,16 @@ public final class AddAdapter extends BaseExpandableListAdapter {
}
}
list = findTargetsForIntent(mCreateLiveFolderIntent, packageManager);
if (list != null && list.size() > 0) {
int count = list.size();
final Group shortcuts = groups[GROUP_LIVE_FOLDERS];
for (int i = 0; i < count; i++) {
ResolveInfo resolveInfo = list.get(i);
shortcuts.add(new CreateLiveFolderAction(launcher, resolveInfo));
}
}
list = findTargetsForIntent(mSetWallpaperIntent, packageManager);
if (list != null && list.size() > 0) {
int count = list.size();
......
......@@ -20,9 +20,7 @@ import android.content.ComponentName;
import android.content.ContentValues;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import com.android.internal.provider.Settings;
/**
* Represents a launchable application. An application is made of a name (or title),
......@@ -63,7 +61,7 @@ class ApplicationInfo extends ItemInfo {
Intent.ShortcutIconResource iconResource;
ApplicationInfo() {
itemType = Settings.Favorites.ITEM_TYPE_SHORTCUT;
itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
}
public ApplicationInfo(ApplicationInfo info) {
......@@ -82,7 +80,7 @@ class ApplicationInfo extends ItemInfo {
/**
* Creates the application intent based on a component name and various launch flags.
* Sets {@link #itemType} to {@link Settings.Favorites#ITEM_TYPE_APPLICATION}.
* Sets {@link #itemType} to {@link LauncherSettings.Favorites#ITEM_TYPE_APPLICATION}.
*
* @param className the class name of the component representing the intent
* @param launchFlags the launch flags
......@@ -92,7 +90,7 @@ class ApplicationInfo extends ItemInfo {
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(className);
intent.setFlags(launchFlags);
itemType = Settings.Favorites.ITEM_TYPE_APPLICATION;
itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
}
@Override
......@@ -100,20 +98,22 @@ class ApplicationInfo extends ItemInfo {
super.onAddToDatabase(values);
String titleStr = title != null ? title.toString() : null;
values.put(Settings.Favorites.TITLE, titleStr);
values.put(LauncherSettings.Favorites.TITLE, titleStr);
String uri = intent != null ? intent.toURI() : null;
values.put(Settings.Favorites.INTENT, uri);
values.put(LauncherSettings.Favorites.INTENT, uri);
if (customIcon) {
values.put(Settings.Favorites.ICON_TYPE, Settings.Favorites.ICON_TYPE_BITMAP);
Bitmap bitmap = ((BitmapDrawable) icon).getBitmap();
values.put(LauncherSettings.Favorites.ICON_TYPE,
LauncherSettings.Favorites.ICON_TYPE_BITMAP);
Bitmap bitmap = ((FastBitmapDrawable) icon).getBitmap();
writeBitmap(values, bitmap);
} else {
values.put(Settings.Favorites.ICON_TYPE, Settings.Favorites.ICON_TYPE_RESOURCE);
values.put(LauncherSettings.Favorites.ICON_TYPE,
LauncherSettings.Favorites.ICON_TYPE_RESOURCE);
if (iconResource != null) {
values.put(Settings.Favorites.ICON_PACKAGE, iconResource.packageName);
values.put(Settings.Favorites.ICON_RESOURCE, iconResource.resourceName);
values.put(LauncherSettings.Favorites.ICON_PACKAGE, iconResource.packageName);
values.put(LauncherSettings.Favorites.ICON_RESOURCE, iconResource.resourceName);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment