Search in sources :

Example 11 with EmployeeObject

use of aunguyen.quanlycongviec.Object.EmployeeObject in project NienLuanChuyenNganh-Android by AuNguyenTrungNguyen.

the class SelectEmployeeToJobAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(@NonNull final SelectEmployeeToJobViewHolder holder, final int position) {
    EmployeeObject employeeObject = employeeObjectList.get(position);
    Glide.with(context).load(employeeObject.getUrlAvatar()).into(holder.imgAvatar);
    holder.tvNameEmployee.setText(employeeObject.getNameEmployee());
    holder.itemView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            boolean isCheck = listCheck.get(position);
            if (isCheck) {
                listCheck.set(position, false);
                holder.cvSelected.setCardBackgroundColor(Color.WHITE);
            } else {
                listCheck.set(position, true);
                holder.cvSelected.setCardBackgroundColor(Color.GREEN);
            }
        }
    });
}
Also used : EmployeeObject(aunguyen.quanlycongviec.Object.EmployeeObject) CardView(android.support.v7.widget.CardView) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

EmployeeObject (aunguyen.quanlycongviec.Object.EmployeeObject)11 SharedPreferences (android.content.SharedPreferences)6 DatabaseReference (com.google.firebase.database.DatabaseReference)6 DataSnapshot (com.google.firebase.database.DataSnapshot)4 DatabaseError (com.google.firebase.database.DatabaseError)4 ValueEventListener (com.google.firebase.database.ValueEventListener)4 ArrayList (java.util.ArrayList)4 ProgressDialog (android.app.ProgressDialog)3 Intent (android.content.Intent)3 RecyclerView (android.support.v7.widget.RecyclerView)2 View (android.view.View)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 AuthResult (com.google.firebase.auth.AuthResult)2 FirebaseUser (com.google.firebase.auth.FirebaseUser)2 CardView (android.support.v7.widget.CardView)1 JobObject (aunguyen.quanlycongviec.Object.JobObject)1 FirebaseDatabase (com.google.firebase.database.FirebaseDatabase)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1