[Old map downloader] [android] fix: Show migrate dialog from zoomed map also.

This commit is contained in:
Alexander Marchuk 2016-01-22 15:55:40 +03:00 committed by Sergey Yershov
parent d56a1eb67f
commit dabea56723
2 changed files with 34 additions and 15 deletions

View file

@ -7,7 +7,15 @@ import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.util.DisplayMetrics;
import android.view.*;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import com.mapswithme.country.ActiveCountryTree;
import com.mapswithme.maps.base.BaseMwmFragment;
import com.mapswithme.maps.downloader.DownloadHelper;
import com.mapswithme.util.UiUtils;
@ -275,6 +283,12 @@ public class MapFragment extends BaseMwmFragment
@Override
public void run()
{
if (ActiveCountryTree.isLegacyMode())
{
((MwmActivity)getActivity()).showMigrateDialog();
return;
}
final MapStorage.Index index = new MapStorage.Index(group, country, region);
if (options == -1)
{

View file

@ -281,24 +281,29 @@ public class MwmActivity extends BaseMwmFragmentActivity
.show();
}
void showMigrateDialog()
{
new AlertDialog.Builder(MwmActivity.this)
.setTitle(R.string.migrate_title)
.setMessage(R.string.migrate_subtitle)
.setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(android.R.string.ok, new Dialog.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
ActiveCountryTree.migrate();
showDownloader(false);
}
}).show();
}
@Override
public void showDownloader(final boolean openDownloadedList)
public void showDownloader(boolean openDownloadedList)
{
if (ActiveCountryTree.isLegacyMode())
{
new AlertDialog.Builder(MwmActivity.this)
.setTitle(R.string.migrate_title)
.setMessage(R.string.migrate_subtitle)
.setPositiveButton(android.R.string.ok, new Dialog.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
ActiveCountryTree.migrate();
showDownloader(openDownloadedList);
}
}).show();
showMigrateDialog();
return;
}