use of com.example.nftscmers.objectmodels.ApplicantModel in project HackFest2022-Pretzel by chuanshaof.
the class ApplicantDb method getApplicantModel.
/**
* Get ApplicationModel from user document reference
* @param applicant a DocumentReference of an applicant
*/
public void getApplicantModel(DocumentReference applicant) {
if (!Utils.isNetworkAvailable(context)) {
onApplicantModel.onResult(null);
return;
}
applicant.get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
ApplicantModel applicantModel = documentSnapshot.toObject(ApplicantModel.class);
Log.d(TAG, "onSuccess " + applicantModel.getEmail());
onApplicantModel.onResult(applicantModel);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.d(TAG, "onFailure");
}
});
}
use of com.example.nftscmers.objectmodels.ApplicantModel in project HackFest2022-Pretzel by chuanshaof.
the class ApplicantAdapter method getView.
public View getView(int position, View convertView, ViewGroup parent) {
View view = inflater.inflate(R.layout.item_in_cardview, parent, false);
TextView nameView = view.findViewById(R.id.name);
ImageView imageView = view.findViewById(R.id.thisimage);
ApplicantModel applicant = (ApplicantModel) applicants_list.get(position);
nameView.setText(applicant.getName());
Utils.loadSquareImage(imageView, applicant.getImage());
Log.i("applicant data", applicant.getName());
Log.i("applicant data", applicant.getImage());
return view;
}
Aggregations