[android]: Added display of MWM region file size on the global map download screen

This commit is contained in:
Mihail Mitrofanov
2025-05-29 12:07:51 +02:00
committed by Konstantin Pastbin
parent 34f4a124d1
commit 042088dc46

View File

@@ -111,10 +111,10 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
}
int status = MapManager.nativeGetStatus(mCurrentCountry);
String name = MapManager.nativeGetName(mCurrentCountry);
if (status != CountryItem.STATUS_DONE)
{
String name = getFormattedCountryName(mCurrentCountry);
UiUtils.show(mChbDownloadCountry);
String checkBoxText;
if (status == CountryItem.STATUS_UPDATABLE)
@@ -129,6 +129,18 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
}
};
private String getFormattedCountryName(String mCurrentCountry) {
String name = MapManager.nativeGetName(mCurrentCountry);
CountryItem country = CountryItem.fill(mCurrentCountry);
String sizeText = StringUtils.getFileSizeString(DownloadResourcesLegacyActivity.this, country.totalSize);
if (!TextUtils.isEmpty(sizeText)) {
name = name + " (" + sizeText + ")";
}
return name;
}
private final Listener mResourcesDownloadListener = new Listener()
{
@Override