use of com.facebook.drawee.view.SimpleDraweeView in project BigImageViewer by Piasy.
the class FrescoImageViewFactory method loadAnimatedContent.
@Override
public final void loadAnimatedContent(final View view, final int imageType, final File imageFile) {
if (view instanceof SimpleDraweeView) {
final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(Uri.parse("file://" + imageFile.getAbsolutePath())).setAutoPlayAnimations(true).build();
((SimpleDraweeView) view).setController(controller);
}
}
use of com.facebook.drawee.view.SimpleDraweeView in project BigImageViewer by Piasy.
the class FrescoImageViewFactory method loadThumbnailContent.
@Override
public void loadThumbnailContent(final View view, final Uri thumbnail) {
if (view instanceof SimpleDraweeView) {
final DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(thumbnail).build();
((SimpleDraweeView) view).setController(controller);
}
}
use of com.facebook.drawee.view.SimpleDraweeView in project BigImageViewer by Piasy.
the class FrescoImageViewFactory method createAnimatedImageView.
@Override
protected final View createAnimatedImageView(final Context context, final int imageType, int initScaleType) {
final SimpleDraweeView view = new SimpleDraweeView(context);
view.getHierarchy().setActualImageScaleType(scaleType(initScaleType));
return view;
}
use of com.facebook.drawee.view.SimpleDraweeView in project ride-read-android by Ride-Read.
the class NineGridImgView method getImageView.
/**
* 获得 ImageView
* 保证了 ImageView 的重用
*
* @param position 位置
*/
private SimpleDraweeView getImageView(final int position) {
if (position < mImageViewList.size()) {
return mImageViewList.get(position);
} else {
if (mAdapter != null) {
SimpleDraweeView imageView = mAdapter.generateImageView(getContext());
mImageViewList.add(imageView);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mAdapter.onItemImageClick(getContext(), imageView, position, mImgDataList);
}
});
return imageView;
} else {
Log.e("NineGirdImageView", "Your must set a NineGridImageViewAdapter for NineGirdImageView");
return null;
}
}
}
use of com.facebook.drawee.view.SimpleDraweeView in project ride-read-android by Ride-Read.
the class NineGridImgView method setImagesData.
/**
* 设置图片数据
*
* @param lists 图片数据集合
*/
public void setImagesData(List lists) {
if (lists == null || lists.isEmpty()) {
this.setVisibility(GONE);
return;
} else {
this.setVisibility(VISIBLE);
}
if (mMaxSize > 0 && lists.size() > mMaxSize) {
lists = lists.subList(0, mMaxSize);
}
int[] gridParam = calculateGridParam(lists.size(), mShowStyle);
mRowCount = gridParam[0];
mColumnCount = gridParam[1];
if (mImgDataList == null) {
int i = 0;
while (i < lists.size()) {
SimpleDraweeView iv = getImageView(i);
if (iv == null) {
return;
}
addView(iv, generateDefaultLayoutParams());
i++;
}
} else {
int oldViewCount = mImgDataList.size();
int newViewCount = lists.size();
if (oldViewCount > newViewCount) {
removeViews(newViewCount, oldViewCount - newViewCount);
} else if (oldViewCount < newViewCount) {
for (int i = oldViewCount; i < newViewCount; i++) {
SimpleDraweeView iv = getImageView(i);
if (iv == null) {
return;
}
addView(iv, generateDefaultLayoutParams());
}
}
}
mImgDataList = lists;
requestLayout();
}
Aggregations