Search in sources :

Example 1 with Group

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;
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 2 with Group

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;
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group)

Example 3 with 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;
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 4 with Group

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);
    }
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) GroupCoverImageView(com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView) ElementTimelineHolder(com.abewy.android.apps.klyph.adapter.holder.ElementTimelineHolder)

Example 5 with Group

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));
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group)

Aggregations

Group (com.abewy.android.apps.klyph.core.fql.Group)9 ArrayList (java.util.ArrayList)3 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)2 GroupCoverImageView (com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView)2 Intent (android.content.Intent)1 Filter (android.widget.Filter)1 MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)1 ElementTimelineHolder (com.abewy.android.apps.klyph.adapter.holder.ElementTimelineHolder)1 GroupHolder (com.abewy.android.apps.klyph.adapter.holder.GroupHolder)1 PicturePrimarySecondaryTextHolder (com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)1 EventActivity (com.abewy.android.apps.klyph.app.EventActivity)1 GroupActivity (com.abewy.android.apps.klyph.app.GroupActivity)1 PageActivity (com.abewy.android.apps.klyph.app.PageActivity)1 UserActivity (com.abewy.android.apps.klyph.app.UserActivity)1 Event (com.abewy.android.apps.klyph.core.fql.Event)1 Friend (com.abewy.android.apps.klyph.core.fql.Friend)1 FriendRequest (com.abewy.android.apps.klyph.core.fql.FriendRequest)1 Page (com.abewy.android.apps.klyph.core.fql.Page)1 Stream (com.abewy.android.apps.klyph.core.fql.Stream)1 Tag (com.abewy.android.apps.klyph.core.fql.Tag)1