diff options
author | Steve Howard <showard@google.com> | 2010-09-01 18:21:32 -0700 |
---|---|---|
committer | Steve Howard <showard@google.com> | 2010-09-08 16:18:59 -0700 |
commit | 217149efdc4a559c38442da179f548e125c0afc5 (patch) | |
tree | a7bc0486913bf0bc735d91ac073e8e32ea2c02db /ui/res | |
parent | 6951c6304f5acad616652c0efc3f59ec4ec2a7e5 (diff) | |
download | android_packages_providers_DownloadProvider-217149efdc4a559c38442da179f548e125c0afc5.tar.gz android_packages_providers_DownloadProvider-217149efdc4a559c38442da179f548e125c0afc5.tar.bz2 android_packages_providers_DownloadProvider-217149efdc4a559c38442da179f548e125c0afc5.zip |
First pass at new system UI for download manager.
This is the initial checkin for a new system UI for the download
manager. This UI shows all entries present in the Download Manager
database, sorted by either date or size. It allows the user to
monitor status, open files, and delete/cancel entries.
The code was initially copied from the "Downloads" page of
packages/apps/Browser, since the design is based on that UI. Much of
the code is changed, although DateSortedExpandableListAdapter is
nearly identical.
The code is not quite finished, but this is very much a working first
pass.
Change-Id: I7fe102e9f2998e57d893cc3c0f5f6da1cf2db549
Diffstat (limited to 'ui/res')
-rw-r--r-- | ui/res/anim/footer_appear.xml | 25 | ||||
-rw-r--r-- | ui/res/anim/footer_disappear.xml | 25 | ||||
-rw-r--r-- | ui/res/drawable-hdpi/ic_launcher_drm_file.png | bin | 0 -> 4501 bytes | |||
-rw-r--r-- | ui/res/drawable-mdpi/ic_launcher_drm_file.png | bin | 0 -> 2738 bytes | |||
-rw-r--r-- | ui/res/layout/download_list.xml | 61 | ||||
-rw-r--r-- | ui/res/layout/download_list_item.xml | 81 | ||||
-rw-r--r-- | ui/res/layout/list_group_header.xml | 23 | ||||
-rw-r--r-- | ui/res/menu/download_menu.xml | 24 | ||||
-rw-r--r-- | ui/res/values/dimen.xml | 19 | ||||
-rw-r--r-- | ui/res/values/strings.xml | 78 |
10 files changed, 336 insertions, 0 deletions
diff --git a/ui/res/anim/footer_appear.xml b/ui/res/anim/footer_appear.xml new file mode 100644 index 00000000..aacfd035 --- /dev/null +++ b/ui/res/anim/footer_appear.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** Copyright 2010, 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. +*/ +--> + +<set xmlns:android="http://schemas.android.com/apk/res/android" > + <translate + android:interpolator="@android:anim/decelerate_interpolator" + android:fromYDelta="+12%p" + android:toYDelta="0" + android:duration="300" /> +</set> diff --git a/ui/res/anim/footer_disappear.xml b/ui/res/anim/footer_disappear.xml new file mode 100644 index 00000000..d87be6ab --- /dev/null +++ b/ui/res/anim/footer_disappear.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** Copyright 2010, 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. +*/ +--> + +<set xmlns:android="http://schemas.android.com/apk/res/android" > + <translate + android:interpolator="@android:anim/decelerate_interpolator" + android:fromYDelta="0" + android:toYDelta="+12%p" + android:duration="300" /> +</set> diff --git a/ui/res/drawable-hdpi/ic_launcher_drm_file.png b/ui/res/drawable-hdpi/ic_launcher_drm_file.png Binary files differnew file mode 100644 index 00000000..9df1c556 --- /dev/null +++ b/ui/res/drawable-hdpi/ic_launcher_drm_file.png diff --git a/ui/res/drawable-mdpi/ic_launcher_drm_file.png b/ui/res/drawable-mdpi/ic_launcher_drm_file.png Binary files differnew file mode 100644 index 00000000..57378b23 --- /dev/null +++ b/ui/res/drawable-mdpi/ic_launcher_drm_file.png diff --git a/ui/res/layout/download_list.xml b/ui/res/layout/download_list.xml new file mode 100644 index 00000000..241bb3d3 --- /dev/null +++ b/ui/res/layout/download_list.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2010, 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="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + <!-- The main area showing the list of downloads --> + <FrameLayout android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1"> + <ExpandableListView android:id="@+id/date_ordered_list" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + <ListView android:id="@+id/size_ordered_list" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + <TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/empty" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:text="@string/no_downloads" + android:gravity="center" + android:textStyle="bold"/> + </FrameLayout> + + <!-- The selection menu that pops up from the bottom of the screen --> + <LinearLayout android:id="@+id/selection_menu" + android:orientation="horizontal" + android:visibility="gone" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="5dip" + android:paddingLeft="4dip" + android:paddingRight="4dip" + android:paddingBottom="1dip" + android:gravity="center" + android:background="@android:drawable/bottom_bar"> + <Button android:id="@+id/selection_delete" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:textAppearance="?android:attr/textAppearanceMedium" + android:paddingLeft="30dip" + android:paddingRight="30dip"/> + </LinearLayout> +</LinearLayout> diff --git a/ui/res/layout/download_list_item.xml b/ui/res/layout/download_list_item.xml new file mode 100644 index 00000000..9c3b3dae --- /dev/null +++ b/ui/res/layout/download_list_item.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2010, 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.providers.downloads.ui.DownloadItem + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingRight="?android:attr/scrollbarSize" + android:descendantFocusability="blocksDescendants"> + + <!-- Clicks are handled directly by DownloadItem --> + <CheckBox android:id="@+id/download_checkbox" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:scaleType="fitCenter" + android:clickable="false"/> + + <ImageView android:id="@+id/download_icon" + android:layout_width="@android:dimen/app_icon_size" + android:layout_height="@android:dimen/app_icon_size" + android:layout_alignParentTop="true" + android:layout_toRightOf="@id/download_checkbox" + android:scaleType="fitCenter" /> + + <TextView android:id="@+id/download_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_toRightOf="@id/download_icon" + android:maxLines="1" + android:textAppearance="?android:attr/textAppearanceMedium" /> + <TextView android:id="@+id/domain" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/download_title" + android:layout_toRightOf="@id/download_icon" + android:maxLines="1" + android:textAppearance="?android:attr/textAppearanceSmall" /> + + <TextView android:id="@+id/last_modified_date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/domain" + android:layout_alignParentRight="true" + android:maxLines="1" + android:textAppearance="?android:attr/textAppearanceSmall" /> + + <TextView android:id="@+id/status_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/domain" + android:layout_toRightOf="@id/download_icon" + android:textAppearance="?android:attr/textAppearanceSmall" /> + <TextView android:id="@+id/size_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/domain" + android:layout_toRightOf="@id/status_text" + android:maxLines="1" + android:textAppearance="?android:attr/textAppearanceSmall" + android:paddingLeft="15dp"/> +</com.android.providers.downloads.ui.DownloadItem> + diff --git a/ui/res/layout/list_group_header.xml b/ui/res/layout/list_group_header.xml new file mode 100644 index 00000000..984b4142 --- /dev/null +++ b/ui/res/layout/list_group_header.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:attr/listPreferredItemHeight" + android:textAppearance="?android:attr/textAppearanceMedium" + android:paddingLeft="35dip" + android:gravity="center_vertical"/> diff --git a/ui/res/menu/download_menu.xml b/ui/res/menu/download_menu.xml new file mode 100644 index 00000000..f09f5c70 --- /dev/null +++ b/ui/res/menu/download_menu.xml @@ -0,0 +1,24 @@ +<?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. +--> + +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/download_menu_sort_by_size" + android:title="@string/download_menu_sort_by_size" + android:icon="@android:drawable/ic_menu_sort_by_size" /> + <item android:id="@+id/download_menu_sort_by_date" + android:title="@string/download_menu_sort_by_date" + android:icon="@android:drawable/ic_menu_day" /> +</menu> diff --git a/ui/res/values/dimen.xml b/ui/res/values/dimen.xml new file mode 100644 index 00000000..6e48f132 --- /dev/null +++ b/ui/res/values/dimen.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 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="checkmark_area">40dip</dimen> +</resources> diff --git a/ui/res/values/strings.xml b/ui/res/values/strings.xml new file mode 100644 index 00000000..5bebb3ca --- /dev/null +++ b/ui/res/values/strings.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- The name of the application that appears in the launcher [CHAR LIMIT=15] --> + <string name="app_label">Downloads</string> + <!-- The title that appears at the top of the activity listing downloads [CHAR LIMIT=25] --> + <string name="download_title">Downloads</string> + + <!-- Appears in lieu of the list of downloads if there are no downloads to view + [CHAR LIMIT=200] --> + <string name="no_downloads">No downloads.</string> + + <!-- Menu items --> + + <!-- Menu option to sort the list of downloads by the size of the downloaded file + [CHAR LIMIT=25] --> + <string name="download_menu_sort_by_size">Sort by size</string> + <!-- Menu option to sort the list of downloads by the date/time of the last activity related to + the download [CHAR LIMIT=25] --> + <string name="download_menu_sort_by_date">Sort by date</string> + + <!-- Status messages --> + + <!-- Status indicating that the download has not yet begun. Appears for an individual item in + the download list. [CHAR LIMIT=11] --> + <string name="download_pending">Queued</string> + <!-- Status indicating that the system is currently downloading the file. Appears for an + individual item in the download list. [CHAR LIMIT=11] --> + <string name="download_running">In progress</string> + <!-- Status indicating that the download has completed successfully. Appears for an individual + item in the download list. [CHAR LIMIT=11] --> + <string name="download_success">Complete</string> + <!-- Status indicating that the download has ended without completing successfully. Appears for + an individual item in the download list. [CHAR LIMIT=11] --> + <string name="download_error">Failed</string> + + <!-- Dialog/toast messages --> + + <!-- Title of dialog that is shown when the user clicks a download for which no file is + available, either because the download hasn't started or because the download failed + [CHAR LIMIT=25] --> + <string name="dialog_title_not_available">File not available</string> + <!-- Text for dialog when user clicks on a download that failed [CHAR LIMIT=200] --> + <string name="dialog_failed_body">This download was unsuccessful. </string> + <!-- Text for dialog when user clicks on a download that has not yet begun, but will be started + in the future. [CHAR LIMIT=200] --> + <string name="dialog_queued_body">This file is queued for future download.</string> + <!-- Text for a toast appearing when a user clicks on a completed download, informing the user + that there is no application on the device that can open the file that was downloaded + [CHAR LIMIT=200] --> + <string name="download_no_application_title">Cannot open file</string> + + <!-- Buttons --> + + <!-- Text for button to remove the entry for a download that has not yet begun or that has + failed [CHAR LIMIT=25] --> + <string name="remove_download">Remove</string> + <!-- Text for button to delete a download that has completed, or to delete multiple download + entries [CHAR LIMIT=25] --> + <string name="delete_download">Delete</string> + <!-- Text for button to keep a download that has not yet begun [CHAR LIMIT=25] --> + <string name="keep_queued_download">Keep</string> + <!-- Text for button to cancel a download that is currently in progress [CHAR LIMIT=25] --> + <string name="cancel_running_download">Cancel</string> +</resources> |