diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-04-17 15:05:04 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2018-04-17 15:24:49 +0300 |
commit | cd03906c5015f06f73a5e8dd0520860a9c3bb700 (patch) | |
tree | 348572e27162b92c381377820ff44dbf0ad61234 /android/src | |
parent | f9f9ee72e9b776eaa94ef11f48ae0d842b5218f0 (diff) |
[android] pending progress for progress bars
Diffstat (limited to 'android/src')
-rw-r--r-- | android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java | 10 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/widget/WheelProgressView.java | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java b/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java index 4385fa3691..30768cf599 100644 --- a/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java +++ b/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java @@ -345,16 +345,11 @@ public class UpdaterDialogFragment extends BaseMwmDialogFragment getString(R.string.whats_new_auto_update_button_later)); mFinishBtn.setOnClickListener(mFinishClickListener); mProgressBar.setOnClickListener(mCancelClickListener); + mProgressBar.post(() -> mProgressBar.setPending(true)); if (mAutoUpdate) - { - int progress = MapManager.nativeGetOverallProgress(mOutdatedMaps); - setProgress(progress, mTotalSizeBytes * progress / 100, mTotalSizeBytes); setCommonStatus(mProcessedMapId, mCommonStatusResId); - } else - { mTitle.setText(getString(R.string.whats_new_auto_update_title)); - } } private boolean isAllUpdated() @@ -372,6 +367,9 @@ public class UpdaterDialogFragment extends BaseMwmDialogFragment void setProgress(int progress, long localSize, long remoteSize) { + if (mProgressBar.isPending()) + mProgressBar.setPending(false); + mProgressBar.setProgress(progress); mRelativeStatus.setText(getRelativeStatusFormatted(progress, localSize, remoteSize)); } diff --git a/android/src/com/mapswithme/maps/widget/WheelProgressView.java b/android/src/com/mapswithme/maps/widget/WheelProgressView.java index 301aff481a..6ede0fb1ef 100644 --- a/android/src/com/mapswithme/maps/widget/WheelProgressView.java +++ b/android/src/com/mapswithme/maps/widget/WheelProgressView.java @@ -69,6 +69,7 @@ public class WheelProgressView extends ImageView typedArray.recycle(); mPendingDrawable = (AnimationDrawable) getResources().getDrawable(ThemeUtils.getResource(getContext(), R.attr.wheelPendingAnimation)); + Graphics.tint(mPendingDrawable, progressColor); mBgPaint = new Paint(); mBgPaint.setColor(secondaryColor); @@ -156,4 +157,9 @@ public class WheelProgressView extends ImageView invalidate(); } + + public boolean isPending() + { + return mIsPending; + } } |