Search in sources :

Example 6 with PQuery

use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.

the class BaseActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    makeHandle();
    aq = new PQuery(this);
    //aq.hardwareAccelerated11();
    aq2 = new PQuery(this);
    transformer = new PTransformer();
    initView();
    init(savedInstanceState);
    if (isTaskRoot()) {
        MarketService ms = new MarketService(this);
        ms.level(MarketService.MINOR).checkVersion();
    }
}
Also used : PQuery(com.androidquery.simplefeed.PQuery) PTransformer(com.androidquery.simplefeed.callback.PTransformer) MarketService(com.androidquery.service.MarketService)

Example 7 with PQuery

use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.

the class BaseFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(getContainerView(), container, false);
    act = (BaseActivity) getActivity();
    aq = new PQuery(act, view);
    aq2 = new PQuery(act, view);
    locale = act.locale;
    handle = act.handle;
    transformer = act.transformer;
    return view;
}
Also used : PQuery(com.androidquery.simplefeed.PQuery) View(android.view.View)

Example 8 with PQuery

use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.

the class SettingsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.settings);
    aq = new PQuery(this);
    handle = AppUtility.makeHandle(this);
    initView();
}
Also used : PQuery(com.androidquery.simplefeed.PQuery)

Example 9 with PQuery

use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.

the class CommentFragment method renderNote.

private void renderNote(FeedItem item) {
    PQuery aq = super.aq.id(header).find(R.id.note_box);
    Entity from = item.getFrom();
    aq.id(R.id.name).text(from.getName());
    aq.id(R.id.subject).text(item.getSubject());
    aq.id(R.id.meta).text(item.getCachedTime(System.currentTimeMillis()));
    String tb = from.getTb();
    aq.id(R.id.tb).image(tb, true, true, 0, R.drawable.ic_menu_report_image, null, AQuery.FADE_IN_NETWORK);
    String body = item.getMessage();
    body = patchImg(body);
    AQUtility.debug("body", body);
    WebView wv = aq.id(R.id.web).visible().getWebView();
    wv.loadDataWithBaseURL(null, body, "text/html", "utf-8", null);
    aq.id(R.id.content_box).gone();
    renderCount();
}
Also used : Entity(com.androidquery.simplefeed.data.Entity) PQuery(com.androidquery.simplefeed.PQuery) WebView(android.webkit.WebView)

Example 10 with PQuery

use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.

the class CommentFragment method renderNormal.

private void renderNormal(FeedItem item) {
    Entity from = item.getFrom();
    String name = from.getName();
    if (name == null) {
        return;
    }
    if (act.isTablet()) {
        aq.id(R.id.action_box).visible();
    }
    aq.id(R.id.list).visible();
    PQuery aq = super.aq.id(header).find(R.id.normal_box);
    aq.visible();
    aq.id(R.id.name).text(name);
    String desc = item.getDesc();
    String subject = item.getSubject();
    if (act.isTablet() && subject != null) {
        desc = subject;
    }
    aq.id(R.id.desc).text(desc, BufferType.SPANNABLE, true);
    if (maxLines) {
        aq.getTextView().setMaxLines(2);
    }
    aq.id(R.id.meta).text(item.getCachedTime(System.currentTimeMillis()));
    String tb = from.getTb();
    aq.id(R.id.tb).image(tb, true, true, 0, R.drawable.ic_menu_report_image, null, AQuery.FADE_IN_NETWORK);
    String contentTb = item.getContentTb();
    String contentDesc = item.getContentDesc();
    if (drawContent && (contentTb != null || contentDesc != null)) {
        aq.id(R.id.content_box).visible();
        int icon = 0;
        if (contentTb != null) {
            int tbw = item.getCTbWidth();
            if (tbw == 0)
                tbw = 90;
            aq.id(R.id.content_tb).width(tbw, false).height(tbw / 2, false);
            aq.tag(item);
            aq.image(contentTb, true, true, 0, R.drawable.ic_menu_report_image, null, AQuery.FADE_IN_NETWORK, AQuery.RATIO_PRESERVE);
            icon = item.getActionIcon();
            aq.id(R.id.content_ph).visible();
        } else {
            aq.id(R.id.content_tb).clear().gone();
            aq.id(R.id.content_ph).gone();
        }
        aq.id(R.id.content_action);
        if (icon != 0) {
            aq.visible().image(IconUtility.getCached(icon));
        } else {
            aq.gone();
        }
        aq.id(R.id.content_name).text(item.getContentName(), BufferType.SPANNABLE, true).tag(item);
        aq.id(R.id.content_desc).text(contentDesc, BufferType.SPANNABLE, true);
        aq.id(R.id.content_meta).text(item.getContentMeta(), BufferType.SPANNABLE, true);
    } else {
        aq.id(R.id.content_box).gone();
    }
    renderCount();
}
Also used : Entity(com.androidquery.simplefeed.data.Entity) PQuery(com.androidquery.simplefeed.PQuery)

Aggregations

PQuery (com.androidquery.simplefeed.PQuery)12 Entity (com.androidquery.simplefeed.data.Entity)4 View (android.view.View)3 ViewGroup (android.view.ViewGroup)2 ArrayAdapter (android.widget.ArrayAdapter)2 JSONObject (org.json.JSONObject)2 ActionBar (android.app.ActionBar)1 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 OnClickListener (android.content.DialogInterface.OnClickListener)1 WebView (android.webkit.WebView)1 TextView (android.widget.TextView)1 MarketService (com.androidquery.service.MarketService)1 PTransformer (com.androidquery.simplefeed.callback.PTransformer)1 FeedItem (com.androidquery.simplefeed.data.FeedItem)1 FeedMode (com.androidquery.simplefeed.enums.FeedMode)1 PagedAdapter (greendroid.widget.PagedAdapter)1 PagedView (greendroid.widget.PagedView)1 OnPagedViewChangeListener (greendroid.widget.PagedView.OnPagedViewChangeListener)1 JSONArray (org.json.JSONArray)1