package iphan.pibex.igarassu.ifpe.edu.br.ui.other;


import android.content.Context;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;

import iphan.pibex.igarassu.ifpe.edu.br.model.GoogleMapsModel;
import iphan.pibex.igarassu.ifpe.edu.br.ui.dialog.InvokeProgressDialog;
import iphan.pibex.igarassu.ifpe.edu.br.model.ConnectionFireBaseModel;
import iphan.pibex.igarassu.ifpe.edu.br.util.DataBaseUtil;

public class InvokeAddMarkerMapOther implements OnMapReadyCallback {

    private Context context;
    private DataBaseUtil dataBaseUtil;

    public InvokeAddMarkerMapOther(Context context) {
        this.context = context;
        dataBaseUtil = new DataBaseUtil(context);
    }

    public void onAddMarkerFirebase() {

        ConnectionFireBaseModel.getReferenceFirebase().onDisconnect();

        InvokeProgressDialog.progressDialogStart(context, "Aguarde", "Os pontos estão sendo carregados..."); //Exibindo janela de progresso
        ConnectionFireBaseModel.getReferenceFirebase()
                .child("locations")
                .addValueEventListener(new ValueEventListenerMarkerOther(this.dataBaseUtil));
    }


    public void onAddMarkerSqlite(){
        GoogleMapsModel.getMap().clear(); /*Limpando o mapa*/
        this.dataBaseUtil.addMarkerSqlite();
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        onAddMarkerFirebase();
    }



}


@@ -769,25 +769,24 @@
 ase() %7B%0A
-%0A
         
 Connecti
@@ -781,71 +781,8 @@
     
-ConnectionFireBaseModel.getReferenceFirebase().onDisconnect();%0A
 %0A   
@@ -1365,12 +1365,11 @@
     %7D%0A%0A%0A
-%0A
 %7D%0A%0A

Update InvokeAddMarkerMapOther.java