diff --git a/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt b/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt index 826a477e6..be571cc84 100644 --- a/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt +++ b/app/src/main/java/org/mozilla/fenix/downloads/DynamicDownloadDialog.kt @@ -11,7 +11,7 @@ import kotlinx.android.extensions.LayoutContainer import kotlinx.android.synthetic.main.download_dialog_layout.view.* import mozilla.components.browser.state.state.content.DownloadState import mozilla.components.feature.downloads.AbstractFetchDownloadService -import mozilla.components.feature.downloads.toMegabyteString +import mozilla.components.feature.downloads.toMegabyteOrKilobyteString import org.mozilla.fenix.R import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.metrics @@ -86,7 +86,7 @@ class DynamicDownloadDialog( } else { val titleText = container.context.getString( R.string.mozac_feature_downloads_completed_notification_text2 - ) + " (${downloadState.contentLength?.toMegabyteString()})" + ) + " (${downloadState.contentLength?.toMegabyteOrKilobyteString()})" view.download_dialog_title.text = titleText diff --git a/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt b/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt index c367ca674..c5f6bbbbd 100644 --- a/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt +++ b/app/src/main/java/org/mozilla/fenix/library/downloads/viewholders/DownloadsListItemViewHolder.kt @@ -8,12 +8,12 @@ import android.view.View import androidx.recyclerview.widget.RecyclerView import kotlinx.android.synthetic.main.download_list_item.view.* import kotlinx.android.synthetic.main.library_site_item.view.* +import mozilla.components.feature.downloads.toMegabyteOrKilobyteString import org.mozilla.fenix.R import org.mozilla.fenix.ext.hideAndDisable import org.mozilla.fenix.library.SelectionHolder import org.mozilla.fenix.library.downloads.DownloadInteractor import org.mozilla.fenix.library.downloads.DownloadItem -import mozilla.components.feature.downloads.toMegabyteString import org.mozilla.fenix.ext.getIcon class DownloadsListItemViewHolder( @@ -29,7 +29,7 @@ class DownloadsListItemViewHolder( ) { itemView.download_layout.visibility = View.VISIBLE itemView.download_layout.titleView.text = item.fileName - itemView.download_layout.urlView.text = item.size.toLong().toMegabyteString() + itemView.download_layout.urlView.text = item.size.toLong().toMegabyteOrKilobyteString() itemView.download_layout.setSelectionInteractor(item, selectionHolder, downloadInteractor) itemView.download_layout.changeSelected(item in selectionHolder.selectedItems)