Created
June 1, 2017 20:34
-
-
Save shakil807g/385bcc820f77dd9bfbe9a012f9cc4a3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DBMainAppointmentAdapter extends MyBaseAdapter<MainAppointment,ItemDashboardBinding> { | |
private VideoClickListener videoClickListener; | |
public DBMainAppointmentAdapter(Context context) { | |
super(context); | |
} | |
public void setVideoClickListner(VideoClickListener videoClickListner) { | |
this.videoClickListener = videoClickListner; | |
} | |
@Override | |
protected int getLayoutIdForPosition(int position) { | |
return R.layout.item_dashboard; | |
} | |
@Override | |
protected void bindData(ItemDashboardBinding dataBinding, MainAppointment item, int position) { | |
dataBinding.docName.setText(item.name); | |
dataBinding.date.setText(Utils.formatDate(item.date)); | |
dataBinding.time.setText(Utils.format12HourTime(item.start_time)); | |
Picasso.with(getContext()).load(AppModule.profileimage+item.image) | |
.placeholder(R.drawable.image_placeholder).into(dataBinding.profileImage); | |
dataBinding.getRoot().setOnClickListener(v -> { | |
if (position != NO_POSITION && itemClickListner !=null) { | |
itemClickListner.onItemClick(item); | |
} | |
}); | |
dataBinding.videoIcon.setOnClickListener(v -> { | |
if (position != NO_POSITION) { | |
if (videoClickListener != null) { | |
videoClickListener.onVideoIconClick(item.record_id); | |
} | |
} | |
}); | |
} | |
public interface VideoClickListener{ | |
public void onVideoIconClick(String url); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment