forked from organicmaps/organicmaps
[android] Applying diff status is supported.
This commit is contained in:
parent
a582b68757
commit
365ed97940
6 changed files with 21 additions and 5 deletions
|
@ -140,6 +140,7 @@ class BottomPanel
|
|||
break;
|
||||
|
||||
case CountryItem.STATUS_PROGRESS:
|
||||
case CountryItem.STATUS_APPLYING:
|
||||
case CountryItem.STATUS_ENQUEUED:
|
||||
setCancelState();
|
||||
break;
|
||||
|
@ -170,6 +171,7 @@ class BottomPanel
|
|||
break;
|
||||
|
||||
case CountryItem.STATUS_PROGRESS:
|
||||
case CountryItem.STATUS_APPLYING:
|
||||
case CountryItem.STATUS_ENQUEUED:
|
||||
setCancelState();
|
||||
break;
|
||||
|
|
|
@ -378,6 +378,7 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
|
|||
{
|
||||
case CountryItem.STATUS_DONE:
|
||||
case CountryItem.STATUS_PROGRESS:
|
||||
case CountryItem.STATUS_APPLYING:
|
||||
case CountryItem.STATUS_ENQUEUED:
|
||||
processLongClick();
|
||||
break;
|
||||
|
@ -456,6 +457,7 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
|
|||
break;
|
||||
|
||||
case CountryItem.STATUS_PROGRESS:
|
||||
case CountryItem.STATUS_APPLYING:
|
||||
case CountryItem.STATUS_ENQUEUED:
|
||||
items.add(MenuItem.CANCEL);
|
||||
|
||||
|
@ -597,10 +599,16 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
|
|||
UiUtils.showIf(mSearchResultsMode, mFoundName);
|
||||
|
||||
long size;
|
||||
if (mItem.status == CountryItem.STATUS_ENQUEUED || mItem.status == CountryItem.STATUS_PROGRESS)
|
||||
if (mItem.status == CountryItem.STATUS_ENQUEUED ||
|
||||
mItem.status == CountryItem.STATUS_PROGRESS ||
|
||||
mItem.status == CountryItem.STATUS_APPLYING)
|
||||
{
|
||||
size = mItem.enqueuedSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = ((!mSearchResultsMode && mMyMapsMode) ? mItem.size : mItem.totalSize);
|
||||
}
|
||||
|
||||
mSize.setText(StringUtils.getFileSizeString(size));
|
||||
mStatusIcon.update(mItem);
|
||||
|
|
|
@ -83,7 +83,8 @@ public class DownloaderStatusIcon
|
|||
public void update(CountryItem country)
|
||||
{
|
||||
boolean pending = (country.status == CountryItem.STATUS_ENQUEUED);
|
||||
boolean inProgress = (country.status == CountryItem.STATUS_PROGRESS || pending);
|
||||
boolean inProgress = (country.status == CountryItem.STATUS_PROGRESS ||
|
||||
country.status == CountryItem.STATUS_APPLYING || pending);
|
||||
|
||||
UiUtils.showIf(inProgress, mProgress);
|
||||
UiUtils.showIf(!inProgress, mIcon);
|
||||
|
|
|
@ -93,7 +93,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
|
|||
if (showFrame)
|
||||
{
|
||||
boolean enqueued = (mCurrentCountry.status == CountryItem.STATUS_ENQUEUED);
|
||||
boolean progress = (mCurrentCountry.status == CountryItem.STATUS_PROGRESS);
|
||||
boolean progress = (mCurrentCountry.status == CountryItem.STATUS_PROGRESS ||
|
||||
mCurrentCountry.status == CountryItem.STATUS_APPLYING);
|
||||
boolean failed = (mCurrentCountry.status == CountryItem.STATUS_FAILED);
|
||||
|
||||
showFrame = (enqueued || progress || failed ||
|
||||
|
|
|
@ -79,8 +79,11 @@ public class RoutingErrorDialogFragment extends BaseRoutingErrorDialogFragment
|
|||
long size = 0;
|
||||
for (CountryItem country : mMissingMaps)
|
||||
{
|
||||
if (country.status != CountryItem.STATUS_PROGRESS)
|
||||
if (country.status != CountryItem.STATUS_PROGRESS &&
|
||||
country.status != CountryItem.STATUS_APPLYING)
|
||||
{
|
||||
size += country.totalSize;
|
||||
}
|
||||
}
|
||||
|
||||
MapManager.warnOn3g(getActivity(), size, new Runnable()
|
||||
|
|
|
@ -2029,7 +2029,8 @@ public class PlacePageView extends RelativeLayout
|
|||
status != CountryItem.STATUS_ENQUEUED &&
|
||||
status != CountryItem.STATUS_FAILED &&
|
||||
status != CountryItem.STATUS_PARTLY &&
|
||||
status != CountryItem.STATUS_PROGRESS);
|
||||
status != CountryItem.STATUS_PROGRESS &&
|
||||
status != CountryItem.STATUS_APPLYING);
|
||||
}
|
||||
|
||||
private void updateDownloader(CountryItem country)
|
||||
|
|
Loading…
Add table
Reference in a new issue