use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class RelativeAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
PicturePrimarySecondaryTextHolder holder = (PicturePrimarySecondaryTextHolder) getHolder(view);
//holder.getPicture().setImageDrawable(null);
Relative user = (Relative) data;
holder.getPrimaryText().setText(user.getName());
holder.getSecondaryText().setText(user.getRelationship());
String url = FacebookUtil.getImageURLForId(user.getUid(), FacebookUtil.NORMAL);
loadImage(holder.getPicture(), url, AttrUtil.getResourceId(getContext(view), R.attr.squarePlaceHolderIcon), data);
holder.getShadow().setVisibility(user.getShadow() == true ? View.VISIBLE : View.GONE);
}
use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class BirthdayAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
PicturePrimarySecondaryTextHolder holder = (PicturePrimarySecondaryTextHolder) getHolder(view);
//holder.getPicture().setImageDrawable(null);
Friend friend = (Friend) data;
holder.getPrimaryText().setText(friend.getName());
String birthday = friend.getBirthday();
Date birthdayDate = null;
String format = "MM/dd/y";
try {
birthdayDate = new SimpleDateFormat(format).parse(friend.getBirthday_date());
} catch (ParseException e) {
//e.printStackTrace();
}
if (birthdayDate != null) {
Calendar dobDate = Calendar.getInstance();
dobDate.setTime(birthdayDate);
int year = dobDate.get(Calendar.YEAR);
int month = dobDate.get(Calendar.MONTH);
int day = dobDate.get(Calendar.DAY_OF_MONTH);
Calendar today = Calendar.getInstance();
today.set(Calendar.DAY_OF_MONTH, day);
today.set(Calendar.MONTH, month);
int curYear = today.get(Calendar.YEAR);
int curMonth = today.get(Calendar.MONTH);
int curDay = today.get(Calendar.DAY_OF_MONTH);
int age = curYear - year;
if (curMonth < month || (month == curMonth && curDay < day)) {
age--;
}
birthday += " - " + getContext(holder.getPrimaryText()).getString(R.string.birthday_age, age);
}
holder.getSecondaryText().setText(birthday);
loadImage(holder.getPicture(), friend.getPic(), AttrUtil.getResourceId(getContext(holder.getPrimaryText()), R.attr.squarePlaceHolderIcon), data);
}
use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class BirthdayAdapter method attachHolder.
@Override
protected void attachHolder(View view) {
ImageView userPicture = (ImageView) view.findViewById(R.id.picture);
TextView userName = (TextView) view.findViewById(R.id.primary_text);
TextView userBirthday = (TextView) view.findViewById(R.id.secondary_text);
setHolder(view, new PicturePrimarySecondaryTextHolder(userPicture, userName, userBirthday));
}
use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class GroupAdapter2 method attachHolder.
@Override
protected void attachHolder(View view) {
ImageView friendPicture = (ImageView) view.findViewById(R.id.picture);
TextView name = (TextView) view.findViewById(R.id.primary_text);
TextView description = (TextView) view.findViewById(R.id.secondary_text);
setHolder(view, new PicturePrimarySecondaryTextHolder(friendPicture, name, description));
}
use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class MemberAdapter method attachHolder.
@Override
protected void attachHolder(View view) {
ImageView friendPicture = (ImageView) view.findViewById(R.id.picture);
TextView name = (TextView) view.findViewById(R.id.primary_text);
TextView description = (TextView) view.findViewById(R.id.secondary_text);
setHolder(view, new PicturePrimarySecondaryTextHolder(friendPicture, name, description));
}
Aggregations