Search in sources :

Example 11 with XmlDom

use of com.androidquery.util.XmlDom in project androidquery by androidquery.

the class ImageLoadingList4Activity method convertAll.

private List<Photo> convertAll(XmlDom xml) {
    List<XmlDom> entries = xml.children("entry");
    List<Photo> result = new ArrayList<Photo>();
    for (XmlDom entry : entries) {
        result.add(convert(entry));
    }
    return result;
}
Also used : XmlDom(com.androidquery.util.XmlDom) ArrayList(java.util.ArrayList)

Example 12 with XmlDom

use of com.androidquery.util.XmlDom in project androidquery by androidquery.

the class ImageLoadingExpandableListActivity method convertAll.

private List<Photo> convertAll(XmlDom xml) {
    List<XmlDom> entries = xml.children("entry");
    List<Photo> result = new ArrayList<Photo>();
    for (XmlDom entry : entries) {
        result.add(convert(entry));
    }
    return result;
}
Also used : XmlDom(com.androidquery.util.XmlDom) ArrayList(java.util.ArrayList) Photo(com.androidquery.test.image.ImageLoadingList4Activity.Photo)

Example 13 with XmlDom

use of com.androidquery.util.XmlDom in project androidquery by androidquery.

the class ImageLoadingExpandableListActivity method convert.

private Photo convert(XmlDom xml) {
    String url = xml.child("content").attr("src");
    String title = xml.child("title").text();
    String author = xml.child("author").text("name");
    String tb = url;
    List<XmlDom> tbs = xml.tags("media:thumbnail");
    if (tbs.size() > 0) {
        tb = tbs.get(0).attr("url");
    }
    tb = tb.replaceAll("https:", "http:");
    Photo photo = new Photo();
    photo.url = url;
    photo.tb = tb;
    photo.title = title;
    photo.author = author;
    return photo;
}
Also used : XmlDom(com.androidquery.util.XmlDom) Photo(com.androidquery.test.image.ImageLoadingList4Activity.Photo)

Example 14 with XmlDom

use of com.androidquery.util.XmlDom in project androidquery by androidquery.

the class ImageLoadingGalleryActivity method convertAll.

private List<Photo> convertAll(XmlDom xml) {
    List<XmlDom> entries = xml.children("entry");
    List<Photo> result = new ArrayList<Photo>();
    for (XmlDom entry : entries) {
        result.add(convert(entry));
    }
    return result;
}
Also used : XmlDom(com.androidquery.util.XmlDom) ArrayList(java.util.ArrayList) Photo(com.androidquery.test.image.ImageLoadingList4Activity.Photo)

Example 15 with XmlDom

use of com.androidquery.util.XmlDom in project androidquery by androidquery.

the class ImageLoadingGalleryActivity method convert.

private Photo convert(XmlDom xml) {
    String url = xml.child("content").attr("src");
    String title = xml.child("title").text();
    String author = xml.child("author").text("name");
    String tb = url;
    List<XmlDom> tbs = xml.tags("media:thumbnail");
    if (tbs.size() > 0) {
        tb = tbs.get(0).attr("url");
    //tb = tbs.get(tbs.size() - 1).attr("url");
    }
    tb = tb.replaceAll("https:", "http:");
    Photo photo = new Photo();
    photo.url = url;
    photo.tb = tb;
    photo.title = title;
    photo.author = author;
    return photo;
}
Also used : XmlDom(com.androidquery.util.XmlDom) Photo(com.androidquery.test.image.ImageLoadingList4Activity.Photo)

Aggregations

XmlDom (com.androidquery.util.XmlDom)20 ArrayList (java.util.ArrayList)8 Photo (com.androidquery.test.image.ImageLoadingList4Activity.Photo)6 InputStream (java.io.InputStream)6 AjaxCallback (com.androidquery.callback.AjaxCallback)2 JSONObject (org.json.JSONObject)2 GoogleHandle (com.androidquery.auth.GoogleHandle)1 AbstractAjaxCallback (com.androidquery.callback.AbstractAjaxCallback)1 AjaxStatus (com.androidquery.callback.AjaxStatus)1 BitmapAjaxCallback (com.androidquery.callback.BitmapAjaxCallback)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 GZIPInputStream (java.util.zip.GZIPInputStream)1 ClientProtocolException (org.apache.http.client.ClientProtocolException)1 HttpHostConnectException (org.apache.http.conn.HttpHostConnectException)1 JSONArray (org.json.JSONArray)1 JSONTokener (org.json.JSONTokener)1 XmlPullParser (org.xmlpull.v1.XmlPullParser)1