summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-10-21 10:50:53 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-21 10:50:53 -0700
commit707ef1535eb59e9cb9496088049df1f25aa42e92 (patch)
treee2c4883601a7cd0d44e760fbbbe5150ed67ef739 /ui
parent04f09085f85d094207d22ae8969102bd48178180 (diff)
parente664fbafc566f31f844dd543c30064e92f3653f7 (diff)
downloadandroid_packages_providers_DownloadProvider-707ef1535eb59e9cb9496088049df1f25aa42e92.tar.gz
android_packages_providers_DownloadProvider-707ef1535eb59e9cb9496088049df1f25aa42e92.tar.bz2
android_packages_providers_DownloadProvider-707ef1535eb59e9cb9496088049df1f25aa42e92.zip
am e664fbaf: am 3c3ed3c1: bug:3083060 UI tweaks to DownloadManager screens
Merge commit 'e664fbafc566f31f844dd543c30064e92f3653f7' * commit 'e664fbafc566f31f844dd543c30064e92f3653f7': bug:3083060 UI tweaks to DownloadManager screens
Diffstat (limited to 'ui')
-rw-r--r--ui/res/drawable-hdpi/ic_download_misc_file_type.pngbin0 -> 2405 bytes
-rw-r--r--ui/res/drawable-mdpi/ic_download_misc_file_type.pngbin0 -> 1624 bytes
-rw-r--r--ui/res/layout/download_list.xml12
-rw-r--r--ui/res/layout/download_list_item.xml16
-rw-r--r--ui/res/layout/list_group_header.xml3
-rw-r--r--ui/res/values/strings.xml8
-rw-r--r--ui/src/com/android/providers/downloads/ui/DownloadAdapter.java9
-rw-r--r--ui/src/com/android/providers/downloads/ui/DownloadList.java20
8 files changed, 33 insertions, 35 deletions
diff --git a/ui/res/drawable-hdpi/ic_download_misc_file_type.png b/ui/res/drawable-hdpi/ic_download_misc_file_type.png
new file mode 100644
index 00000000..dab3b6e1
--- /dev/null
+++ b/ui/res/drawable-hdpi/ic_download_misc_file_type.png
Binary files differ
diff --git a/ui/res/drawable-mdpi/ic_download_misc_file_type.png b/ui/res/drawable-mdpi/ic_download_misc_file_type.png
new file mode 100644
index 00000000..ceed70cf
--- /dev/null
+++ b/ui/res/drawable-mdpi/ic_download_misc_file_type.png
Binary files differ
diff --git a/ui/res/layout/download_list.xml b/ui/res/layout/download_list.xml
index 42295f4d..8f75baea 100644
--- a/ui/res/layout/download_list.xml
+++ b/ui/res/layout/download_list.xml
@@ -50,21 +50,17 @@
android:paddingRight="4dip"
android:paddingBottom="1dip"
android:gravity="center"
+ android:layout_gravity="center"
android:background="@android:drawable/bottom_bar">
<Button android:id="@+id/selection_delete"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
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_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/deselect_all"/>
+
</LinearLayout>
</LinearLayout>
diff --git a/ui/res/layout/download_list_item.xml b/ui/res/layout/download_list_item.xml
index 9c3b3dae..8548e3cc 100644
--- a/ui/res/layout/download_list_item.xml
+++ b/ui/res/layout/download_list_item.xml
@@ -22,22 +22,26 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="?android:attr/scrollbarSize"
- android:descendantFocusability="blocksDescendants">
+ android:descendantFocusability="blocksDescendants"
+ android:gravity="center_vertical">
+
<!-- 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:paddingLeft="8dip"
android:scaleType="fitCenter"
+ android:layout_centerVertical="true"
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:paddingLeft="8dip"
android:layout_toRightOf="@id/download_checkbox"
+ android:layout_centerVertical="true"
android:scaleType="fitCenter" />
<TextView android:id="@+id/download_title"
@@ -46,13 +50,16 @@
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/download_icon"
android:maxLines="1"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:paddingLeft="8dip"
+ android:textStyle="bold"
+ android:textAppearance="?android:attr/textAppearanceSmall" />
<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:paddingLeft="8dip"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView android:id="@+id/last_modified_date"
@@ -68,6 +75,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/domain"
android:layout_toRightOf="@id/download_icon"
+ android:paddingLeft="8dip"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView android:id="@+id/size_text"
android:layout_width="wrap_content"
diff --git a/ui/res/layout/list_group_header.xml b/ui/res/layout/list_group_header.xml
index 984b4142..2600f8de 100644
--- a/ui/res/layout/list_group_header.xml
+++ b/ui/res/layout/list_group_header.xml
@@ -19,5 +19,6 @@
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingLeft="35dip"
+ android:paddingLeft="43dip"
+ android:layout_gravity="center_vertical"
android:gravity="center_vertical"/>
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 @@
<!-- 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>
+ <string name="dialog_title_not_available">Download Failed</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>
+ <string name="dialog_failed_body">Do you want to retry downloading the file later
+ or delete it from the queue?</string>
+ <!-- Title for dialog when user clicks on a download that has not yet begun, but will be started
+ in the future. [CHAR LIMIT=25] -->
+ <string name="dialog_title_queued_body">File not yet available</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>
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<ResolveInfo> 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;