use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.
the class SearchGroupRequest method handleResult.
@Override
public List<GraphObject> handleResult(JSONArray result) {
List<GraphObject> list = new ArrayList<GraphObject>();
int n = result.length();
for (int i = 0; i < n; i++) {
Group group = new Group();
JSONObject json = result.optJSONObject(i);
group.setGid(json.optString("id"));
group.setName(json.optString("name"));
group.setDescription(json.optString("description"));
list.add(group);
}
setHasMoreData(false);
return list;
}
use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.
the class GroupDeserializer method deserializeObject.
@Override
public GraphObject deserializeObject(JSONObject data) {
Group group = new Group();
deserializePrimitives(group, data);
group.setPic_cover((Cover) new CoverDeserializer().deserializeObject(getJsonObject(data, "pic_cover")));
group.setVenue((Location) new LocationDeserializer().deserializeObject(getJsonObject(data, "venue")));
return group;
}
use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.
the class GroupActivity method getCachedDataFromInstanceState.
@Override
protected List<GraphObject> getCachedDataFromInstanceState(Bundle savedInstanceState) {
Group group = savedInstanceState.getParcelable("group");
List<GraphObject> data = new ArrayList<GraphObject>();
data.add(group);
return data;
}
use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.
the class GroupTimelineAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, final GraphObject data) {
super.mergeViewWithData(view, data);
ElementTimelineHolder holder = (ElementTimelineHolder) view.getTag();
Group group = (Group) data;
if (placeHolder == -1)
placeHolder = AttrUtil.getResourceId(getContext(holder.getElementCoverImage()), R.attr.squarePlaceHolderIcon);
holder.getElementProfileImage().setVisibility(View.GONE);
// group can have no cover image
String source = group.getPic_cover().getSource();
if (source != null && source.length() > 0) {
GroupCoverImageView groupCoverImageView = (GroupCoverImageView) holder.getElementCoverImage();
groupCoverImageView.setOffset(group.getPic_cover().getOffset_y());
loadImage(holder.getElementCoverImage(), source, placeHolder, true);
} else {
holder.getElementCoverImage().setImageResource(placeHolder);
}
holder.getElementDetail1().setText(group.getDescription());
holder.getElementDetail1().setVisibility(View.VISIBLE);
holder.getElementDetail2().setVisibility(View.GONE);
holder.getElementDetail3().setVisibility(View.GONE);
holder.getElementDetail4().setVisibility(View.GONE);
if (group.getEmail().length() > 0) {
holder.getLikes().setText(group.getEmail());
holder.getLikes().setVisibility(View.VISIBLE);
} else {
holder.getLikes().setVisibility(View.GONE);
}
if (group.getWebsite().length() > 0) {
holder.getTalkAbout().setText(group.getWebsite());
holder.getTalkAbout().setVisibility(View.VISIBLE);
} else {
holder.getTalkAbout().setVisibility(View.GONE);
}
}
use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.
the class Groups method onGridItemClick.
@Override
public void onGridItemClick(KlyphGridView l, View v, int position, long id) {
Group group = (Group) l.getItemAtPosition(position);
startActivity(Klyph.getIntentForGraphObject(getActivity(), group));
}
Aggregations