use of cn.eoe.app.utils.ImageUtil.ImageCallback in project android-app by eoecn.
the class UserIntroFragment method initGridView.
private void initGridView() {
getData();
mAdapter = new SimpleAdapter(mContext, mList, R.layout.user_gridview_item_medal, new String[] { "img" }, new int[] { R.id.user_imageview_medal }) {
@Override
public void setViewImage(ImageView v, String value) {
// TODO Auto-generated method stub
super.setViewImage(v, value);
ImageUtil.setThumbnailView(value, v, mContext, new imageCallback(), false);
}
class imageCallback implements ImageCallback {
@Override
public void loadImage(Bitmap bitmap, String imagePath) {
// TODO Auto-generated method stub
try {
ImageView img = (ImageView) gvGrid.findViewWithTag(imagePath);
img.setImageBitmap(bitmap);
} catch (NullPointerException ex) {
Log.e("error", "ImageView = null");
}
}
}
};
gvGrid.setAdapter(mAdapter);
}
use of cn.eoe.app.utils.ImageUtil.ImageCallback in project android-app by eoecn.
the class DetailsDiscussActivity method initList.
private void initList() {
mlist = new ArrayList<Map<String, Object>>();
mAdapter = new SimpleAdapter(this, mlist, R.layout.details_discuss_item, new String[] { "image", "name", "content", "time" }, new int[] { R.id.details_imageview_head, R.id.details_textview_name, R.id.details_textview_content, R.id.details_textview_time }) {
@Override
public void setViewImage(ImageView v, String value) {
// TODO Auto-generated method stub
super.setViewImage(v, value);
ImageUtil.setThumbnailView(value, v, DetailsDiscussActivity.this, callback, false);
}
ImageCallback callback = new ImageCallback() {
@Override
public void loadImage(Bitmap bitmap, String imagePath) {
// TODO Auto-generated method stub
try {
ImageView img = (ImageView) mListview.findViewWithTag(imagePath);
img.setImageBitmap(bitmap);
} catch (Exception e) {
e.printStackTrace();
}
}
};
};
mListview.setAdapter(mAdapter);
}
Aggregations