use of android.widget.ImageView in project androidquery by androidquery.
the class BitmapAjaxCallback method async.
@Override
public void async(Context context) {
String url = getUrl();
ImageView v = this.v.get();
if (url == null) {
showProgress(false);
setBitmap(url, v, null, false);
return;
}
Bitmap bm = memGet(url);
if (bm != null) {
v.setTag(AQuery.TAG_URL, url);
status = new AjaxStatus().source(AjaxStatus.MEMORY).done();
callback(url, bm, status);
return;
}
presetBitmap(url, v);
if (!queueMap.containsKey(url)) {
addQueue(url, v);
super.async(v.getContext());
} else {
showProgress(true);
addQueue(url, v);
}
}
use of android.widget.ImageView in project androidquery by androidquery.
the class AQueryImageTest method testImageByCallback2.
public void testImageByCallback2() {
clearCache();
AQUtility.post(new Runnable() {
@Override
public void run() {
BitmapAjaxCallback cb = new BitmapAjaxCallback() {
protected void callback(String url, ImageView iv, Bitmap bm, AjaxStatus status) {
iv.setImageBitmap(bm);
}
};
aq.id(R.id.image).image(ICON_URL, true, true, 0, 0, cb);
}
});
waitAsync(2000);
assertLoaded(aq.getImageView(), true);
Bitmap bm = aq.getCachedImage(ICON_URL);
assertNotNull(bm);
}
use of android.widget.ImageView in project androidquery by androidquery.
the class AQueryImageTest method testImageByCallbackAsync.
public void testImageByCallbackAsync() {
clearCache();
AQUtility.post(new Runnable() {
@Override
public void run() {
//aq.id(R.id.image).image(ICON_URL, true, true, 0, 0, null, AQuery.FADE_IN);
BitmapAjaxCallback cb = new BitmapAjaxCallback();
cb.url(ICON_URL);
//aq.id(R.id.image).image(cb);
ImageView iv = aq.id(R.id.image).getImageView();
cb.imageView(iv).async(getActivity());
}
});
waitAsync(2000);
assertLoaded(aq.getImageView(), true);
Bitmap bm = aq.getCachedImage(ICON_URL);
assertNotNull(bm);
}
use of android.widget.ImageView in project making-apps-beautiful by ankurkotwal.
the class ArticleDetailFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_article_detail, container, false);
// Show the dummy content as text in a TextView.
if (mItem != null) {
((TextView) rootView.findViewById(R.id.article_title)).setText(mItem.title);
((TextView) rootView.findViewById(R.id.article_byline)).setText(Html.fromHtml(mItem.time.toUpperCase(Locale.getDefault()) + " BY <font color='" + getResources().getString(R.string.author_font_color) + "'>" + mItem.author.toUpperCase(Locale.getDefault()) + "</a>"));
// ((TextView) rootView.findViewById(R.id.article_date))
// .setText(mItem.time);
((TextView) rootView.findViewById(R.id.article_body)).setText(Html.fromHtml(mItem.content));
((TextView) rootView.findViewById(R.id.article_body)).setTypeface(Typeface.createFromAsset(getResources().getAssets(), "Rosario-Regular.ttf"));
((ImageView) rootView.findViewById(R.id.photo)).setImageDrawable(getResources().getDrawable(mItem.photoResId));
}
return rootView;
}
use of android.widget.ImageView in project making-apps-beautiful by ankurkotwal.
the class ArticleDetailFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_article_detail, container, false);
// Show the dummy content as text in a TextView.
if (mItem != null) {
((TextView) rootView.findViewById(R.id.article_title)).setText(mItem.title);
((TextView) rootView.findViewById(R.id.article_byline)).setText(Html.fromHtml(mItem.time.toUpperCase(Locale.getDefault()) + " BY <font color='" + getResources().getString(R.string.author_font_color) + "'>" + mItem.author.toUpperCase(Locale.getDefault()) + "</a>"));
((TextView) rootView.findViewById(R.id.article_byline)).setMovementMethod(new LinkMovementMethod());
// ((TextView) rootView.findViewById(R.id.article_date))
// .setText(mItem.time);
((TextView) rootView.findViewById(R.id.article_body)).setText(Html.fromHtml(mItem.content));
((TextView) rootView.findViewById(R.id.article_body)).setTypeface(Typeface.createFromAsset(getResources().getAssets(), "Rosario-Regular.ttf"));
((ImageView) rootView.findViewById(R.id.photo)).setImageDrawable(getResources().getDrawable(mItem.photoResId));
}
return rootView;
}
Aggregations