mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-28 00:43:38 +00:00
[android] Start LinearProgressBars at 1% to show initial dot
see https://m3.material.io/components/progress-indicators/guidelines#817a3dbd-9dd5-471f-a7d0-50eae6270ee0 Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
committed by
Konstantin Pastbin
parent
06b6c3f794
commit
e367fa6792
@@ -116,10 +116,10 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
private final app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener mResourcesDownloadListener =
|
||||
new app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener() {
|
||||
@Override
|
||||
public void onProgress(final int percent)
|
||||
public void onProgress(final int bytesDownloaded)
|
||||
{
|
||||
if (!isFinishing())
|
||||
mProgress.setProgressCompat(percent, true);
|
||||
mProgress.setProgressCompat(bytesDownloaded, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -250,7 +250,8 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
setDownloadMessage(bytes);
|
||||
|
||||
mProgress.setMax(bytes);
|
||||
mProgress.setProgressCompat(0, true);
|
||||
// Start progress at 1% according to M3 guidelines
|
||||
mProgress.setProgressCompat(bytes/100, true);
|
||||
}
|
||||
else
|
||||
finishFilesDownload(bytes);
|
||||
@@ -368,7 +369,8 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
String fileSizeString = StringUtils.getFileSizeString(this, item.totalSize);
|
||||
mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name, fileSizeString));
|
||||
mProgress.setMax((int) item.totalSize);
|
||||
mProgress.setProgressCompat(0, true);
|
||||
// Start progress at 1% according to M3 guidelines
|
||||
mProgress.setProgressCompat((int) (item.totalSize/100), true);
|
||||
|
||||
mCountryDownloadListenerSlot = MapManager.nativeSubscribe(mCountryDownloadListener);
|
||||
MapManager.startDownload(mCurrentCountry);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class DownloadResourcesLegacyActivity
|
||||
{
|
||||
// Called by JNI.
|
||||
@Keep
|
||||
void onProgress(int percent);
|
||||
void onProgress(int bytesDownloaded);
|
||||
|
||||
// Called by JNI.
|
||||
@Keep
|
||||
|
||||
@@ -231,7 +231,9 @@ public class NavMenu
|
||||
updateTime(info.totalTimeInSeconds);
|
||||
mDistanceValue.setText(info.distToTarget.mDistanceStr);
|
||||
mDistanceUnits.setText(info.distToTarget.getUnitsStr(mActivity.getApplicationContext()));
|
||||
mRouteProgress.setProgressCompat((int) info.completionPercent, true);
|
||||
// Start progress at 1% according to M3 guidelines
|
||||
final int completionPercent = (info.completionPercent < 1) ? 1 : (int) info.completionPercent;
|
||||
mRouteProgress.setProgressCompat(completionPercent, true);
|
||||
}
|
||||
|
||||
public interface NavMenuListener
|
||||
|
||||
Reference in New Issue
Block a user