本文整理汇总了Java中com.nostra13.universalimageloader.core.assist.ViewScaleType.fromImageView方法的典型用法代码示例。如果您正苦于以下问题:Java ViewScaleType.fromImageView方法的具体用法?Java ViewScaleType.fromImageView怎么用?Java ViewScaleType.fromImageView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nostra13.universalimageloader.core.assist.ViewScaleType
的用法示例。
在下文中一共展示了ViewScaleType.fromImageView方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScaleType
import com.nostra13.universalimageloader.core.assist.ViewScaleType; //导入方法依赖的package包/类
@Override
public ViewScaleType getScaleType() {
ImageView imageView = (ImageView) viewRef.get();
if (imageView != null) {
return ViewScaleType.fromImageView(imageView);
}
return super.getScaleType();
}
示例2: getScaleType
import com.nostra13.universalimageloader.core.assist.ViewScaleType; //导入方法依赖的package包/类
public ViewScaleType getScaleType() {
ImageView imageView = (ImageView) this.viewRef.get();
if (imageView != null) {
return ViewScaleType.fromImageView(imageView);
}
return super.getScaleType();
}
示例3: getScaleType
import com.nostra13.universalimageloader.core.assist.ViewScaleType; //导入方法依赖的package包/类
@Override
public ViewScaleType getScaleType() {
ImageView imageView = imageViewRef.get();
if (imageView != null) {
return ViewScaleType.fromImageView(imageView);
}
return null;
}
示例4: getScaleType
import com.nostra13.universalimageloader.core.assist.ViewScaleType; //导入方法依赖的package包/类
public ViewScaleType getScaleType()
{
ImageView imageview = (ImageView)viewRef.get();
if (imageview != null)
{
return ViewScaleType.fromImageView(imageview);
} else
{
return super.getScaleType();
}
}
示例5: getScaleType
import com.nostra13.universalimageloader.core.assist.ViewScaleType; //导入方法依赖的package包/类
/**
* 获取ImageView的缩放scale类型方式
* @return
*/
@Override
public ViewScaleType getScaleType() {
ImageView imageView = (ImageView) viewRef.get();
if (imageView != null) {
return ViewScaleType.fromImageView(imageView);
}
return super.getScaleType();
}
示例6: decodeImage
import com.nostra13.universalimageloader.core.assist.ViewScaleType; //导入方法依赖的package包/类
private Bitmap decodeImage(URI imageUri) throws IOException {
Bitmap bmp = null;
if (configuration.handleOutOfMemory) {
bmp = decodeWithOOMHandling(imageUri);
} else {
ImageDecoder decoder = new ImageDecoder(imageUri, getDownloader(), options);
decoder.setLoggingEnabled(loggingEnabled);
ViewScaleType viewScaleType = ViewScaleType.fromImageView(imageView);
bmp = decoder.decode(targetSize, options.getImageScaleType(), viewScaleType);
}
return bmp;
}
示例7: decodeWithOOMHandling
import com.nostra13.universalimageloader.core.assist.ViewScaleType; //导入方法依赖的package包/类
private Bitmap decodeWithOOMHandling(URI imageUri) throws IOException {
Bitmap result = null;
ImageDecoder decoder = new ImageDecoder(imageUri, getDownloader(), options);
decoder.setLoggingEnabled(loggingEnabled);
for (int attempt = 1; attempt <= ATTEMPT_COUNT_TO_DECODE_BITMAP; attempt++) {
try {
ViewScaleType viewScaleType = ViewScaleType.fromImageView(imageView);
result = decoder.decode(targetSize, options.getImageScaleType(), viewScaleType);
} catch (OutOfMemoryError e) {
L.e(e);
switch (attempt) {
case 1:
System.gc();
break;
case 2:
configuration.memoryCache.clear();
System.gc();
break;
case 3:
throw e;
}
// Wait some time while GC is working
SystemClock.sleep(attempt * 1000);
continue;
}
break;
}
return result;
}