Search in sources :

Example 6 with Group

use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.

the class GroupAdapter2 method mergeViewWithData.

@Override
protected void mergeViewWithData(View view, GraphObject data) {
    super.mergeViewWithData(view, data);
    PicturePrimarySecondaryTextHolder holder = (PicturePrimarySecondaryTextHolder) getHolder(view);
    //holder.getPicture().setImageDrawable(null);
    Group group = (Group) data;
    holder.getPrimaryText().setText(group.getName());
    holder.getSecondaryText().setText(group.getDescription());
    if (placeHolder == -1)
        placeHolder = AttrUtil.getResourceId(getContext(holder.getPicture()), R.attr.squarePlaceHolderIcon);
    String url = FacebookUtil.getImageURLForId(group.getGid());
    loadImage(holder.getPicture(), url, placeHolder, data);
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) PicturePrimarySecondaryTextHolder(com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)

Example 7 with Group

use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.

the class GroupAdapter method mergeViewWithData.

protected void mergeViewWithData(View view, GraphObject data) {
    super.mergeViewWithData(view, data);
    GroupHolder holder = (GroupHolder) getHolder(view);
    Group group = (Group) data;
    holder.getGroupName().setText(group.getName());
    if (group.getDescription().length() > 0) {
        holder.getGroupDescription().setText(group.getDescription());
        holder.getGroupDescription().setVisibility(View.VISIBLE);
    } else {
        holder.getGroupDescription().setVisibility(View.GONE);
    }
    int placeHolder = AttrUtil.getResourceId(getContext(holder.getGroupCover()), R.attr.squarePlaceHolderIcon);
    if (group.getPic_cover() != null && group.getPic_cover().getSource() != null && group.getPic_cover().getSource().length() > 0) {
        GroupCoverImageView groupCoverImageView = (GroupCoverImageView) holder.getGroupCover();
        groupCoverImageView.setOffset(group.getPic_cover().getOffset_y());
        loadImage(holder.getGroupCover(), group.getPic_cover().getSource(), placeHolder, true);
    } else {
        loadImage(holder.getGroupCover(), group.getPic_big(), placeHolder, true);
    }
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) GroupHolder(com.abewy.android.apps.klyph.adapter.holder.GroupHolder) GroupCoverImageView(com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView)

Example 8 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)

Example 9 with Group

use of com.abewy.android.apps.klyph.core.fql.Group in project Klyph by jonathangerbaud.

the class Groups method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    MultiObjectAdapter moa = new MultiObjectAdapter(getListView());
    moa.setFilter(new Filter() {

        @SuppressWarnings("unchecked")
        @Override
        protected void publishResults(CharSequence constraint, FilterResults results) {
            setFilteredResults((List<GraphObject>) results.values);
        }

        @Override
        protected FilterResults performFiltering(CharSequence constraint) {
            FilterResults results = new FilterResults();
            List<Group> filteredGroups = new ArrayList<Group>();
            // perform your search here using the searchConstraint String.
            constraint = constraint.toString().toLowerCase();
            for (int i = 0; i < groups.size(); i++) {
                Group group = (Group) groups.get(i);
                if (group.getName().toLowerCase().startsWith(constraint.toString())) {
                    filteredGroups.add(group);
                }
            }
            results.count = filteredGroups.size();
            results.values = filteredGroups;
            return results;
        }
    });
    setListAdapter(moa);
    defineEmptyText(R.string.empty_list_no_group);
    setRequestType(Query.GROUPS);
    setListVisible(false);
    super.onViewCreated(view, savedInstanceState);
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) Filter(android.widget.Filter) MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) ArrayList(java.util.ArrayList) List(java.util.List)

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