[android] Added guides 8 hour processing

This commit is contained in:
Dmitry Donskoy 2020-06-16 18:33:50 +03:00 committed by Vladimir Byko-Ianko
parent 7b564e8b96
commit 223413026b
2 changed files with 19 additions and 1 deletions

View file

@ -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;

View file

@ -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