From 3c3ed3c1488c2ebfd2b66a3cdf09b3e312883159 Mon Sep 17 00:00:00 2001 From: Vasu Nori Date: Fri, 15 Oct 2010 15:23:12 -0700 Subject: bug:3083060 UI tweaks to DownloadManager screens Change-Id: I3c7ee819077d344072deee4cfd61f883c64da758 --- res/values/strings.xml | 22 ++++++++++++--------- .../drawable-hdpi/ic_download_misc_file_type.png | Bin 0 -> 2405 bytes .../drawable-mdpi/ic_download_misc_file_type.png | Bin 0 -> 1624 bytes ui/res/layout/download_list.xml | 12 ++++------- ui/res/layout/download_list_item.xml | 16 +++++++++++---- ui/res/layout/list_group_header.xml | 3 ++- ui/res/values/strings.xml | 8 ++++++-- .../providers/downloads/ui/DownloadAdapter.java | 9 +++++---- .../providers/downloads/ui/DownloadList.java | 20 ++++--------------- 9 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 ui/res/drawable-hdpi/ic_download_misc_file_type.png create mode 100644 ui/res/drawable-mdpi/ic_download_misc_file_type.png diff --git a/res/values/strings.xml b/res/values/strings.xml index 8deee358..a5bd7a45 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -160,30 +160,34 @@ 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] --> - Download too large for mobile network + Download too large for operator network - You can\'t download a %s - file on this mobile network.\n\nTouch %s - to download this file when next connected to a Wi-Fi network. + You must use WiFi to complete this + %s + download. \n\nClick %s + to begin this download the next time you are connected to a WiFi + network. - Queue for Wi-Fi download? + Queue for download later? - Downloading this %s - file on this mobile network risks draining your battery and extra charges from - your carrier.\n\nTouch %s to download - this file when next connected to a Wi-Fi network. + Starting this %s + 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\n + Click %s below to begin this download + the next time you are connected to a WiFi network. + android:paddingLeft="8dip" + android:textStyle="bold" + android:textAppearance="?android:attr/textAppearanceSmall" /> diff --git a/ui/res/values/strings.xml b/ui/res/values/strings.xml index 6bd9f2c9..07f51521 100644 --- a/ui/res/values/strings.xml +++ b/ui/res/values/strings.xml @@ -56,9 +56,13 @@ - File not available + Download Failed - This download was unsuccessful. + Do you want to retry downloading the file later + or delete it from the queue? + + File not yet available This file is queued for future download. diff --git a/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java b/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java index 9c572538..c0a916c9 100644 --- a/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java +++ b/ui/src/com/android/providers/downloads/ui/DownloadAdapter.java @@ -183,12 +183,13 @@ public class DownloadAdapter extends CursorAdapter { List list = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); if (list.size() == 0) { - return; + // no icon found for this mediatype. use "unknown" icon + iconView.setImageResource(R.drawable.ic_download_misc_file_type); + } else { + Drawable icon = list.get(0).activityInfo.loadIcon(pm); + iconView.setImageDrawable(icon); } - Drawable icon = list.get(0).activityInfo.loadIcon(pm); - iconView.setImageDrawable(icon); } - iconView.setVisibility(View.VISIBLE); } diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java index 33f821f6..0ab3f936 100644 --- a/ui/src/com/android/providers/downloads/ui/DownloadList.java +++ b/ui/src/com/android/providers/downloads/ui/DownloadList.java @@ -71,7 +71,6 @@ public class DownloadList extends Activity private View mEmptyView; private ViewGroup mSelectionMenuView; private Button mSelectionDeleteButton; - private Button mSelectionRestartButton; private DownloadManager mDownloadManager; private Cursor mDateSortedCursor; @@ -196,8 +195,6 @@ 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); } @@ -372,7 +369,7 @@ public class DownloadList extends Activity if (isPausedForWifi(cursor)) { mQueuedDownloadId = id; mQueuedDialog = new AlertDialog.Builder(this) - .setTitle(R.string.dialog_title_not_available) + .setTitle(R.string.dialog_title_queued_body) .setMessage(R.string.dialog_queued_body) .setPositiveButton(R.string.keep_queued_download, null) .setNegativeButton(R.string.remove_download, getDeleteClickHandler(id)) @@ -447,8 +444,8 @@ public class DownloadList extends Activity new AlertDialog.Builder(this) .setTitle(R.string.dialog_title_not_available) .setMessage(dialogBody) - .setPositiveButton(R.string.remove_download, getDeleteClickHandler(downloadId)) - .setNegativeButton(R.string.retry_download, getRestartClickHandler(downloadId)) + .setNegativeButton(R.string.delete_download, getDeleteClickHandler(downloadId)) + .setPositiveButton(R.string.retry_download, getRestartClickHandler(downloadId)) .show(); } @@ -514,7 +511,6 @@ 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() @@ -523,8 +519,7 @@ public class DownloadList extends Activity cursor.moveToFirst(); switch (cursor.getInt(mStatusColumnId)) { case DownloadManager.STATUS_FAILED: - deleteButtonStringId = R.string.remove_download; - mSelectionRestartButton.setVisibility(View.VISIBLE); + deleteButtonStringId = R.string.delete_download; break; case DownloadManager.STATUS_PENDING: @@ -553,13 +548,6 @@ 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; -- cgit v1.2.3