Search in sources :

Example 11 with IncidentDataModel

use of com.example.first_responder_app.dataModels.IncidentDataModel in project FirstResponse by mattpost1700.

the class RespondersGroupRecyclerViewAdapter method setEta.

public void setEta(ViewHolder holder, UsersDataModel user) {
    for (int i = 0; i < incidentList.size(); i++) {
        IncidentDataModel incident = incidentList.get(i);
        Map<String, String> etas = incident.getEta();
        List<String> responses = user.getResponses();
        if (responses != null && responses.size() > 0 && responses.get(responses.size() - 1).equals(incident.getDocumentId())) {
            if (etas != null && etas.containsKey(user.getDocumentId())) {
                String eta = "ETA: " + etas.get(user.getDocumentId());
                holder.responderEtaTextView.setText(eta);
                return;
            }
        }
    }
}
Also used : IncidentDataModel(com.example.first_responder_app.dataModels.IncidentDataModel) SuppressLint(android.annotation.SuppressLint)

Aggregations

IncidentDataModel (com.example.first_responder_app.dataModels.IncidentDataModel)11 SuppressLint (android.annotation.SuppressLint)6 QueryDocumentSnapshot (com.google.firebase.firestore.QueryDocumentSnapshot)5 ArrayList (java.util.ArrayList)5 TAG (android.content.ContentValues.TAG)3 Bundle (android.os.Bundle)3 Log (android.util.Log)3 LayoutInflater (android.view.LayoutInflater)3 View (android.view.View)3 ViewGroup (android.view.ViewGroup)3 Toast (android.widget.Toast)3 NonNull (androidx.annotation.NonNull)3 Nullable (androidx.annotation.Nullable)3 DataBindingUtil (androidx.databinding.DataBindingUtil)3 ViewModelProvider (androidx.lifecycle.ViewModelProvider)3 NavDirections (androidx.navigation.NavDirections)3 Navigation (androidx.navigation.Navigation)3 AppUtil (com.example.first_responder_app.AppUtil)3 FirestoreDatabase (com.example.first_responder_app.FirestoreDatabase)3 R (com.example.first_responder_app.R)3