本文整理汇总了Java中com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener类的典型用法代码示例。如果您正苦于以下问题:Java SimpleImageLoadingListener类的具体用法?Java SimpleImageLoadingListener怎么用?Java SimpleImageLoadingListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleImageLoadingListener类属于com.nostra13.universalimageloader.core.assist包,在下文中一共展示了SimpleImageLoadingListener类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = mInflater.inflate(R.layout.image_item, null);
}
Photo photo = getItem(position);
ImageView imageView = (ImageView) convertView.findViewById(R.id.image);
imageView.setTag(photo.getMediumUrl());
imageView.setImageBitmap(null);
ImageLoader.getInstance().cancelDisplayTask(imageView);
ImageLoader.getInstance().displayImage(photo.getMediumUrl(), imageView, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
if (view.getTag().equals(imageUri)) {
((ImageView) view).setImageBitmap(loadedImage);
}
}
});
return convertView;
}
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:23,代码来源:ImageAdapter.java
示例2: loadLogoActionBar
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
private void loadLogoActionBar(String logoUrl) {
ImageLoader.getInstance().loadImage(logoUrl, ImageLoaderUtils.UIL_USER_AVATAR_DISPLAY_OPTIONS,
new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedBitmap) {
setActionBarIcon(MediaUtils.getRoundIconDrawable(MainActivity.this, loadedBitmap));
}
});
}
示例3: loadActionBarLogo
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
protected void loadActionBarLogo(String logoUrl) {
ImageLoader.getInstance().loadImage(logoUrl, ImageLoaderUtils.UIL_USER_AVATAR_DISPLAY_OPTIONS,
new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedBitmap) {
setActionBarIcon(
MediaUtils.getRoundIconDrawable(BaseDialogActivity.this, loadedBitmap));
}
});
}
示例4: finishIFlate
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
public void finishIFlate(final View layout){
layout.setPadding(
paddingLeft==NONE_INT?0:paddingLeft,
paddingTop==NONE_INT?0:paddingTop,
paddingRight==NONE_INT?0:paddingRight,
paddingBottom==NONE_INT?0:paddingBottom);
// if(NONE_INT!=gravity)layout.setGravity(gravity);
if(NONE_INT!=backgroundColor)layout.setBackgroundColor(backgroundColor);
if(NONE_INT!=background)layout.setBackgroundResource(background);
if(NONE_INT!=id)layout.setId(id);
if(null!=imageuri){
imageLoader.loadImage(imageuri, options, new SimpleImageLoadingListener(){
@Override
public void onLoadingComplete(String imageUri, View view,
Bitmap loadedImage, String filePath) {
try{
Debug.dLog("loadImage:"+filePath);
// layout.setBackground(new BitmapDrawable(loadedImage));
layout.setBackgroundDrawable(new BitmapDrawable(loadedImage));
layout.postInvalidate();
}catch(Exception e){
Debug.dLog(e);
}
super.onLoadingComplete(imageUri, view, loadedImage, filePath);
}
});
}
onFinishIFlate(layout);
}
示例5: getDrawable
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
@Override
public Drawable getDrawable(String source) {
final URLDrawable urlDrawable = new URLDrawable();
ImageLoader.getInstance().loadImage(source, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String s, View view, Bitmap bitmap) {
if (bitmap != null) {
int width;
int height;
if (bitmap.getWidth() > mMaxWidth) {
width = mMaxWidth;
height = mMaxWidth * bitmap.getHeight() / bitmap.getWidth();
} else {
width = bitmap.getWidth();
height = bitmap.getHeight();
}
Drawable drawable = new BitmapDrawable(mContext.getResources(), bitmap);
drawable.setBounds(0, 0, width, height);
urlDrawable.setBounds(0, 0, width, height);
urlDrawable.mDrawable = drawable;
//reset text to invalidate.
mContainer.setText(mContainer.getText());
}
}
});
return urlDrawable;
}
示例6: setRelease
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
private void setRelease() {
((TextView) mRootView.findViewById(R.id.detail_title)).setText(mRelease.title);
((TextView) mRootView.findViewById(R.id.detail_artist)).setText(mRelease.artist);
((TextView) mRootView.findViewById(R.id.detail_label)).setText(mRelease.label);
((TextView) mRootView.findViewById(R.id.detail_format)).setText(mRelease.format_extended);
((TextView) mRootView.findViewById(R.id.detail_country)).setText(mRelease.country);
((TextView) mRootView.findViewById(R.id.detail_released)).setText(mRelease.released_formatted);
((TextView) mRootView.findViewById(R.id.detail_genre)).setText(mRelease.genres);
((TextView) mRootView.findViewById(R.id.detail_style)).setText(mRelease.styles);
((TextView) mRootView.findViewById(R.id.detail_notes)).setText(mRelease.notes);
((TextView) mRootView.findViewById(R.id.detail_marketplace)).setText("http://www.discogs.com/marketplace?release_id="+mRelease.releaseid);
if(mRelease.master_id!=0) {
((TextView) mRootView.findViewById(R.id.detail_marketplace_master)).setText("http://www.discogs.com/marketplace?master_id=" + mRelease.master_id);
} else {
mRootView.findViewById(R.id.detail_marketplace_master).setVisibility(View.GONE);
}
//decide to load big or small image
if(!mRelease.hasExtendedInfo) {
//we don't got extended info on this release yet, only display thumbnail
ImageView thumb = (ImageView) mRootView.findViewById(R.id.detail_thumb);
thumb.setVisibility(ImageView.VISIBLE);
mImageLoader.displayImage(mRelease.thumb,thumb);
} else {
ImageView image = (ImageView) mRootView.findViewById(R.id.detail_image);
if(mRelease.images().size()>0) {
Image img = mRelease.images().get(0);
mImageLoader.displayImage(img.uri, image, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(Bitmap loadedImage) {
super.onLoadingComplete(loadedImage);
//make the small thumbnail invisible
mRootView.findViewById(R.id.detail_thumb).setVisibility(ImageView.INVISIBLE);
}
});
}
}
}
示例7: getView
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = mInflater
.inflate(R.layout.zen_gallery_item, null);
}
ImageView GallerySelector = (ImageView) convertView
.findViewById(R.id.zen_gallery_selector);
final ImageView imageView = (ImageView) convertView
.findViewById(R.id.zen_gallery_item);
imageLoader.displayImage("file://" + imageUrls.get(position),
imageView, options, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(Bitmap loadedImage) {
Animation anim = AnimationUtils
.loadAnimation(ZenGalleryActivity.this,
R.anim.zen_fade_in);
imageView.setAnimation(anim);
anim.start();
}
});
int selector = (mSparseBooleanArray.get(position) ? R.drawable.checkbox_selected : R.drawable.checkbox_normal);
GallerySelector.setTag(position);
GallerySelector.setImageResource(selector);
return convertView;
}
示例8: sendNotification
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
public void sendNotification(final Message msg) {
if (TextUtils.isEmpty(msg.photo)){
doSendNotification(msg, null);
} else {
ImageLoader.getInstance().loadImage(msg.photo, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
doSendNotification(msg, loadedImage);
}
});
}
}
示例9: getView
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
convertView = infalter.inflate(R.layout.gallery_item, null);
holder = new ViewHolder();
holder.imgQueue = (ImageView) convertView
.findViewById(R.id.imgQueue);
holder.imgQueueMultiSelected = (ImageView) convertView
.findViewById(R.id.imgQueueMultiSelected);
if (isActionMultiplePick) {
holder.imgQueueMultiSelected.setVisibility(View.VISIBLE);
} else {
holder.imgQueueMultiSelected.setVisibility(View.GONE);
}
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.imgQueue.setTag(position);
try {
imageLoader.displayImage("file://" + data.get(position).sdcardPath,
holder.imgQueue, new SimpleImageLoadingListener() {
@Override
public void onLoadingStarted(String imageUri, View view) {
holder.imgQueue
.setImageResource(R.drawable.no_media);
super.onLoadingStarted(imageUri, view);
}
});
if (isActionMultiplePick) {
holder.imgQueueMultiSelected
.setSelected(data.get(position).isSeleted);
}
} catch (Exception e) {
e.printStackTrace();
}
return convertView;
}
示例10: getView
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
convertView = infalter.inflate(R.layout.gallery_item, null);
holder = new ViewHolder();
holder.imgQueue = (ImageView) convertView
.findViewById(R.id.imgQueue);
holder.imgQueueMultiSelected = (ImageView) convertView
.findViewById(R.id.imgQueueMultiSelected);
if (isActionMultiplePick) {
holder.imgQueueMultiSelected.setVisibility(View.VISIBLE);
} else {
holder.imgQueueMultiSelected.setVisibility(View.GONE);
}
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.imgQueue.setTag(position);
try {
imageLoader.displayImage("file://" + data.get(position).sdcardPath,
holder.imgQueue, new SimpleImageLoadingListener() {
@Override
public void onLoadingStarted(String imageUri, View view) {
holder.imgQueue
.setImageResource(R.drawable.no_media);
super.onLoadingStarted(imageUri, view);
}
});
if (isActionMultiplePick) {
holder.imgQueueMultiSelected
.setSelected(data.get(position).isSeleted);
}
} catch (Exception e) {
e.printStackTrace();
}
return convertView;
}
示例11: onCreate
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ParseAnalytics.trackAppOpened(getIntent());
setContentView(R.layout.main);
mLastHour = new Date();
mLastHour.setHours(mLastHour.getHours() - 2);
// Instantiate a QueryFactory to define the ParseQuery to be used for fetching items in this
// Adapter.
ParseQueryAdapter.QueryFactory<ParseObject> factory =
new ParseQueryAdapter.QueryFactory<ParseObject>() {
public ParseQuery<ParseObject> create() {
ParseQuery<ParseObject> query = new ParseQuery<ParseObject>("Image");
// query.whereGreaterThan("createdAt", mLastHour);
query.orderByDescending("createdAt");
return query;
}
};
mAdapter = new ParseQueryAdapter<ParseObject>(this, factory) {
@Override
public View getItemView(ParseObject object, View v, ViewGroup parent) {
if (v == null) {
v = View.inflate(FotoFlickActivity.this, R.layout.photo, null);
}
super.getItemView(object, v, parent);
final ImageView imgView = (ImageView)v;
ImageLoader.getInstance()
.loadImage(object.getString("imageURLString")
, mTargetSize
, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
imgView.setImageBitmap(loadedImage);
}
});
imgView.setOnClickListener(mListener);
return v;
}
};
// Perhaps set a callback to be fired upon successful loading of a new set of ParseObjects.
mAdapter.addOnQueryLoadListener(new OnQueryLoadListener<ParseObject>() {
@Override
public void onLoading() {
mProgressBar.setVisibility(View.VISIBLE);
}
@Override
public void onLoaded(List<ParseObject> objects, Exception e) {
mProgressBar.setVisibility(View.GONE);
android.util.Log.d("Foto", "onLoaded");
if (objects != null) {
android.util.Log.d("Foto", "parsing objects: " + objects.size());
}
}
});
mGridView = (GridView) findViewById(R.id.photo_grid);
mProgressBar = (ProgressBar) findViewById(R.id.progress);
mGridView.setAdapter(mAdapter);
}