summaryrefslogtreecommitdiffstats
path: root/ui
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 /ui
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
Diffstat (limited to 'ui')
-rw-r--r--ui/res/layout/download_list.xml6
-rw-r--r--ui/src/com/android/providers/downloads/ui/DownloadList.java15
2 files changed, 21 insertions, 0 deletions
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;