forked from organicmaps/organicmaps
[android] pending progress for progress bars
This commit is contained in:
parent
f9f9ee72e9
commit
cd03906c50
2 changed files with 10 additions and 6 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue