本文整理汇总了Java中com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer类的典型用法代码示例。如果您正苦于以下问题:Java SimpleBitmapDisplayer类的具体用法?Java SimpleBitmapDisplayer怎么用?Java SimpleBitmapDisplayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleBitmapDisplayer类属于com.nostra13.universalimageloader.core.display包,在下文中一共展示了SimpleBitmapDisplayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TitlePopupMenu
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
@SuppressLint({"InflateParams"})
public TitlePopupMenu(Context context, int width, int height) {
this.LIST_PADDING = 10;
this.mRect = new Rect();
this.mLocation = new int[2];
this.popupGravity = 0;
this.menus = new ArrayList();
this.menusAdapter = new MenusAdapter();
this.mContext = context;
this.options = new Builder().showImageOnLoading(R.drawable.lemallsdk_icon_default).showImageForEmptyUri(R.drawable.lemallsdk_icon_default).showImageOnFail(R.drawable.lemallsdk_icon_default).cacheInMemory(true).cacheOnDisc(true).bitmapConfig(Config.RGB_565).imageScaleType(ImageScaleType.IN_SAMPLE_INT).displayer(new SimpleBitmapDisplayer()).build();
setFocusable(true);
setTouchable(true);
setOutsideTouchable(true);
this.mScreenWidth = ScreenUtil.getScreenWidth(this.mContext);
this.mScreenHeight = ScreenUtil.getScreenHeight(this.mContext);
setWidth(width);
setHeight(height);
setAnimationStyle(R.style.AnimationPreview);
update();
setBackgroundDrawable(new BitmapDrawable());
setContentView(LayoutInflater.from(this.mContext).inflate(R.layout.lemallsdk_title_popup_menu, null));
initUI();
}
示例2: BaseDataAdapter
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
public BaseDataAdapter(Context context, List<? extends BmobObject> mDatas) {
this.context = context;
this.mDatas = mDatas;
options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.mipmap.icon_live_item_default)
.showImageForEmptyUri(R.mipmap.icon_live_item_default)
.showImageOnFail(R.mipmap.icon_live_item_default)
.cacheInMemory(false)
.cacheOnDisk(true)
.considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new SimpleBitmapDisplayer())
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
.build();
if (this.context == null) {
System.out.println("this.context is null");
} else {
mlayoutInflate = LayoutInflater.from(this.context);
}
}
示例3: executeLoadImage
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
protected void executeLoadImage() {
if (TextUtils.isEmpty(url)) {
setImageResource(R.drawable.image_loading_resource);
} else {
DisplayImageOptions.Builder builder = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.image_loading_resource)
.cacheInMemory(true)
.cacheOnDisk(true)
.displayer(new SimpleBitmapDisplayer());
DisplayImageOptions options = builder.build();
ImageLoader.getInstance().displayImage(url, this, options, imageLoadingListener);
}
}
示例4: initUniversalImageLoaderLibrary
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
/**
* Android-Universal-Image-Loader config.
*
* DON'T COPY THIS CODE TO YOUR REAL PROJECT! *
* I would recommend doing it in an overloaded Application.onCreate().
* It is just for test purpose
*
*
*/
private void initUniversalImageLoaderLibrary(){
File cacheDir = StorageUtils.getCacheDirectory(getActivity());
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getActivity())
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.defaultDisplayImageOptions(DisplayImageOptions.createSimple())
.writeDebugLogs()
.build();
ImageLoader.getInstance().init(config);
options = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.displayer(new SimpleBitmapDisplayer())
.showImageOnFail(R.drawable.ic_error_loadingsmall)
.build();
}
示例5: disPlay
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
public static void disPlay(String uri, ImageAware imageAware,int defaultPic){
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(defaultPic)
.showImageForEmptyUri(defaultPic)
.showImageOnFail(defaultPic)
.cacheInMemory(true)
.cacheOnDisc(false)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new SimpleBitmapDisplayer())
.build();
imageLoader.displayImage(uri, imageAware, options);
}
示例6: MyAdapter
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
public MyAdapter(Context context, List<LocalImageHelper.LocalFile> paths) {
m_context = context;
this.paths = paths;
options = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(false)
.showImageForEmptyUri(FakeR.getId(context, "drawable", "cb_no_pic_small"))
.showImageOnFail(FakeR.getId(context, "drawable", "cb_no_pic_small"))
.showImageOnLoading(FakeR.getId(context, "drawable", "cb_no_pic_small"))
.bitmapConfig(Bitmap.Config.RGB_565)
.setImageSize(new ImageSize(app.getQuarterWidth(), 0))
.displayer(new SimpleBitmapDisplayer()).build();
}
示例7: FolderAdapter
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
FolderAdapter(Context context, Map<String, List<LocalImageHelper.LocalFile>> folders) {
this.folders = folders;
this.context = context;
folderNames = new ArrayList<String>();
options = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(false)
.showImageForEmptyUri(FakeR.getId(context, "drawable", "cb_no_pic_small"))
.showImageOnFail(FakeR.getId(context, "drawable", "cb_no_pic_small"))
.showImageOnLoading(FakeR.getId(context, "drawable", "cb_no_pic_small"))
.bitmapConfig(Bitmap.Config.RGB_565)
.setImageSize(new ImageSize(app.getQuarterWidth(), 0))
.displayer(new SimpleBitmapDisplayer()).build();
Iterator iter = folders.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
String key = (String) entry.getKey();
folderNames.add(key);
}
//根据文件夹内的图片数量降序显示
Collections.sort(folderNames, new Comparator<String>() {
public int compare(String arg0, String arg1) {
Integer num1 = helper.getFolder(arg0).size();
Integer num2 = helper.getFolder(arg1).size();
return num2.compareTo(num1);
}
});
}
示例8: AlbumViewPager
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
/** 播放按钮点击事件 */
public AlbumViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
localOptions=new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(false)
.bitmapConfig(Bitmap.Config.RGB_565)
.imageScaleType(ImageScaleType.EXACTLY)
.displayer(new SimpleBitmapDisplayer()).build();
//DisplayImageOptions.getDefaltOpitions(0, R.drawable.dangkr_no_picture,
//((AppContext)context.getApplicationContext()).getWindowWidth());
}
示例9: initImageLoader
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
private void initImageLoader() {
File cacheDir = FileUtil.getCacheDirectory(this, FilePathConfig.PATH_IMAGEDOWNLOADER);
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.default_imageview_background) // resource or drawable
.showImageForEmptyUri(R.drawable.default_imageview_background) // resource or drawable
.showImageOnFail(R.drawable.default_imageview_background) // resource or drawable
.resetViewBeforeLoading(false) // default
.delayBeforeLoading(200)
.cacheInMemory(true)
.cacheOnDisk(true)
.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default
.bitmapConfig(Bitmap.Config.ARGB_8888) // default
.displayer(new SimpleBitmapDisplayer()) // default
.build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
.diskCacheExtraOptions(480, 800, null)
.threadPoolSize(3) // default
.threadPriority(Thread.NORM_PRIORITY - 2) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(20 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.diskCache(new UnlimitedDiskCache(cacheDir)) // default
.diskCacheSize(50 * 1024 * 1024)
.diskCacheFileCount(100)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(getApplicationContext())) // default
.imageDecoder(new BaseImageDecoder(false)) // default
.defaultDisplayImageOptions(options)
.build();
ImageLoader.getInstance().init(config);
}
示例10: initIDs
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
private void initIDs() {
lv = (ListView) this.findViewById(R.id.firststep_lv);
fixed_view = (LinearLayout) this.findViewById(R.id.fixed_to_top);
viewPager = (ViewPager) headview1.findViewById(R.id.firststep_viewpage);
btn_opendrawer = (Button) this.findViewById(R.id.btn_opendrawer);
btn_openMyLove = (Button) this.findViewById(R.id.btn_openmylove);
drawerlayout = (DrawerLayout) this.findViewById(R.id.drawerlayout);
btn_restaurant = (Button) headview2.findViewById(R.id.btn_restaurant);
btn_cuisine = (Button) headview2.findViewById(R.id.btn_cuisine);
btn_district = (Button) headview2.findViewById(R.id.btn_district);
btn_restaurant1 = (Button) this.findViewById(R.id.btn_restaurant1);
btn_cuisine1 = (Button) this.findViewById(R.id.btn_cuisine1);
btn_district1 = (Button) this.findViewById(R.id.btn_district1);
btn_opendrawer.setOnClickListener(this);
btn_openMyLove.setOnClickListener(this);
btn_restaurant.setOnClickListener(this);
btn_cuisine.setOnClickListener(this);
btn_district.setOnClickListener(this);
btn_restaurant1.setOnClickListener(this);
btn_cuisine1.setOnClickListener(this);
btn_district1.setOnClickListener(this);
//获取登录帐号
SharedPreferences sp = MainActivity.this.getSharedPreferences("userMessage", MODE_PRIVATE);
loginName = sp.getString("loginName", "");
//先定义一个加载图片的option
options = new DisplayImageOptions.Builder().showImageOnLoading(R.mipmap.loadingpic)
.showImageOnFail(R.mipmap.loadingfailed).cacheInMemory(true).cacheOnDisk(true).displayer(new SimpleBitmapDisplayer()).build();
}
示例11: BannerAdapter
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
public BannerAdapter(Context context, List<String> datas) {
super(context, datas);
mDisplayImageOptions = new DisplayImageOptions.Builder()
.cacheInMemory(true)//设置下载的图片是否缓存在内存中
.cacheOnDisk(true)//设置下载的图片是否缓存在SD卡中
.considerExifParams(true) //是否考虑JPEG图像EXIF参数(旋转,翻转)
.imageScaleType(ImageScaleType.NONE)//设置图片以如何的编码方式显示
.bitmapConfig(Bitmap.Config.RGB_565)//设置图片的解码类型
.resetViewBeforeLoading(true)//设置图片在下载前是否重置,复位
.displayer(new SimpleBitmapDisplayer())//是否图片加载好后渐入的动画时间
.build();//构建完成
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mViewCache = new ArrayBlockingQueue<>(2);
}
示例12: getDefaultDisplayImageOptions
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
public static DisplayImageOptions getDefaultDisplayImageOptions() {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.resetViewBeforeLoading(false).delayBeforeLoading(100)
.considerExifParams(false)
.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new SimpleBitmapDisplayer()).handler(new Handler())
.cacheInMemory(true).cacheOnDisk(true)
// .showImageForEmptyUri(R.drawable.default_pic)
// .showImageOnFail(R.drawable.default_pic)
.build();
return options;
}
示例13: getAvatarDisplayImageOptions
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
public static DisplayImageOptions getAvatarDisplayImageOptions() {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.resetViewBeforeLoading(false).delayBeforeLoading(100)
.considerExifParams(false)
.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new SimpleBitmapDisplayer()).handler(new Handler())
.cacheInMemory(true).cacheOnDisk(true)
.showImageForEmptyUri(R.drawable.ic_protrait_solid)
.showImageOnFail(R.drawable.ic_protrait_solid)
.build();
return options;
}
示例14: initNoCacheImageLoader
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
/**
* 初始化 ImageLoader
*
* @param context
*/
public static ImageLoader initNoCacheImageLoader(Context context) {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.resetViewBeforeLoading(false).delayBeforeLoading(100)
.considerExifParams(false)
.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new SimpleBitmapDisplayer()).handler(new Handler())
.cacheInMemory(false).cacheOnDisk(false)
// .showImageForEmptyUri(R.drawable.default_pic)
// .showImageOnFail(R.drawable.default_pic)
.build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
context.getApplicationContext())
.threadPoolSize(10)
.threadPriority(Thread.NORM_PRIORITY - 2)
.tasksProcessingOrder(QueueProcessingType.FIFO)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new UsingFreqLimitedMemoryCache(3 * 1024 * 1024))
.imageDownloader(
new BaseImageDownloader(context.getApplicationContext()))
.defaultDisplayImageOptions(options)
// .writeDebugLogs()
.build();
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.init(config);
return imageLoader;
}
示例15: getDisplayImageOptions
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; //导入依赖的package包/类
public static DisplayImageOptions getDisplayImageOptions(Drawable drawableEmpty, Drawable drawableFail) {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.resetViewBeforeLoading(false).delayBeforeLoading(100)
.considerExifParams(false)
.imageScaleType(ImageScaleType.IN_SAMPLE_INT)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new SimpleBitmapDisplayer()).handler(new Handler())
.cacheInMemory(true).cacheOnDisk(true)
.showImageForEmptyUri(drawableEmpty)
.showImageOnFail(drawableFail)
.build();
return options;
}