use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class ProfileUrlRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray result) {
ItemDeserializer deserializer = new ItemDeserializer();
ArrayList<GraphObject> items = (ArrayList<GraphObject>) deserializer.deserializeArray(result);
return items;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject 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.graph.GraphObject in project Klyph by jonathangerbaud.
the class StatusRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
JSONArray status = result[0];
JSONArray profiles = result[1];
JSONArray pics = result[2];
JSONArray places = result[3];
assocData2(status, profiles, "uid", "id", "uid_name", "name", "uid_type", "type");
assocData(status, pics, "uid", "id", "uid_pic", "url");
assocData(status, places, "place_id", "page_id", "place_name", "name");
StatusDeserializer sDeserializer = new StatusDeserializer();
ArrayList<GraphObject> statut = (ArrayList<GraphObject>) sDeserializer.deserializeArray(status);
setHasMoreData(false);
return statut;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class SearchPageRequest 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++) {
Page page = new Page();
JSONObject json = result.optJSONObject(i);
page.setPage_id(json.optString("id"));
page.setName(json.optString("name"));
page.setType(json.optString("category"));
JSONObject pic = json.optJSONObject("picture");
JSONObject data = pic.optJSONObject("data");
page.setPic(data.optString("url"));
list.add(page);
}
setHasMoreData(false);
return list;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class Notifications method onActivityCreated.
/*
* @Override
* protected KlyphPullToRefreshListView onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState)
* {
* return (KlyphPullToRefreshListView) inflater.inflate(R.layout.list_notifications, null);
* }
*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
NotificationSwipeDismissAdapter swAdapter = new NotificationSwipeDismissAdapter(new MultiObjectAdapter(getListView()), new OnDismissCallback() {
@Override
public void onDismiss(AbsListView arg0, int[] positions) {
for (int i : positions) {
if (getAdapter().getItem(i) instanceof Notification) {
Notification notification = (Notification) getAdapter().getItem(i);
setNotificationRead(notification);
}
}
List<GraphObject> list = new ArrayList<GraphObject>();
for (GraphObject o : getAdapter().getItems()) {
if (!(o instanceof Header)) {
list.add(o);
}
}
populate(list);
}
});
swAdapter.setAbsListView(getListView());
setListAdapter(swAdapter);
// setListAdapter(new MultiObjectAdapter(getListView()));
defineEmptyText(R.string.empty_list_no_notification);
setListVisible(false);
setRequestType(Query.NOTIFICATIONS);
loggedIn = true;
new Handler().postDelayed(new Runnable() {
public void run() {
loadNotifications();
}
}, 2000);
}
Aggregations