当前位置: 首页>>代码示例>>Java>>正文


Java ImageDownloader类代码示例

本文整理汇总了Java中com.nostra13.universalimageloader.core.download.ImageDownloader的典型用法代码示例。如果您正苦于以下问题:Java ImageDownloader类的具体用法?Java ImageDownloader怎么用?Java ImageDownloader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ImageDownloader类属于com.nostra13.universalimageloader.core.download包,在下文中一共展示了ImageDownloader类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ImageDecodingInfo

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public ImageDecodingInfo(String imageKey, String imageUri, String originalImageUri, ImageSize targetSize, ViewScaleType viewScaleType,
						 ImageDownloader downloader, DisplayImageOptions displayOptions) {
	this.imageKey = imageKey;
	this.imageUri = imageUri;
	this.originalImageUri = originalImageUri;
	this.targetSize = targetSize;

	this.imageScaleType = displayOptions.getImageScaleType();
	this.viewScaleType = viewScaleType;

	this.downloader = downloader;
	this.extraForDownloader = displayOptions.getExtraForDownloader();

	considerExifParams = displayOptions.isConsiderExifParams();
	decodingOptions = new Options();
	copyOptions(displayOptions.getDecodingOptions(), decodingOptions);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:ImageDecodingInfo.java

示例2: getStickerBitmapUri

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public String getStickerBitmapUri(String categoryName, String stickerName) {
    StickerManager manager = StickerManager.getInstance();
    StickerCategory category = manager.getCategory(categoryName);
    if (category == null) {
        return null;
    }

    if (isSystemSticker(categoryName)) {
        if (!stickerName.contains(".png")) {
            stickerName += ".png";
        }

        String path = "sticker/" + category.getName() + "/" + stickerName;
        return ImageDownloader.Scheme.ASSETS.wrap(path);
    }

    return null;
}
 
开发者ID:LegendKe,项目名称:MyTravelingDiary,代码行数:19,代码来源:StickerManager.java

示例3: tryLoadBitmap

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
Bitmap tryLoadBitmap(ImageViewAware imageAware) {
    Bitmap bitmap = null;
    try {
        java.io.File imageFile = diskCache.get(getMessage().get_id());
        if (imageFile != null && imageFile.exists() && imageFile.length() > 0) {
            ViewScaleType viewScaleType = imageAware.getScaleType();
            ImageSize imageSize = ImageSizeUtils.defineTargetSizeForView(imageAware, new ImageSize(MainApp.CONTEXT.getResources().getDisplayMetrics().widthPixels, MainApp.CONTEXT.getResources().getDisplayMetrics().heightPixels));
            ImageDecodingInfo decodingInfo = new ImageDecodingInfo(getMessage().get_id(),
                    ImageDownloader.Scheme.FILE.wrap(imageFile.getAbsolutePath()), getMessage().get_id(), imageSize, viewScaleType,
                    new BaseImageDownloader(MainApp.CONTEXT), options);
            bitmap = decoder.decode(decodingInfo);
            MainApp.memoryCache.put(getMessage().get_id(), bitmap);
        }
    } catch (Exception ignored) {
        ignored.printStackTrace();
    }
    return bitmap;
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:19,代码来源:VideoRow.java

示例4: ImageDecodingInfo

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public ImageDecodingInfo(String imageKey, String imageUri, ImageSize targetSize, ViewScaleType viewScaleType,
						 ImageDownloader downloader, DisplayImageOptions displayOptions) {
	this.imageKey = imageKey;
	this.imageUri = imageUri;
	this.targetSize = targetSize;

	this.imageScaleType = displayOptions.getImageScaleType();
	this.viewScaleType = viewScaleType;

	this.downloader = downloader;
	this.extraForDownloader = displayOptions.getExtraForDownloader();

	considerExifParams = displayOptions.isConsiderExifParams();
	decodingOptions = new Options();
	copyOptions(displayOptions.getDecodingOptions(), decodingOptions);
}
 
开发者ID:Apokrif,项目名称:morse,代码行数:17,代码来源:ImageDecodingInfo.java

示例5: getUri

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
@Nullable
public static String getUri(@Nullable File file) {
    if (file == null) return null;
    final String uri;
    if (file.exists()) {
        uri = ImageDownloader.Scheme.FILE.wrap(file.getAbsolutePath());
    } else {
        String name = file.getName();
        if (sAssets.contains(name)) {
            uri = ImageDownloader.Scheme.ASSETS.wrap(name);
        } else if (sApkExpansionZipFile != null && sApkExpansionZipFile.contains(name)) {
            uri = BaseImageDownloaderImpl.obbScheme + name;
        } else {
            Log.w(TAG, "File " + file.getAbsolutePath() + " doesn't exist on ext or assets!");
            uri = null;
        }
    }
    return uri;
}
 
开发者ID:carlosefonseca,项目名称:CEFCommon,代码行数:20,代码来源:UIL.java

示例6: getDownloader

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
private ImageDownloader getDownloader() {
	ImageDownloader d;
	if (engine.isNetworkDenied()) {
		d = networkDeniedDownloader;
	} else if (engine.isSlowNetwork()) {
		d = slowNetworkDownloader;
	} else {
		d = downloader;
	}
	return d;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:LoadAndDisplayImageTask.java

示例7: getDownloader

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
private ImageDownloader getDownloader() {
    if (this.engine.isNetworkDenied()) {
        return this.networkDeniedDownloader;
    }
    if (this.engine.isSlowNetwork()) {
        return this.slowNetworkDownloader;
    }
    return this.downloader;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:LoadAndDisplayImageTask.java

示例8: ImageDecodingInfo

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public ImageDecodingInfo(String imageKey, String imageUri, String originalImageUri, ImageSize targetSize, ViewScaleType viewScaleType, ImageDownloader downloader, DisplayImageOptions displayOptions) {
    this.imageKey = imageKey;
    this.imageUri = imageUri;
    this.originalImageUri = originalImageUri;
    this.targetSize = targetSize;
    this.imageScaleType = displayOptions.getImageScaleType();
    this.viewScaleType = viewScaleType;
    this.downloader = downloader;
    this.extraForDownloader = displayOptions.getExtraForDownloader();
    this.considerExifParams = displayOptions.isConsiderExifParams();
    copyOptions(displayOptions.getDecodingOptions(), this.decodingOptions);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:ImageDecodingInfo.java

示例9: getDownloader

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
private ImageDownloader getDownloader() {
    ImageDownloader d;
    if (engine.isNetworkDenied()) {
        d = networkDeniedDownloader;
    } else if (engine.isSlowNetwork()) {
        d = slowNetworkDownloader;
    } else {
        d = downloader;
    }
    return d;
}
 
开发者ID:Spencer231,项目名称:GifImageLoader,代码行数:12,代码来源:LoadAndDisplayImageTask.java

示例10: ImageDecodingInfo

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public ImageDecodingInfo(String imageKey, String imageUri, String originalImageUri, ImageSize
        targetSize, ViewScaleType viewScaleType, ImageDownloader downloader,
                         DisplayImageOptions displayOptions) {
    this.imageKey = imageKey;
    this.imageUri = imageUri;
    this.originalImageUri = originalImageUri;
    this.targetSize = targetSize;
    this.imageScaleType = displayOptions.getImageScaleType();
    this.viewScaleType = viewScaleType;
    this.downloader = downloader;
    this.extraForDownloader = displayOptions.getExtraForDownloader();
    this.considerExifParams = displayOptions.isConsiderExifParams();
    copyOptions(displayOptions.getDecodingOptions(), this.decodingOptions);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:15,代码来源:ImageDecodingInfo.java

示例11: defineExifOrientation

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
protected ExifInfo defineExifOrientation(String imageUri) {
    int rotation = 0;
    boolean flip = false;
    try {
        ExifInterface exif = new ExifInterface(ImageDownloader.Scheme.FILE.crop(imageUri));
        int exifOrientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
        switch (exifOrientation) {
            case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:
                flip = true;
            case ExifInterface.ORIENTATION_NORMAL:
                rotation = 0;
                break;
            case ExifInterface.ORIENTATION_TRANSVERSE:
                flip = true;
            case ExifInterface.ORIENTATION_ROTATE_90:
                rotation = 90;
                break;
            case ExifInterface.ORIENTATION_FLIP_VERTICAL:
                flip = true;
            case ExifInterface.ORIENTATION_ROTATE_180:
                rotation = 180;
                break;
            case ExifInterface.ORIENTATION_TRANSPOSE:
                flip = true;
            case ExifInterface.ORIENTATION_ROTATE_270:
                rotation = 270;
                break;
        }
    } catch (IOException e) {
        L.w("Can't read EXIF tags from file [%s]", imageUri);
    }
    return new ExifInfo(rotation, flip);
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:34,代码来源:DiskDecoder.java

示例12: getImageByteByPath

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public static byte[] getImageByteByPath(String imagePath, ImageSize imageSize) {
    try {
        DisplayImageOptions options = new DisplayImageOptions.Builder()
                .cacheInMemory(false).cacheOnDisk(false)
                .considerExifParams(true).bitmapConfig(Bitmap.Config.RGB_565)
                .imageScaleType(ImageScaleType.EXACTLY).build();
        Bitmap upbitmap = ImageLoader.getInstance().loadImageSync(ImageDownloader.Scheme.FILE.wrap(imagePath), imageSize, options);
        if (upbitmap == null) {
            return null;
        }
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        upbitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
        int option = 100;
        while (baos.toByteArray().length / 1024 > 120) {
            baos.reset();
            option -= 10;
            upbitmap.compress(Bitmap.CompressFormat.JPEG, option, baos);
        }
        byte[] result = baos.toByteArray();
        IoUtils.closeSilently(baos);
        upbitmap.recycle();
        return result;
    } catch (Throwable e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:28,代码来源:CommonUtils.java

示例13: displayImage_local_string

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public static void displayImage_local_string(String imgStr, ImageView image){
    DisplayImageOptions options = new DisplayImageOptions.Builder()
            .cacheInMemory(true)
            .showImageOnLoading(R.drawable.loading_bg_cn_2_1)
            .showImageOnFail(R.drawable.loading_fail_bg_cn_2_1)
            .showImageForEmptyUri(R.drawable.loading_none_bg_cn_2_1)
            .cacheOnDisk(true).considerExifParams(true)
            .imageScaleType(ImageScaleType.IN_SAMPLE_INT).resetViewBeforeLoading(true)
            .displayer(new FadeInBitmapDisplayer(FADEINTIME)).bitmapConfig(Bitmap.Config.RGB_565)
            .build();
    String imagePath = "/mnt/sdcard/image.png";
    String imageUrl = ImageDownloader.Scheme.FILE.wrap(imagePath);
    ImageLoader.getInstance().displayImage(imgStr, image, options);
}
 
开发者ID:uuiikkuu,项目名称:MutiImage-Select-Camera,代码行数:15,代码来源:Helper_Image.java

示例14: displayImage_local_string

import com.nostra13.universalimageloader.core.download.ImageDownloader; //导入依赖的package包/类
public static void displayImage_local_string(String string,ImageView image){
    DisplayImageOptions options = new DisplayImageOptions.Builder()
            .cacheInMemory(true)
            .showImageOnLoading(R.drawable.loading_bg_cn_2_1)
            .showImageOnFail(R.drawable.loading_fail_bg_cn_2_1)
            .showImageForEmptyUri(R.drawable.loading_none_bg_cn_2_1)
            .cacheOnDisk(true).considerExifParams(true)
            .imageScaleType(ImageScaleType.IN_SAMPLE_INT).resetViewBeforeLoading(true)
            .displayer(new FadeInBitmapDisplayer(FADEINTIME)).bitmapConfig(Bitmap.Config.RGB_565)
            .build();
    String imagePath = "/mnt/sdcard/image.png";
    String imageUrl = ImageDownloader.Scheme.FILE.wrap(imagePath);
    ImageLoader.getInstance().displayImage(string, image, options);
}
 
开发者ID:uuiikkuu,项目名称:MutiImage-Select-Camera,代码行数:15,代码来源:Helper_Image.java


注:本文中的com.nostra13.universalimageloader.core.download.ImageDownloader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。