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


Java PipelineDraweeControllerBuilder.setControllerListener方法代码示例

本文整理汇总了Java中com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder.setControllerListener方法的典型用法代码示例。如果您正苦于以下问题:Java PipelineDraweeControllerBuilder.setControllerListener方法的具体用法?Java PipelineDraweeControllerBuilder.setControllerListener怎么用?Java PipelineDraweeControllerBuilder.setControllerListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder的用法示例。


在下文中一共展示了PipelineDraweeControllerBuilder.setControllerListener方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadImage

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的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());
}
 
开发者ID:lennyup,项目名称:react-native-udesk,代码行数:19,代码来源:UdeskUtil.java

示例2: getImageViewController

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
/**
	 * 图像选项类
	 * @param uri 图片路径
	 * @param oldController DraweeView.getoldcontroller
	 * @param controllerListener 监听
	 * @return
	 */
	public static DraweeController getImageViewController(String uri, DraweeController oldController,
			ControllerListener<ImageInfo> controllerListener) {
		PipelineDraweeControllerBuilder builder = Fresco.newDraweeControllerBuilder();
		if (!TextUtils.isEmpty(uri)) {
//			Logger.d("StringUtils.utf8Encode(uri)"+StringUtils.utf8Encode(uri));
			builder.setUri(Uri.parse(uri));
		}
		if (oldController != null) {
			builder.setOldController(oldController);
		}
		if (controllerListener != null) {
			builder.setControllerListener(controllerListener);
		}
		return builder.build();
	}
 
开发者ID:lizubing1992,项目名称:Li-MVPArms,代码行数:23,代码来源:FrescoHelper.java

示例3: initLoad

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
@Override
public void initLoad() {
    super.initLoad();

    if (!TextUtils.isEmpty(mImageUrl)) {
        PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
        controller.setUri(mImageUrl);
        controller.setOldController(mPhotoIv.getController());
        controller.setControllerListener(new BaseControllerListener<ImageInfo>() {
            @Override
            public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
                super.onFinalImageSet(id, imageInfo, animatable);
                if (imageInfo == null || mPhotoIv == null) {
                    return;
                }
                mPhotoIv.update(imageInfo.getWidth(), imageInfo.getHeight());
            }
        });
        mPhotoIv.setController(controller.build());
    }
}
 
开发者ID:Freelander,项目名称:Elephant,代码行数:22,代码来源:PhotoShowActivity.java

示例4: display

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
public static void display(final PhotoDraweeView draweeView, Uri uri) {
    PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
    controller.setUri(uri);
    controller.setOldController(draweeView.getController());
    controller.setControllerListener(new BaseControllerListener<ImageInfo>() {
        @Override
        public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
            super.onFinalImageSet(id, imageInfo, animatable);
            if (imageInfo == null || draweeView == null) {
                return;
            }
            draweeView.update(imageInfo.getWidth(), imageInfo.getHeight());
        }
    });
    draweeView.setController(controller.build());
}
 
开发者ID:iKnown,项目名称:AndroidImageSelect,代码行数:17,代码来源:PhotoDraweeViewUtil.java

示例5: onCreate

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String imageUrl = getIntent().getStringExtra(IMAGE_URL);
    if (!TextUtils.isEmpty(imageUrl)) {
        PipelineDraweeControllerBuilder builder = Fresco.newDraweeControllerBuilder();
        builder.setUri(Uri.parse(imageUrl));
        builder.setOldController(photoView.getController());
        builder.setControllerListener(new BaseControllerListener<ImageInfo>() {
            @Override
            public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
                super.onFinalImageSet(id, imageInfo, animatable);
                if (imageInfo == null || photoView == null) {
                    return;
                }
                photoView.update(imageInfo.getWidth(), imageInfo.getHeight());
            }
        });
        photoView.setController(builder.build());
    }
}
 
开发者ID:CycloneAxe,项目名称:phphub-android,代码行数:23,代码来源:GalleryActivity.java

示例6: init

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
@Override
protected void init() {
    super.init();
    transparentStatusBar();
    ButterKnife.bind(this);
    url = getIntent().getStringExtra("url");
    PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
    controller.setUri(Uri.parse(url));
    controller.setAutoPlayAnimations(true);
    controller.setOldController(photoDraweeView.getController());
    controller.setControllerListener(new BaseControllerListener<ImageInfo>() {
        @Override
        public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
            super.onFinalImageSet(id, imageInfo, animatable);
            if (imageInfo == null || photoDraweeView == null) {
                return;
            }
            photoDraweeView.update(imageInfo.getWidth(), imageInfo.getHeight());
            normalScale = photoDraweeView.getScale();
        }
    });
    photoDraweeView.setController(controller.build());
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
        String name = getIntent().getStringExtra("transition_name");
        photoDraweeView.setTransitionName(name);
        getWindow().setSharedElementEnterTransition(DraweeTransition.createTransitionSet(
                ScalingUtils.ScaleType.CENTER_CROP, ScalingUtils.ScaleType.FIT_CENTER));
        getWindow().setSharedElementReturnTransition(DraweeTransition.createTransitionSet(
                ScalingUtils.ScaleType.FIT_CENTER, ScalingUtils.ScaleType.CENTER_CROP));
    }
}
 
开发者ID:HStanN,项目名称:TakeRest,代码行数:32,代码来源:PhotoViewActivity.java

示例7: getDraweeController

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
/**
 * 获取DraweeController
 *
 * @param imageRequest 设置单个图片请求~~~不可与setFirstAvailableImageRequests共用,配合setLowResImageRequest为高分辨率的图
 * @param lowResImageRequest 先下载显示低分辨率的图
 * @param firstAvailableImageRequests 本地图片复用,可加入ImageRequest数组
 * @param controllerListener 监听图片下载完毕等
 * @param tapToRetryEnabled 点击重新加载图
 */
public static PipelineDraweeControllerBuilder getDraweeController(SimpleDraweeView view, @Nullable ImageRequest imageRequest, ImageRequest lowResImageRequest, @Nullable ImageRequest[] firstAvailableImageRequests, @Nullable ControllerListener<ImageInfo> controllerListener, boolean tapToRetryEnabled) {
    PipelineDraweeControllerBuilder builder = Fresco
            .newDraweeControllerBuilder();
    //自动播放图片动画
    builder.setAutoPlayAnimations(true);
    //点击重新加载图
    builder.setTapToRetryEnabled(tapToRetryEnabled);
    if (firstAvailableImageRequests != null &&
            firstAvailableImageRequests.length > 0) {
        //本地图片复用,可加入ImageRequest数组
        builder.setFirstAvailableImageRequests(firstAvailableImageRequests);
    } else if (imageRequest != null) {
        //设置单个图片请求~~~不可与setFirstAvailableImageRequests共用,配合setLowResImageRequest为高分辨率的图
        builder.setImageRequest(imageRequest);
        if (lowResImageRequest != null) {
            //先下载显示低分辨率的图
            builder.setLowResImageRequest(lowResImageRequest);
        }
    }
    if (controllerListener != null) {
        //监听图片下载完毕等
        builder.setControllerListener(controllerListener);
    }
    //DraweeController复用
    builder.setOldController(view.getController());
    return builder;
}
 
开发者ID:imliujun,项目名称:FrescoCustomCacheKey,代码行数:37,代码来源:FrescoImageLoader.java

示例8: initImage

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
private void initImage() {
    PipelineDraweeControllerBuilder controller = FrescoUtils.getPreController(url, pdvImage);
    controller.setControllerListener(listener);
    final GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(getResources())
            .setProgressBarImage(new ImageLoadProgressBar(new ImageLoadProgressBar.OnLevelChangeListener() {
                @Override
                public void onChange(int level) {
                    if (level >= 100) {
                        hideLoadingDialog();
                    }
                }
            }, Color.parseColor("#90CCCCCC"))).build();
    hierarchy.setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    pdvImage.setHierarchy(hierarchy);
    pdvImage.setController(controller.build());
    pdvImage.setOnPhotoTapListener(new OnPhotoTapListener() {
        @Override
        public void onPhotoTap(View view, float x, float y) {
            if (mActivity != null)
                mActivity.finish();
        }
    });
    pdvImage.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {

            return true;
        }
    });
}
 
开发者ID:smuyyh,项目名称:SprintNBA,代码行数:31,代码来源:ImagePreFragment.java

示例9: instantiateItem

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
@Override public Object instantiateItem(ViewGroup viewGroup, int position) {
    final PhotoDraweeView photoDraweeView = new PhotoDraweeView(viewGroup.getContext());
    PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
    controller.setUri(Uri.parse("res:///" + mDrawables[position]));

    if(position == 1){
        String uri1 = "http://git.oschina.net/biezhihua/MyResource/raw/master/25-173250_974.gif ";
        String uri2 = "http://img5.duitang.com/uploads/item/201511/04/20151104214718_FfnST.jpeg";
        controller.setUri(Uri.parse(uri1));
    }

    controller.setOldController(photoDraweeView.getController());
    controller.setControllerListener(new BaseControllerListener<ImageInfo>() {
        @Override
        public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
            super.onFinalImageSet(id, imageInfo, animatable);
            if (imageInfo == null) {
                return;
            }
            photoDraweeView.update(imageInfo.getWidth(), imageInfo.getHeight());

            if(animatable != null){
                animatable.start();
            }
        }
    });
    photoDraweeView.setController(controller.build());

    try {
        viewGroup.addView(photoDraweeView, ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT);
    } catch (Exception e) {
        e.printStackTrace();
    }

    return photoDraweeView;
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:38,代码来源:ViewPagerActivity.java

示例10: instantiateItem

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
@Override public Object instantiateItem(ViewGroup viewGroup, int position) {

            IImageInfo bean = images.get(position);
            final PhotoDraweeView photoDraweeView = new PhotoDraweeView(viewGroup.getContext());
            PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
            controller.setUri(Uri.parse(bean.getUri()));
            controller.setOldController(photoDraweeView.getController());
            controller.setControllerListener(new BaseControllerListener<ImageInfo>() {
                @Override
                public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
                    super.onFinalImageSet(id, imageInfo, animatable);
                    if (imageInfo == null) {
                        return;
                    }
                    photoDraweeView.update(imageInfo.getWidth(), imageInfo.getHeight());

                    if(animatable != null){
                        animatable.start();
                    }
                }
            });
            photoDraweeView.setController(controller.build());

            try {
                viewGroup.addView(photoDraweeView, ViewGroup.LayoutParams.MATCH_PARENT,
                        ViewGroup.LayoutParams.MATCH_PARENT);
            } catch (Exception e) {
                e.printStackTrace();
            }

            return photoDraweeView;
        }
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:33,代码来源:AyoGalleryFragment.java

示例11: initData

import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder; //导入方法依赖的package包/类
@Override
public void initData() {
    showContent(true);
    ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url))
            .setProgressiveRenderingEnabled(true)
            .build();

    GenericDraweeHierarchy hierarchy =
            new GenericDraweeHierarchyBuilder(getResources()).setProgressBarImage(
                    new ImageLoadProgressBar(new ImageLoadProgressBar.OnLevelChangeListener() {
                        @Override
                        public void onChange(int level) {
                            if (level > 100 && progress.getVisibility() == View.VISIBLE) {
                                progress.setVisibility(View.GONE);
                            }
                        }
                    }, ResourceUtil.getThemeColor(getActivity()))).build();
    hierarchy.setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);

    PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
    controller.setControllerListener(listener);
    controller.setImageRequest(request);
    controller.setOldController(image.getController());
    controller.setAutoPlayAnimations(true);
    image.setHierarchy(hierarchy);
    image.setController(controller.build());
}
 
开发者ID:gzsll,项目名称:TLint,代码行数:28,代码来源:ImageFragment.java


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