use of at.markushi.ui.CircleButton in project ETSMobile-Android2 by ApplETS.
the class EvenementCommunauteAdapter method getRealChildView.
@Override
public View getRealChildView(final int listPosition, final int expandedListPosition, boolean isLastChild, View convertView, ViewGroup parent) {
final EvenementCommunaute item = (EvenementCommunaute) getChild(listPosition, expandedListPosition);
if (convertView == null) {
LayoutInflater layoutInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.row_applets_events, null);
}
TextView textViewDescription = (TextView) convertView.findViewById(R.id.tv_description);
ImageView imageViewLogoOrganisateur = (ImageView) convertView.findViewById(R.id.iv_logo_organisateur);
TextView textViewNomOrganisateur = (TextView) convertView.findViewById(R.id.tv_nom_organisateur);
CircleButton buttonDetails = (CircleButton) convertView.findViewById(R.id.btn_details);
textViewDescription.setText(item.getDescription());
textViewNomOrganisateur.setText(item.getSourceEvenement().getName());
String urlImageOrganisateur = item.getSourceEvenement().getUrlImage();
if (!urlImageOrganisateur.isEmpty()) {
Picasso.with(convertView.getContext()).load(urlImageOrganisateur).into(imageViewLogoOrganisateur);
}
buttonDetails.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String url = getFacebookEventURL(item.getId());
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
// Verify if the link is one to use Facebook first. If not, open a webpage.
if (URLUtil.isHttpUrl(url) || URLUtil.isHttpsUrl(url)) {
Utility.openChromeCustomTabs(v.getContext(), url);
} else {
v.getContext().startActivity(intent);
}
}
});
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!(view instanceof Button)) {
expandableListView.collapseGroupWithAnimation(listPosition);
}
}
});
return convertView;
}
Aggregations