summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-09-24 14:38:15 -0700
committerSteve Howard <showard@google.com>2010-09-26 13:36:47 -0700
commitb8bb84731680870be05ea422eb1d269e24a9c660 (patch)
tree8775735e3e4281bdc2a658f4ea823420fddaddfa
parentee6fbe24c53dfac1b1593f6c988931bfe272c262 (diff)
downloadandroid_packages_providers_DownloadProvider-b8bb84731680870be05ea422eb1d269e24a9c660.tar.gz
android_packages_providers_DownloadProvider-b8bb84731680870be05ea422eb1d269e24a9c660.tar.bz2
android_packages_providers_DownloadProvider-b8bb84731680870be05ea422eb1d269e24a9c660.zip
UI + string tweaks for downloads UI + size limits UI
* tweaks to UI strings based on feedback * new "retry" button for single selection of failed download * make SizeLimitActivity translucent+titleless, so it looks like a dialog over the current app Change-Id: I6a990275880d23ab6b4368d39b70f0ad042825ec
-rw-r--r--AndroidManifest.xml3
-rw-r--r--res/values/strings.xml40
-rw-r--r--res/values/styles.xml21
-rw-r--r--ui/res/layout/download_list.xml6
-rw-r--r--ui/src/com/android/providers/downloads/ui/DownloadList.java15
5 files changed, 63 insertions, 22 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index fa519721..0db696b7 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -79,6 +79,7 @@
</receiver>
<activity android:name=".SizeLimitActivity"
- android:launchMode="singleTask" />
+ android:launchMode="singleTask"
+ android:theme="@style/Theme.Translucent"/>
</application>
</manifest>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 46bf82a9..e7629cc1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -146,52 +146,50 @@
<string name="notification_download_failed">Download unsuccessful</string>
<!-- When a download is paused because it's too large to download over a
- mobile connection, and wifi is unavailable, this string is displayed in
+ mobile connection, and Wi-Fi is unavailable, this string is displayed in
the system notification for the running download, beneath the download
title and description. Note that such a download could have been
initiated by a variety of applications, including (but not limited to)
the browser, an email application, a content marketplace.
[CHAR LIMIT=24] -->
- <string name="notification_need_wifi_for_size">Need wifi due to size</string>
+ <string name="notification_need_wifi_for_size">Download size requires Wi-Fi</string>
<!-- Title for dialog when a download exceeds the carrier-specified maximum size of downloads
- over the mobile network and WiFi is required. The user has the choice to either queue the
- download to start next time WiFi is available or cancel the download altogether. [CHAR
+ over the mobile network and Wi-Fi is required. The user has the choice to either queue the
+ download to start next time Wi-Fi is available or cancel the download altogether. [CHAR
LIMIT=50] -->
- <string name="wifi_required_title">Download too large for operator network</string>
+ <string name="wifi_required_title">Download too large for mobile network</string>
<!-- Text for dialog when a download exceeds the carrier-specified maximum size of downloads
- over the mobile network and WiFi is required. The user has the choice to either queue the
- download to start next time WiFi is available or cancel the download altogether. [CHAR
+ over the mobile network and Wi-Fi is required. The user has the choice to either queue the
+ download to start next time Wi-Fi is available or cancel the download altogether. [CHAR
LIMIT=200] -->
- <string name="wifi_required_body">You must use WiFi to complete this <xliff:g id="size"
- example="12.3KB">%s</xliff:g> download.\n\nClick \"<xliff:g id="queue_text"
- example="Queue">%s</xliff:g>\" below to begin this download the next time you are connected
- to a WiFi network.</string>
+ <string name="wifi_required_body">You can\'t download a <xliff:g id="size" example="12.3KB">%s
+ </xliff:g> file on this mobile network.\n\nTouch <xliff:g id="queue_text" example="Queue">%s
+ </xliff:g> to download this file when next connected to a Wi-Fi network.</string>
<!-- Title for dialog when a download exceeds the carrier-specified recommended maximum size of
downloads over the mobile network, and the user may choose to start the download over mobile
- anyway or to queue for download to start next time a WiFi connection is available [CHAR
+ anyway or to queue for download to start next time a Wi-Fi connection is available [CHAR
LIMIT=50] -->
- <string name="wifi_recommended_title">Queue for download later?</string>
+ <string name="wifi_recommended_title">Queue for Wi-Fi download?</string>
<!-- Text for dialog when a download exceeds the carrier-specified recommended maximum size of
downloads over the mobile network, and the user may choose to start the download over mobile
- anyway or to queue for download to start next time a WiFi connection is available [CHAR
+ anyway or to queue for download to start next time a Wi-Fi connection is available [CHAR
LIMIT=200] -->
- <string name="wifi_recommended_body">Starting this <xliff:g id="size" example="12.3KB">%s
- </xliff:g> download now may shorten your battery life and/or result in excessive usage of
- your mobile data connection, which can lead to charges by your mobile operator depending on
- your data plan.\n\nClick \"<xliff:g id="queue_text" example="Queue">%s</xliff:g>\" below to
- begin this download the next time you are connected to a WiFi network.</string>
+ <string name="wifi_recommended_body">Downloading this <xliff:g id="size" example="12.3KB">%s
+ </xliff:g> file on this mobile network risks draining your battery and extra charges from
+ your carrier.\n\nTouch <xliff:g id="queue_text" example="Queue">%s</xliff:g> to download
+ this file when next connected to a Wi-Fi network.</string>
- <!-- Text for button to queue a download to start next time WiFi is available [CHAR LIMIT=25]
+ <!-- Text for button to queue a download to start next time Wi-Fi is available [CHAR LIMIT=25]
-->
<string name="button_queue_for_wifi">Queue</string>
<!-- Text for button to cancel a download because it's too large to proceed over the mobile
- network and the user does not want to queue it for WiFi [CHAR LIMIT=25] -->
+ network and the user does not want to queue it for Wi-Fi [CHAR LIMIT=25] -->
<string name="button_cancel_download">Cancel</string>
<!-- Text for button to start a download over the mobile connection now, even though it's over
diff --git a/res/values/styles.xml b/res/values/styles.xml
new file mode 100644
index 00000000..ec662d42
--- /dev/null
+++ b/res/values/styles.xml
@@ -0,0 +1,21 @@
+<?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>
+ <style name="Theme.Translucent" parent="android:style/Theme.Translucent">
+ <item name="android:windowNoTitle">true</item>
+ </style>
+</resources>
diff --git a/ui/res/layout/download_list.xml b/ui/res/layout/download_list.xml
index 696030ff..42295f4d 100644
--- a/ui/res/layout/download_list.xml
+++ b/ui/res/layout/download_list.xml
@@ -55,6 +55,12 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"/>
+ <Button android:id="@+id/selection_retry"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:text="@string/retry_download"
+ android:visibility="gone"/>
<Button android:id="@+id/deselect_all"
android:layout_width="wrap_content"
android:layout_height="match_parent"
diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java
index 83bc1027..ac733901 100644
--- a/ui/src/com/android/providers/downloads/ui/DownloadList.java
+++ b/ui/src/com/android/providers/downloads/ui/DownloadList.java
@@ -70,6 +70,7 @@ public class DownloadList extends Activity
private View mEmptyView;
private ViewGroup mSelectionMenuView;
private Button mSelectionDeleteButton;
+ private Button mSelectionRestartButton;
private DownloadManager mDownloadManager;
private Cursor mDateSortedCursor;
@@ -167,6 +168,8 @@ public class DownloadList extends Activity
mSelectionMenuView = (ViewGroup) findViewById(R.id.selection_menu);
mSelectionDeleteButton = (Button) findViewById(R.id.selection_delete);
mSelectionDeleteButton.setOnClickListener(this);
+ mSelectionRestartButton = (Button) findViewById(R.id.selection_retry);
+ mSelectionRestartButton.setOnClickListener(this);
((Button) findViewById(R.id.deselect_all)).setOnClickListener(this);
}
@@ -477,6 +480,7 @@ public class DownloadList extends Activity
* Set up the contents of the selection menu based on the current selection.
*/
private void updateSelectionMenu() {
+ mSelectionRestartButton.setVisibility(View.GONE);
int deleteButtonStringId = R.string.delete_download;
if (mSelectedIds.size() == 1) {
Cursor cursor = mDownloadManager.query(new DownloadManager.Query()
@@ -485,6 +489,10 @@ public class DownloadList extends Activity
cursor.moveToFirst();
switch (cursor.getInt(mStatusColumnId)) {
case DownloadManager.STATUS_FAILED:
+ deleteButtonStringId = R.string.remove_download;
+ mSelectionRestartButton.setVisibility(View.VISIBLE);
+ break;
+
case DownloadManager.STATUS_PENDING:
deleteButtonStringId = R.string.remove_download;
break;
@@ -511,6 +519,13 @@ public class DownloadList extends Activity
clearSelection();
break;
+ case R.id.selection_retry:
+ for (Long downloadId : mSelectedIds) {
+ mDownloadManager.restartDownload(downloadId);
+ }
+ clearSelection();
+ break;
+
case R.id.deselect_all:
clearSelection();
break;