use of com.abewy.android.apps.klyph.adapter.holder.WorkEducationHolder in project Klyph by jonathangerbaud.
the class EducationAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
WorkEducationHolder holder = (WorkEducationHolder) view.getTag();
// holder.getEmployerPicture().setImageDrawable(null);
Education item = (Education) data;
holder.getEmployer().setText(item.getSchool().getName());
if (item.getConcentration().getName() != null && item.getConcentration().getName().length() > 0) {
holder.getJob().setText(item.getConcentration().getName());
holder.getJob().setVisibility(View.VISIBLE);
} else {
holder.getJob().setVisibility(View.GONE);
}
if (item.getYear().getName() != null && item.getYear().getName().length() > 0) {
String year = String.format(getContext(view).getResources().getString(R.string.education_year), item.getYear().getName());
holder.getPlaceDate().setText(year);
holder.getPlaceDate().setVisibility(View.VISIBLE);
} else {
holder.getPlaceDate().setVisibility(View.GONE);
}
String url = FacebookUtil.getImageURLForId(item.getSchool().getId());
loadImage(holder.getEmployerPicture(), url, data);
holder.getShadow().setVisibility(item.getShadow() == true ? View.VISIBLE : View.GONE);
}
use of com.abewy.android.apps.klyph.adapter.holder.WorkEducationHolder in project Klyph by jonathangerbaud.
the class WorkAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
WorkEducationHolder holder = (WorkEducationHolder) view.getTag();
// holder.getEmployerPicture().setImageDrawable(null);
Work item = (Work) data;
holder.getEmployer().setText(item.getEmployer().getName());
if (item.getPosition().getName() != null && item.getPosition().getName().length() > 0) {
holder.getJob().setText(item.getPosition().getName());
holder.getJob().setVisibility(View.VISIBLE);
} else {
holder.getJob().setVisibility(View.GONE);
}
if (item.getLocation().getName() != null && item.getLocation().getName().length() > 0 && item.getStart_date() != null && item.getStart_date().length() > 0) {
int dateRes = R.string.work_date;
if (item.getEnd_date().length() == 0)
dateRes = R.string.work_date_until_today;
String date = String.format(getContext(view).getResources().getString(dateRes), item.getStart_date(), item.getEnd_date());
holder.getPlaceDate().setText(item.getLocation().getName() + " - " + date);
holder.getPlaceDate().setVisibility(View.VISIBLE);
} else {
holder.getPlaceDate().setVisibility(View.GONE);
}
String url = FacebookUtil.getImageURLForId(item.getEmployer().getId());
loadImage(holder.getEmployerPicture(), url, data);
holder.getShadow().setVisibility(item.getShadow() == true ? View.VISIBLE : View.GONE);
}
Aggregations