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 mobile network</string>
+ <string name="wifi_required_title">Download too large for operator network</string>
<!-- Text for dialog when a download exceeds the carrier-specified maximum size of downloads
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 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>
+ <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> to begin this download the next time you are connected to a WiFi
+ 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 Wi-Fi connection is available [CHAR
LIMIT=50] -->
- <string name="wifi_recommended_title">Queue for Wi-Fi download?</string>
+ <string name="wifi_recommended_title">Queue for download later?</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 Wi-Fi connection is available [CHAR
LIMIT=200] -->
- <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>
+ <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\n
+ Click <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>
<!-- Text for button to queue a download to start next time Wi-Fi is available [CHAR LIMIT=25]
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>
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"
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"
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"
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"/>
<!-- 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>
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);
}
private View mEmptyView;
private ViewGroup mSelectionMenuView;
private Button mSelectionDeleteButton;
- private Button mSelectionRestartButton;
private DownloadManager mDownloadManager;
private Cursor mDateSortedCursor;
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);
}
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))
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();
}
* 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()
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:
clearSelection();
break;
- case R.id.selection_retry:
- for (Long downloadId : mSelectedIds) {
- mDownloadManager.restartDownload(downloadId);
- }
- clearSelection();
- break;
-
case R.id.deselect_all:
clearSelection();
break;