Search in sources :

Example 6 with ApplicantModel

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");
        }
    });
}
Also used : DocumentSnapshot(com.google.firebase.firestore.DocumentSnapshot) ApplicantModel(com.example.nftscmers.objectmodels.ApplicantModel) OnSuccessListener(com.google.android.gms.tasks.OnSuccessListener) OnFailureListener(com.google.android.gms.tasks.OnFailureListener)

Example 7 with ApplicantModel

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;
}
Also used : ApplicantModel(com.example.nftscmers.objectmodels.ApplicantModel) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

ApplicantModel (com.example.nftscmers.objectmodels.ApplicantModel)7 Intent (android.content.Intent)5 View (android.view.View)5 ApplicantDb (com.example.nftscmers.db.ApplicantDb)5 MenuItem (android.view.MenuItem)4 BottomNavigationView (com.google.android.material.bottomnavigation.BottomNavigationView)4 DocumentReference (com.google.firebase.firestore.DocumentReference)4 ImageView (android.widget.ImageView)3 TextView (android.widget.TextView)3 ApplicationDb (com.example.nftscmers.db.ApplicationDb)3 JobDb (com.example.nftscmers.db.JobDb)3 JobModel (com.example.nftscmers.objectmodels.JobModel)3 Button (android.widget.Button)2 ListView (android.widget.ListView)2 FeedbackActivity (com.example.nftscmers.commonactivities.FeedbackActivity)2 SkillsFragment (com.example.nftscmers.fragments.SkillsFragment)2 ApplicationModel (com.example.nftscmers.objectmodels.ApplicationModel)2 FirebaseFirestore (com.google.firebase.firestore.FirebaseFirestore)2 SwipeFlingAdapterView (com.lorentzos.flingswipe.SwipeFlingAdapterView)2 ArrayList (java.util.ArrayList)2