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);
}
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);
}
}
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));
}
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);
}
Aggregations