diff --git a/OsmAnd/src/net/osmand/plus/download/IndexItem.java b/OsmAnd/src/net/osmand/plus/download/IndexItem.java index dc70cb0bfa..aeea72e1b9 100644 --- a/OsmAnd/src/net/osmand/plus/download/IndexItem.java +++ b/OsmAnd/src/net/osmand/plus/download/IndexItem.java @@ -73,6 +73,10 @@ public class IndexItem implements Comparable { public double getContentSizeMB() { return ((double)contentSize) / (1 << 20); } + + public double getArchiveSizeMB() { + return ((double)containerSize) / (1 << 20); + } public String getSizeDescription(Context ctx) { return size + " MB"; diff --git a/OsmAnd/src/net/osmand/plus/download/ui/ActiveDownloadsDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/ActiveDownloadsDialogFragment.java index 07631a7170..1137650526 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/ActiveDownloadsDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/ActiveDownloadsDialogFragment.java @@ -77,6 +77,7 @@ public class ActiveDownloadsDialogFragment extends DialogFragment implements Dow ItemViewHolder viewHolder = new ItemViewHolder(convertView, context); viewHolder.setSilentCancelDownload(true); + viewHolder.setShowTypeInDesc(true); viewHolder.setShowProgressInDescr(true); convertView.setTag(viewHolder); } diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java index 4f5e9126d0..974dc67aaa 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java @@ -186,7 +186,6 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow } } } - ((DownloadActivity) getActivity()).startDownload(indexItem); if (!handled) { ItemViewHolder vh = (ItemViewHolder) v.getTag(); OnClickListener ls = vh.getRightButtonAction(indexItem, vh.getClickAction(indexItem)); diff --git a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java index d7c64f56d5..58d551d055 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java @@ -1,7 +1,6 @@ package net.osmand.plus.download.ui; import java.text.DateFormat; - import net.osmand.access.AccessibleToast; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; @@ -12,6 +11,7 @@ import net.osmand.plus.download.DownloadResources; import net.osmand.plus.download.IndexItem; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; import net.osmand.plus.srtmplugin.SRTMPlugin; +import android.annotation.SuppressLint; import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.Drawable; @@ -137,7 +137,7 @@ public class ItemViewHolder { leftImageView.setImageDrawable(getContentIcon(context, indexItem.getType().getIconResource())); } - descrTextView.setTextColor(color); + descrTextView.setTextColor(textColorSecondary); if (!isDownloading) { progressBar.setVisibility(View.GONE); descrTextView.setVisibility(View.VISIBLE); @@ -149,7 +149,8 @@ public class ItemViewHolder { " • " + indexItem.getSizeDescription(context) + " • " + (showRemoteDate ? indexItem.getRemoteDate(dateFormat) : indexItem.getLocalDate(dateFormat))); } else { - descrTextView.setText(indexItem.getSizeDescription(context) + " • " + (showRemoteDate ? indexItem.getRemoteDate(dateFormat) : indexItem.getLocalDate(dateFormat))); + descrTextView.setText(indexItem.getSizeDescription(context) + " • " + + (showRemoteDate ? indexItem.getRemoteDate(dateFormat) : indexItem.getLocalDate(dateFormat))); } rightImageButton.setImageDrawable(getContentIcon(context, R.drawable.ic_action_import)); @@ -165,12 +166,17 @@ public class ItemViewHolder { progressBar.setProgress(progress); if (showProgressInDesc) { - double mb = indexItem.getContentSizeMB(); + double mb = indexItem.getArchiveSizeMB(); + String v ; if (progress != -1) { - descrTextView.setText(context.getString(R.string.value_downloaded_from_max, mb * progress / 100, - mb)); + v = context.getString(R.string.value_downloaded_from_max, mb * progress / 100, mb); } else { - descrTextView.setText(context.getString(R.string.file_size_in_mb, mb)); + v = context.getString(R.string.file_size_in_mb, mb); + } + if(showTypeInDesc) { + descrTextView.setText(indexItem.getType().getString(context) + " • " +v); + } else { + descrTextView.setText(v); } descrTextView.setVisibility(View.VISIBLE); } else { @@ -208,6 +214,7 @@ public class ItemViewHolder { return disabled; } + @SuppressLint("DefaultLocale") public RightButtonAction getClickAction(final IndexItem indexItem) { RightButtonAction clickAction = RightButtonAction.DOWNLOAD; if (indexItem.getBasename().toLowerCase().equals(DownloadResources.WORLD_SEAMARKS_KEY)