use of com.abewy.android.apps.klyph.core.fql.User.Relative 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.core.fql.User.Relative in project Klyph by jonathangerbaud.
the class UserAbout method populate.
@Override
protected void populate(List<GraphObject> data) {
if (data.size() > 0) {
User user = (User) data.get(0);
data.remove(0);
if (user.getAbout_me() != null && user.getAbout_me().length() > 0) {
TitleTextItem item = new TitleTextItem();
item.setTitle(getResources().getString(R.string.user_about));
item.setText(user.getAbout_me());
item.setShadow(true);
data.add(item);
}
HashMap<String, String> basicInfo = new HashMap<String, String>();
basicInfo.put(getResources().getString(R.string.user_birthday), user.getBirthday());
basicInfo.put(getResources().getString(R.string.user_sex), user.getSex());
basicInfo.put(getResources().getString(R.string.user_meeting_sex), user.getMeeting_sex());
basicInfo.put(getResources().getString(R.string.user_relationship_status), user.getRelationship_status());
basicInfo.put(getResources().getString(R.string.user_religion), user.getReligion());
basicInfo.put(getResources().getString(R.string.user_political), user.getPolitical());
addItemsForMap(getResources().getString(R.string.general_infos), basicInfo, data);
HashMap<String, String> coords = new HashMap<String, String>();
// coords.put(getResources().getString(R.string.user_phones), user.get);
coords.put(getResources().getString(R.string.user_address), user.getCurrent_location().getName());
coords.put(getResources().getString(R.string.user_email), user.getEmail());
// coords.put(getResources().getString(R.string.user_networks),
// user.getNetwork());
coords.put(getResources().getString(R.string.user_website), user.getWebsite());
addItemsForMap(getResources().getString(R.string.coordinates), coords, data);
HashMap<String, String> others = new HashMap<String, String>();
others.put(getResources().getString(R.string.user_activities), user.getActivities());
others.put(getResources().getString(R.string.user_books), user.getBooks());
// others.put(getResources().getString(R.string.user_inspirational_people),
// user.getInpirational_people());
others.put(getResources().getString(R.string.user_interests), user.getInterests());
others.put(getResources().getString(R.string.user_movies), user.getMovies());
others.put(getResources().getString(R.string.user_music), user.getMusic());
// others.put(getResources().getString(R.string.user_sports),
// user.getSports());
others.put(getResources().getString(R.string.user_tv), user.getTv());
others.put(getResources().getString(R.string.user_quotes), user.getQuotes());
addItemsForMap(getResources().getString(R.string.others), others, data);
if (user.getFamily().size() > 0) {
Title title = new Title();
title.setName(getResources().getString(R.string.family));
data.add(title);
for (Relative relative : user.getFamily()) {
data.add(relative);
}
Relative last = (Relative) data.get(data.size() - 1);
last.setShadow(true);
}
if (user.getWork().size() > 0) {
Title title = new Title();
title.setName(getResources().getString(R.string.work));
data.add(title);
for (Work work : user.getWork()) {
data.add(work);
}
Work last = (Work) data.get(data.size() - 1);
last.setShadow(true);
}
if (user.getEducation().size() > 0) {
Title title = new Title();
title.setName(getResources().getString(R.string.education));
data.add(title);
for (Education education : user.getEducation()) {
data.add(education);
}
}
}
super.populate(data);
setNoMoreData(true);
}
use of com.abewy.android.apps.klyph.core.fql.User.Relative in project Klyph by jonathangerbaud.
the class Klyph method getIntentForGraphObject.
public static Intent getIntentForGraphObject(Context context, GraphObject object) {
Intent intent = null;
if (object instanceof User) {
User user = (User) object;
if (user.getUid().length() == 0) {
return null;
}
intent = new Intent();
intent.setClass(context, UserActivity.class);
intent.putExtra(KlyphBundleExtras.USER_ID, user.getUid());
intent.putExtra(KlyphBundleExtras.USER_NAME, user.getName());
} else if (object instanceof Friend) {
Friend friend = (Friend) object;
if (friend.getUid().length() == 0) {
return null;
}
intent = new Intent();
intent.setClass(context, UserActivity.class);
intent.putExtra(KlyphBundleExtras.USER_ID, friend.getUid());
intent.putExtra(KlyphBundleExtras.USER_NAME, friend.getName());
} else if (object instanceof Page) {
Page page = (Page) object;
intent = new Intent();
intent.setClass(context, PageActivity.class);
intent.putExtra(KlyphBundleExtras.PAGE_ID, page.getPage_id());
intent.putExtra(KlyphBundleExtras.PAGE_NAME, page.getName());
} else if (object instanceof Event) {
Event event = (Event) object;
intent = new Intent();
intent.setClass(context, EventActivity.class);
intent.putExtra(KlyphBundleExtras.EVENT_ID, event.getEid());
intent.putExtra(KlyphBundleExtras.EVENT_NAME, event.getName());
} else if (object instanceof Stream) {
Stream stream = (Stream) object;
intent = new Intent();
intent.setClass(context, StreamActivity.class);
//intent.putExtra(KlyphBundleExtras.STREAM_ID, stream.getPost_id());
intent.putExtra(KlyphBundleExtras.STREAM_PARCELABLE, stream);
// intent.putExtra(CkoobafeBundleExtras.EVENT_NAME,
// event.getName());
} else if (object instanceof Group) {
Group group = (Group) object;
intent = new Intent();
intent.setClass(context, GroupActivity.class);
intent.putExtra(KlyphBundleExtras.GROUP_ID, group.getGid());
intent.putExtra(KlyphBundleExtras.GROUP_NAME, group.getName());
} else if (object instanceof Tag) {
Tag tag = (Tag) object;
if (tag.getType().equals("user") || tag.getType().equals(GraphType.FQL_USER.toString())) {
intent = new Intent();
intent.setClass(context, UserActivity.class);
intent.putExtra(KlyphBundleExtras.USER_ID, tag.getId());
intent.putExtra(KlyphBundleExtras.USER_NAME, tag.getName());
} else if (tag.getType().equals("page") || tag.getType().equals(GraphType.FQL_PAGE.toString())) {
intent = new Intent();
intent.setClass(context, PageActivity.class);
intent.putExtra(KlyphBundleExtras.PAGE_ID, tag.getId());
intent.putExtra(KlyphBundleExtras.PAGE_NAME, tag.getName());
}
} else if (object instanceof Relative) {
Relative user = (Relative) object;
if (user.getUid().length() == 0) {
return null;
}
intent = new Intent();
intent.setClass(context, UserActivity.class);
intent.putExtra(KlyphBundleExtras.USER_ID, user.getUid());
intent.putExtra(KlyphBundleExtras.USER_NAME, user.getName());
} else if (object instanceof FriendRequest) {
FriendRequest fr = (FriendRequest) object;
if (fr.getUid_from().length() == 0) {
return null;
}
intent = new Intent();
intent.setClass(context, UserActivity.class);
intent.putExtra(KlyphBundleExtras.USER_ID, fr.getUid_from());
intent.putExtra(KlyphBundleExtras.USER_NAME, fr.getUid_from_name());
}
return intent;
}
Aggregations