本文整理汇总了Java中com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer类的典型用法代码示例。如果您正苦于以下问题:Java FadeInBitmapDisplayer类的具体用法?Java FadeInBitmapDisplayer怎么用?Java FadeInBitmapDisplayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FadeInBitmapDisplayer类属于com.nostra13.universalimageloader.core.display包,在下文中一共展示了FadeInBitmapDisplayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CategoryController
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
CategoryController(final Activity activity, LoaderManager loaderManager, View itemView) {
super(itemView);
this.activity = activity;
this.loaderManager = loaderManager;
appCardsAdapter = new AppPreviewAdapter(activity);
viewAll = (Button) itemView.findViewById(R.id.button);
viewAll.setOnClickListener(onViewAll);
heading = (TextView) itemView.findViewById(R.id.name);
image = (FeatureImage) itemView.findViewById(R.id.category_image);
background = (FrameLayout) itemView.findViewById(R.id.category_background);
RecyclerView appCards = (RecyclerView) itemView.findViewById(R.id.app_cards);
appCards.setAdapter(appCardsAdapter);
appCards.addItemDecoration(new ItemDecorator(activity));
displayImageOptions = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.imageScaleType(ImageScaleType.NONE)
.displayer(new FadeInBitmapDisplayer(100, true, true, false))
.bitmapConfig(Bitmap.Config.RGB_565)
.build();
}
示例2: getImageLoaderOptions
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
/**
* 图片显示配置
*
* @return
*/
public static DisplayImageOptions getImageLoaderOptions() {
BitmapFactory.Options op = new BitmapFactory.Options();
op.inSampleSize = 4;
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.ic_account_circle)
.showImageForEmptyUri(R.drawable.ic_account_circle)
.showImageOnFail(R.drawable.ic_account_circle)
.bitmapConfig(Bitmap.Config.RGB_565)
.cacheInMemory(true)
.cacheOnDisk(true)
.decodingOptions(op)
.displayer(new FadeInBitmapDisplayer(animTime)) // 设置动画淡入效果
.build();
return options;
}
示例3: WallpapersAdapter
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
public WallpapersAdapter(@NonNull Context context, @NonNull List<Wallpaper> wallpapers,
boolean isFavoriteMode, boolean isSearchMode) {
mContext = context;
mWallpapers = wallpapers;
mIsFavoriteMode = isFavoriteMode;
WallpaperBoardApplication.sIsClickable = true;
if (isSearchMode) {
mWallpapersAll = new ArrayList<>();
mWallpapersAll.addAll(mWallpapers);
}
mOptions = ImageConfig.getRawDefaultImageOptions();
mOptions.resetViewBeforeLoading(true);
mOptions.cacheInMemory(true);
mOptions.cacheOnDisk(true);
mOptions.displayer(new FadeInBitmapDisplayer(700));
}
示例4: getFadeInOption
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
/**
* 获取一个渐显图片的配置
*
* @return
*/
public static DisplayImageOptions getFadeInOption(int durationMillis,
boolean animateFromNetwork, boolean animateFromDisk,
boolean animateFromMemory)
{
DisplayImageOptions options = new DisplayImageOptions.Builder()
.
// 网络图片下载完成之前的预加载的默认图片
showImageOnLoading(R.mipmap.ic_launcher)
.
// 网络图片下载失败后显示该默认图片
showImageOnFail(R.mipmap.ic_launcher)
.
// 图片的质量
bitmapConfig(Bitmap.Config.RGB_565)
.cacheInMemory(true)
.cacheOnDisk(true)
.displayer(
new FadeInBitmapDisplayer(durationMillis,
animateFromNetwork, animateFromDisk,
animateFromMemory)).build();
return options;
}
示例5: setImageByUrl
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
/**
* 为ImageView设置图片
*
* @param viewId
* @return
*/
public ViewHolder setImageByUrl(int viewId, String url)
{
ImageView iv = getView(viewId);
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.mipmap.ic_launcher)
.showImageOnFail(R.mipmap.ic_launcher)
// 设置图片质量
.bitmapConfig(Bitmap.Config.RGB_565)
// 设置内存缓存
.cacheInMemory(true)
// 设置磁盘缓存
.cacheOnDisk(true)
// 设置图片特效
.displayer(new FadeInBitmapDisplayer(300)).build();
ImageLoader.getInstance().displayImage(url,iv,
ImageLoaderUtil.getFadeInOption(200,true,true,true));
return this;
}
示例6: initImageLoader
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
private void initImageLoader() {
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
.threadPoolSize(5)
.threadPriority(Thread.NORM_PRIORITY - 2)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024))
.memoryCacheSize(2 * 1024)
.defaultDisplayImageOptions(new DisplayImageOptions.Builder()
.showImageForEmptyUri(R.drawable.no_photo_group)
.showImageOnFail(R.drawable.no_photo_group)
.resetViewBeforeLoading(true)
.displayer(new FadeInBitmapDisplayer(300)).build())
.tasksProcessingOrder(QueueProcessingType.LIFO).build();
ImageLoader.getInstance().init(config);
com.nostra13.universalimageloader.utils.L.writeLogs(false);
}
示例7: RequestAdapter
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
public RequestAdapter(@NonNull Context context, @NonNull List<Request> requests, int spanCount) {
mContext = context;
mRequests = requests;
mTextColorSecondary = ColorHelper.getAttributeColor(mContext,
android.R.attr.textColorSecondary);
mTextColorAccent = ColorHelper.getAttributeColor(mContext, R.attr.colorAccent);
mSelectedItems = new SparseBooleanArray();
mShowShadow = (spanCount == 1);
mShowPremiumRequest = Preferences.get(mContext).isPremiumRequestEnabled();
mOptions = ImageConfig.getRawDefaultImageOptions();
mOptions.resetViewBeforeLoading(true);
mOptions.cacheInMemory(true);
mOptions.cacheOnDisk(false);
mOptions.showImageOnFail(R.drawable.ic_app_default);
mOptions.displayer(new FadeInBitmapDisplayer(700));
}
示例8: getDisplayOptions
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
public DisplayImageOptions getDisplayOptions() {
DisplayImageOptions options;
options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.loading) // 设置图片在下载期间显示的图片
.showImageForEmptyUri(R.drawable.load_fail)// 设置图片Uri为空或是错误的时候显示的图片
.showImageOnFail(R.drawable.loading) // 设置图片加载/解码过程中错误时候显示的图片
.cacheInMemory(true)// 设置下载的图片是否缓存在内存中
.cacheOnDisk(true) //外存缓存
.cacheOnDisc(true)// 设置下载的图片是否缓存在SD卡中
.considerExifParams(true) // 是否考虑JPEG图像EXIF参数(旋转,翻转)
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)// 设置图片以如何的编码方式显示
.bitmapConfig(Bitmap.Config.RGB_565)// 设置图片的解码类型//
// .delayBeforeLoading(int delayInMillis)//int
// delayInMillis为你设置的下载前的延迟时间
// 设置图片加入缓存前,对bitmap进行设置
// .preProcessor(BitmapProcessor preProcessor)
.resetViewBeforeLoading(true)// 设置图片在下载前是否重置,复位
// .displayer(new RoundedBitmapDisplayer(20))// 是否设置为圆角,弧度为多少
.displayer(new FadeInBitmapDisplayer(50))// 是否图片加载好后渐入的动画时间
.build();// 构建完成
return options;
}
示例9: UILKit
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
/**
* 初始化
*
* @param context
*/
private UILKit(Context context) {
File cacheDir = getDiskCacheDir(context, "img");
ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context)
.threadPriority(Thread.NORM_PRIORITY - 2)
.denyCacheImageMultipleSizesInMemory()
.memoryCacheSize(10 * 1024 * 1024)
.diskCache(new UnlimitedDiskCache(cacheDir))
.diskCacheFileNameGenerator(new Md5FileNameGenerator())
.diskCacheSize(50 * 1024 * 1024) // 50 MiB
.tasksProcessingOrder(QueueProcessingType.LIFO);
ImageLoader.getInstance().init(config.build());
picOptions = new DisplayImageOptions.Builder()
.imageScaleType(ImageScaleType.EXACTLY)
.cacheOnDisk(false).cacheInMemory(false)
.resetViewBeforeLoading(true)
.displayer(new FadeInBitmapDisplayer(500)).build();
}
示例10: getDisplayImageOptionsFactory
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
private static DisplayImageOptions getDisplayImageOptionsFactory(int resId) {
if (mOptionsMap.containsKey(resId)) {
return mOptionsMap.get(resId);
}
DisplayImageOptions.Builder builder = new DisplayImageOptions.Builder();
builder.imageScaleType(ImageScaleType.EXACTLY).cacheOnDisk(true)
.cacheInMemory(true).bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new FadeInBitmapDisplayer(300));
if (resId != 0) {
builder.showImageOnFail(resId).showImageForEmptyUri(resId)
.showImageOnLoading(resId);
}
mOptions = builder.build();
mOptionsMap.put(resId, mOptions);
return mOptions;
}
示例11: onLoadingComplete
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
@Override
public void onLoadingComplete(String imageUri, View view,
Bitmap loadedImage) {
if (imageUri.equals(view.getTag())) {
L.e(String.valueOf(view.getTag()));
((ImageView)view).setImageBitmap(loadedImage);
return;
}
if (loadedImage != null) {
ImageView imageView = (ImageView) view;
boolean firstDisplay = !displayedImages.contains(imageUri);
if (firstDisplay) {
FadeInBitmapDisplayer.animate(imageView, 500);
displayedImages.add(imageUri);
}
}
}
示例12: MessageChatAdapter
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
public MessageChatAdapter(Context context,List<BmobMsg> msgList) {
super(context, msgList);
currentObjectId = BmobUserManager.getInstance(context).getCurrentUserObjectId();
options = new DisplayImageOptions.Builder()
.showImageForEmptyUri(R.drawable.ic_launcher)
.showImageOnFail(R.drawable.ic_launcher)
.resetViewBeforeLoading(true)
.cacheOnDisc(true)
.cacheInMemory(true)
.imageScaleType(ImageScaleType.EXACTLY)
.bitmapConfig(Bitmap.Config.RGB_565)
.considerExifParams(true)
.displayer(new FadeInBitmapDisplayer(300))
.build();
}
示例13: onCreate
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_img_page);
options = new DisplayImageOptions.Builder()
.resetViewBeforeLoading(true)
.cacheOnDisc(true)
.imageScaleType(ImageScaleType.EXACTLY)
.bitmapConfig(Bitmap.Config.RGB_565)
.considerExifParams(true)
.displayer(new FadeInBitmapDisplayer(0))
.build();
url=getIntent().getStringExtra("url");
initView();
initData();
}
示例14: initLib
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
private void initLib() {
// 初始化日志功能, 开启/关闭 日志输出
L.setLogOpen(AppConstant.LOG_OPEN);
// 初始化自定义异常捕获
CrashHandler.getInstance().init(this);
// 初始化ImageLoader
// 设置图片显示选项
DisplayImageOptions displayOp = new DisplayImageOptions.Builder()
.showImageOnLoading(0)// 图片正在加载时显示的背景
.cacheInMemory(true)// 缓存在内存中
.cacheOnDisk(true)// 缓存在磁盘中
.displayer(new FadeInBitmapDisplayer(300))// 显示渐变动画
.bitmapConfig(Bitmap.Config.RGB_565) // 设置图片的解码类型
.considerExifParams(true)// 考虑旋转角
.build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
getApplicationContext()).defaultDisplayImageOptions(displayOp)
.denyCacheImageMultipleSizesInMemory()// 不解析多种尺寸
.build();
ImageLoader.getInstance().init(config);
}
示例15: MessageChatAdapter
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; //导入依赖的package包/类
public MessageChatAdapter(Context context,List<BmobMsg> msgList) {
// TODO Auto-generated constructor stub
super(context, msgList);
currentObjectId = BmobUserManager.getInstance(context).getCurrentUserObjectId();
options = new DisplayImageOptions.Builder()
.showImageForEmptyUri(R.drawable.ic_launcher)
.showImageOnFail(R.drawable.ic_launcher)
.resetViewBeforeLoading(true)
.cacheOnDisc(true)
.cacheInMemory(true)
.imageScaleType(ImageScaleType.EXACTLY)
.bitmapConfig(Bitmap.Config.RGB_565)
.considerExifParams(true)
.displayer(new FadeInBitmapDisplayer(300))
.build();
}