Search in sources :

Example 6 with FeedItem

use of com.androidquery.simplefeed.data.FeedItem in project simplefacebook by androidquery.

the class PostActivity method photoDetailCb.

public void photoDetailCb(String url, JSONObject jo, AjaxStatus status) {
    AQUtility.debug(jo);
    if (jo != null) {
        String tb = jo.optString("picture");
        FeedItem item = new FeedItem(jo);
        uploaded(tb, item);
    } else {
        failed();
    }
}
Also used : FeedItem(com.androidquery.simplefeed.data.FeedItem)

Example 7 with FeedItem

use of com.androidquery.simplefeed.data.FeedItem in project simplefacebook by androidquery.

the class ImageActivity method remove.

private void remove(FeedItem target, List<FeedItem> items) {
    for (int i = 0; i < items.size(); i++) {
        FeedItem item = items.get(i);
        if (item.getId().equals(target.getObjectId())) {
            AQUtility.debug("remove!");
            items.remove(i);
            //target.setItemName(item.getItemName());
            break;
        }
    }
}
Also used : FeedItem(com.androidquery.simplefeed.data.FeedItem)

Example 8 with FeedItem

use of com.androidquery.simplefeed.data.FeedItem in project simplefacebook by androidquery.

the class AdhocActivity method jsonCb.

public void jsonCb(String url, JSONObject jo, AjaxStatus status) {
    AQUtility.debug(jo);
    FeedItem item = new FeedItem(jo);
    String next = JsonUtility.getString(jo, "comments", "paging");
    CommentAdapter comments = new CommentAdapter();
    comments.add(item.getComments(), next);
    aq.id(R.id.list).adapter(comments);
}
Also used : FeedItem(com.androidquery.simplefeed.data.FeedItem)

Example 9 with FeedItem

use of com.androidquery.simplefeed.data.FeedItem in project simplefacebook by androidquery.

the class CommentFragment method detailCb.

//11-26 18:46:31.429: W/AQuery(24688): jo:{"position":2,"picture":"http:\/\/photos-f.ak.fbcdn.net\/hphotos-ak-ash4\/311015_2677708751265_1512652234_2758351_2054808874_s.jpg","id":"2677708751265","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v1\/yz\/r\/StEh3RhPvjk.gif","height":540,"source":"http:\/\/a6.sphotos.ak.fbcdn.net\/hphotos-ak-ash4\/s720x720\/311015_2677708751265_1512652234_2758351_2054808874_n.jpg","likes":{"data":[{"id":"1448780323","name":"Wendy Lin"}],"paging":{"next":"https:\/\/graph.facebook.com\/2677708751265\/likes?access_token=AAAEUiDdRZCLIBAMyuPHhGxbX04kuBcZC55NHZAZBKxZAOwGyZCpSGDUre8lonCjtoBiM4O92sx0t5VawnJrTiDne0PVmkVCe4ZD&limit=25&offset=25&__after_id=1448780323"}},"link":"http:\/\/www.facebook.com\/photo.php?pid=2758351&id=1512652234","width":720,"images":[{"source":"http:\/\/hphotos-iad1.fbcdn.net\/hphotos-ash4\/336196_2677708751265_1512652234_2758351_2054808874_o.jpg","width":2048,"height":1536},{"source":"http:\/\/a6.sphotos.ak.fbcdn.net\/hphotos-ak-ash4\/s720x720\/311015_2677708751265_1512652234_2758351_2054808874_n.jpg","width":720,"height":540},{"source":"http:\/\/photos-f.ak.fbcdn.net\/hphotos-ak-ash4\/311015_2677708751265_1512652234_2758351_2054808874_a.jpg","width":180,"height":135},{"source":"http:\/\/photos-f.ak.fbcdn.net\/hphotos-ak-ash4\/311015_2677708751265_1512652234_2758351_2054808874_s.jpg","width":130,"height":97},{"source":"http:\/\/photos-f.ak.fbcdn.net\/hphotos-ak-ash4\/311015_2677708751265_1512652234_2758351_2054808874_t.jpg","width":75,"height":56}],"from":{"id":"1512652234","name":"Peter Liu"},"created_time":"2011-11-25T13:06:17+0000","updated_time":"2011-11-25T13:06:20+0000"}
public void detailCb(String url, JSONObject jo, AjaxStatus status) {
    AQUtility.debug("jo", jo);
    showProgress(false);
    aq.id(R.id.progress).gone();
    if (jo != null) {
        comments.clear();
        item = new FeedItem(jo);
        renderHeader(item);
        String next = JsonUtility.getString(jo, "comments", "paging");
        comments.add(item.getComments(), next);
        if (status.expired(TEN_MIN)) {
            refresh();
        }
        act.updateTitle(status.getTime().getTime());
        aq.id(R.id.list).visible();
        aq.id(R.id.text_error).gone();
        AQUtility.debug("done");
    } else if (status.getCode() == AjaxStatus.TRANSFORM_ERROR || (status.getCode() >= 400 && status.getCode() < 500)) {
        aq.id(R.id.text_error).visible();
        ErrorReporter.report("Cannot get comment:" + url + ":" + item.getLink() + ":" + item.getMessage() + ":" + item.getName() + ":" + item.getId());
    }
}
Also used : FeedItem(com.androidquery.simplefeed.data.FeedItem)

Example 10 with FeedItem

use of com.androidquery.simplefeed.data.FeedItem in project simplefacebook by androidquery.

the class FeedFragment method onClick.

@Override
public void onClick(View view) {
    try {
        int id = view.getId();
        FeedItem item = getItem(view);
        AQUtility.debug("click", item);
        if (item == null)
            return;
        actionItem = item;
        switch(id) {
            case R.id.button_like:
                like(item);
                view.setEnabled(false);
                break;
            case R.id.content_tb:
            case R.id.content_name:
                contentClicked(item);
                break;
            case R.id.button_comment:
                comments();
                break;
            case R.id.tb:
            case R.id.name:
            case R.id.button_source1:
                AQUtility.debug("source1");
                userWall(false);
                break;
            case R.id.name2:
            case R.id.button_source2:
                userWall(true);
                break;
        }
    } catch (Exception e) {
        AQUtility.report(e);
    }
}
Also used : FeedItem(com.androidquery.simplefeed.data.FeedItem)

Aggregations

FeedItem (com.androidquery.simplefeed.data.FeedItem)12 Intent (android.content.Intent)2 Uri (android.net.Uri)1 View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 PQuery (com.androidquery.simplefeed.PQuery)1 Entity (com.androidquery.simplefeed.data.Entity)1 PagedAdapter (greendroid.widget.PagedAdapter)1 PagedView (greendroid.widget.PagedView)1 OnPagedViewChangeListener (greendroid.widget.PagedView.OnPagedViewChangeListener)1 JSONObject (org.json.JSONObject)1