Search in sources :

Example 6 with Friend

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

the class EventDeclined method onGridItemClick.

@Override
public void onGridItemClick(KlyphGridView gridView, View v, int position, long id) {
    Friend friend = (Friend) gridView.getItemAtPosition(position);
    startActivity(Klyph.getIntentForGraphObject(getActivity(), friend));
}
Also used : Friend(com.abewy.android.apps.klyph.core.fql.Friend)

Example 7 with Friend

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

the class FollowedPeople method onGridItemClick.

@Override
public void onGridItemClick(KlyphGridView l, View v, int position, long id) {
    Friend friend = (Friend) l.getItemAtPosition(position);
    startActivity(Klyph.getIntentForGraphObject(getActivity(), friend));
}
Also used : Friend(com.abewy.android.apps.klyph.core.fql.Friend)

Example 8 with Friend

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

the class FollowedPeople 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<Friend> filteredFriends = new ArrayList<Friend>();
            // perform your search here using the searchConstraint String.
            constraint = constraint.toString().toLowerCase();
            for (int i = 0; i < friends.size(); i++) {
                Friend friend = (Friend) friends.get(i);
                if (friend.getName().toLowerCase().startsWith(constraint.toString())) {
                    filteredFriends.add(friend);
                }
            }
            results.count = filteredFriends.size();
            results.values = filteredFriends;
            return results;
        }
    });
    setListAdapter(moa);
    defineEmptyText(R.string.empty_list_no_user);
    setListVisible(false);
    setRequestType(Query.FOLLOWED_PEOPLE);
    super.onViewCreated(view, savedInstanceState);
}
Also used : Friend(com.abewy.android.apps.klyph.core.fql.Friend) Filter(android.widget.Filter) MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) ArrayList(java.util.ArrayList) List(java.util.List)

Example 9 with Friend

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

the class UserListDialog method onItemClick.

@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
    GraphObject object = (GraphObject) arg0.getItemAtPosition(position);
    if (object instanceof Tag) {
        Tag tag = (Tag) object;
        startActivity(Klyph.getIntentForGraphObject(getActivity(), tag));
    } else if (object instanceof Friend) {
        Friend friend = (Friend) object;
        startActivity(Klyph.getIntentForGraphObject(getActivity(), friend));
    }
}
Also used : Friend(com.abewy.android.apps.klyph.core.fql.Friend) Tag(com.abewy.android.apps.klyph.core.fql.Tag) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 10 with Friend

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

the class FriendDeserializer method deserializeObject.

@Override
public GraphObject deserializeObject(JSONObject data) {
    Friend friend = new Friend();
    deserializePrimitives(friend, data);
    friend.setEducation(new EducationDeserializer().deserializeArray(getJsonArray(data, "education"), Education.class));
    friend.setWork(new WorkDeserializer().deserializeArray(getJsonArray(data, "work"), Work.class));
    return friend;
}
Also used : Friend(com.abewy.android.apps.klyph.core.fql.Friend) Education(com.abewy.android.apps.klyph.core.fql.User.Education) WorkDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.UserDeserializer.WorkDeserializer) EducationDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.UserDeserializer.EducationDeserializer) Work(com.abewy.android.apps.klyph.core.fql.User.Work)

Aggregations

Friend (com.abewy.android.apps.klyph.core.fql.Friend)24 ArrayList (java.util.ArrayList)5 Intent (android.content.Intent)3 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)3 Filter (android.widget.Filter)2 MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)2 PicturePrimarySecondaryTextHolder (com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)2 Stream (com.abewy.android.apps.klyph.core.fql.Stream)2 Tag (com.abewy.android.apps.klyph.core.fql.Tag)2 Education (com.abewy.android.apps.klyph.core.fql.User.Education)2 Work (com.abewy.android.apps.klyph.core.fql.User.Work)2 List (java.util.List)2 Resources (android.content.res.Resources)1 ViewGroup (android.view.ViewGroup)1 Checkable (android.widget.Checkable)1 FriendPickerHolder (com.abewy.android.apps.klyph.adapter.holder.FriendPickerHolder)1 PicturePrimaryTextHolder (com.abewy.android.apps.klyph.adapter.holder.PicturePrimaryTextHolder)1 ThreadHolder (com.abewy.android.apps.klyph.adapter.holder.ThreadHolder)1 EventActivity (com.abewy.android.apps.klyph.app.EventActivity)1 GroupActivity (com.abewy.android.apps.klyph.app.GroupActivity)1