本文整理汇总了Java中me.relex.photodraweeview.PhotoDraweeView类的典型用法代码示例。如果您正苦于以下问题:Java PhotoDraweeView类的具体用法?Java PhotoDraweeView怎么用?Java PhotoDraweeView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PhotoDraweeView类属于me.relex.photodraweeview包,在下文中一共展示了PhotoDraweeView类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import me.relex.photodraweeview.PhotoDraweeView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
try {
if (!Fresco.hasBeenInitialized()) {
UdeskSDKManager.getInstance().init(this);
}
setContentView(R.layout.udesk_zoom_imageview);
zoomImageView = (PhotoDraweeView) findViewById(R.id.udesk_zoom_imageview);
Bundle bundle = getIntent().getExtras();
uri = bundle.getParcelable("image_path");
UdeskUtil.loadImage(zoomImageView, uri);
saveIdBtn = findViewById(R.id.udesk_zoom_save);
saveIdBtn.setOnClickListener(this);
} catch (Exception e) {
e.printStackTrace();
}catch (OutOfMemoryError error){
error.printStackTrace();
}
}
示例2: loadImage
import me.relex.photodraweeview.PhotoDraweeView; //导入依赖的package包/类
public static void loadImage(final PhotoDraweeView mPhotoDraweeView,
Uri uri) {
PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
controller.setUri(uri);
controller.setAutoPlayAnimations(true);
controller.setOldController(mPhotoDraweeView.getController());
controller.setControllerListener(new BaseControllerListener<ImageInfo>() {
@Override
public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
super.onFinalImageSet(id, imageInfo, animatable);
if (imageInfo == null || mPhotoDraweeView == null) {
return;
}
mPhotoDraweeView.update(imageInfo.getWidth(), imageInfo.getHeight());
}
});
mPhotoDraweeView.setController(controller.build());
}
示例3: showNormalImage
import me.relex.photodraweeview.PhotoDraweeView; //导入依赖的package包/类
private View showNormalImage(ViewGroup container, final int position) {
RelativeLayout layout = (RelativeLayout) LayoutInflater.from(context).inflate(R.layout.normal_img_layout, container, false);
PhotoDraweeView imageView = (PhotoDraweeView) layout.findViewById(R.id.image_item);
String imageUri = images.get(position).getUri();
Uri show = Uri.parse((imageUri.startsWith("http")) ? imageUri : (imageUri.startsWith("file://")) ? imageUri : "file://" + imageUri);
imageView.setPhotoUri(show);
imageView.setOnViewTapListener(new OnViewTapListener() {
@Override
public void onViewTap(View view, float x, float y) {
Toast.makeText(context, "点击可以退出", Toast.LENGTH_SHORT).show();
}
});
container.addView(layout);
return layout;
}
示例4: instantiateItem
import me.relex.photodraweeview.PhotoDraweeView; //导入依赖的package包/类
@Override
public View instantiateItem(ViewGroup container, final int position) {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = layoutInflater.inflate(R.layout.item_photoview, container, false);
final PhotoDraweeView photoView = (PhotoDraweeView) view.findViewById(R.id.photo_view);
photoView.setPhotoUri(Uri.parse(images.get(position)));
container.addView(view, 0);
return view;
}