forked from organicmaps/organicmaps
[android] Added guides 8 hour processing
This commit is contained in:
parent
7b564e8b96
commit
223413026b
2 changed files with 19 additions and 1 deletions
|
@ -1501,16 +1501,29 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
if (state == GuidesState.FATAL_NETWORK_ERROR)
|
||||
onGuidesFatalError();
|
||||
else if (state == GuidesState.DISABLED)
|
||||
onGuidesDisabled();
|
||||
else
|
||||
state.activate(getApplicationContext());
|
||||
}
|
||||
|
||||
private void onGuidesDisabled()
|
||||
{
|
||||
mToggleMapLayerController.turnOffCurrentView();
|
||||
notifyGuidesAdapters();
|
||||
}
|
||||
|
||||
private void onGuidesFatalError()
|
||||
{
|
||||
mToggleMapLayerController.turnOff();
|
||||
showGuidesFatalErrorDialog();
|
||||
notifyGuidesAdapters();
|
||||
}
|
||||
|
||||
private void notifyGuidesAdapters()
|
||||
{
|
||||
RecyclerView bottomSheetRecycler = findViewById(R.id.layers_recycler);
|
||||
Objects.requireNonNull(bottomSheetRecycler.getAdapter()).notifyDataSetChanged();
|
||||
showGuidesFatalErrorDialog();
|
||||
ToggleMapLayerDialog frag = ToggleMapLayerDialog.getInstance(this);
|
||||
if (frag == null)
|
||||
return;
|
||||
|
|
|
@ -266,6 +266,11 @@ public class MapLayerCompositeController implements MapLayerController
|
|||
throw new IllegalArgumentException("Mode not found : " + mode);
|
||||
}
|
||||
|
||||
public void turnOffCurrentView()
|
||||
{
|
||||
mCurrentLayer.getController().turnOff();
|
||||
}
|
||||
|
||||
private static class ControllerAndMode
|
||||
{
|
||||
@NonNull
|
||||
|
|
Loading…
Add table
Reference in a new issue