當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageInfo類代碼示例

本文整理匯總了Java中com.facebook.imagepipeline.image.ImageInfo的典型用法代碼示例。如果您正苦於以下問題:Java ImageInfo類的具體用法?Java ImageInfo怎麽用?Java ImageInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ImageInfo類屬於com.facebook.imagepipeline.image包,在下文中一共展示了ImageInfo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    ButterKnife.bind(this);
    Uri uri = Uri.parse("asset:///splash.webp");
    mSplashPresenter = new SplashPresenterImpl(this);
    DraweeController controller = Fresco.newDraweeControllerBuilder()
            .setUri(uri)
            .setAutoPlayAnimations(true)
            .setControllerListener(new BaseControllerListener<ImageInfo>(){
                @Override
                public void onFinalImageSet(String id, @Nullable ImageInfo imageInfo, @Nullable Animatable animatable) {
                    super.onFinalImageSet(id, imageInfo, animatable);
                    mSplashPresenter.startCountDown(1);
                }
            })
            .build();
    splashDraweee.setController(controller);
}
 
開發者ID:stdnull,項目名稱:RunMap,代碼行數:21,代碼來源:SplashActivity.java

示例2: loadImage

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的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

示例3: loadImage

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
public void loadImage(String url,String lowurl, int placeHolderResId, int errorResId,ScalingUtils.ScaleType scaleType){
    final boolean isHttp = url.startsWith("http");
    Uri uri = isHttp ? Uri.parse(url) :  Uri.fromFile(new File(url));
    PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder()
         .setImageRequest(ImageRequest.fromUri(uri));
    if(lowurl!=null &&  lowurl.startsWith("http")) {
        controller .setLowResImageRequest(ImageRequest.fromUri(lowurl));
    }
    getHierarchy().setActualImageScaleType(scaleType);
                    // controller.setUri(URI);
    getHierarchy().setPlaceholderImage(getResources().getDrawable( placeHolderResId ),scaleType);
    getHierarchy().setFailureImage(getResources().getDrawable(errorResId),scaleType);
    controller.setOldController(this.getController())
         .setControllerListener(new BaseControllerListener<ImageInfo>() {
             @Override
             public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
                 if (imageInfo == null) {
                     return;
                 }
                 PhotoDraweeView.this.update(imageInfo.getWidth(), imageInfo.getHeight());
             }
         });
    this.setController(controller.build());
}
 
開發者ID:LightSun,項目名稱:android-photo-picker,代碼行數:25,代碼來源:PhotoDraweeView.java

示例4: getImageViewController

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的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

示例5: showThumb

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
/**
 * showThumb
 *
 * @param draweeView     draweeView
 * @param url            url
 * @param resizeWidthDp  resizeWidth
 * @param resizeHeightDp resizeHeight
 */
public static void showThumb(SimpleDraweeView draweeView, String url, int resizeWidthDp, int resizeHeightDp) {
    try {
        if (!isInit)
            return;
        if (url == null || "".equals(url))
            return;
        if (draweeView == null)
            return;
        initialize(draweeView.getContext());
        ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url))
                .setResizeOptions(new ResizeOptions(DimenUtils.dip2px(draweeView.getContext(), resizeWidthDp), DimenUtils.dip2px(draweeView.getContext(), resizeHeightDp)))
                .build();
        DraweeController controller = Fresco.newDraweeControllerBuilder()
                .setImageRequest(request)
                .setOldController(draweeView.getController())
                .setControllerListener(new BaseControllerListener<ImageInfo>())
                .build();
        draweeView.setController(controller);
    } catch (Exception e) {
    }
}
 
開發者ID:LiangMaYong,項目名稱:android-base,代碼行數:30,代碼來源:FrescoUtils.java

示例6: showResGif

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
public static DraweeController showResGif(int resourceId, SimpleDraweeView simpleDraweeView) {
    ControllerListener controllerListener = new BaseControllerListener<ImageInfo>() {
        @Override
        public void onFinalImageSet(
                String id,
                @Nullable ImageInfo imageInfo,
                @Nullable Animatable anim) {
            if (anim != null) {
                anim.start();
            }
        }
    };

    Uri uri = Uri.parse("res://com.blinnnk.gaia/" + resourceId);
    DraweeController draweeController = Fresco.newDraweeControllerBuilder()
            .setUri(uri)
            .setControllerListener(controllerListener)
            .build();
    simpleDraweeView.setController(draweeController);
    return draweeController;
}
 
開發者ID:XueyanLiu,項目名稱:miku,代碼行數:22,代碼來源:ImageUtils.java

示例7: initLoad

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的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

示例8: createDraweeController

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
private DraweeController createDraweeController(
        DraweeView draweeView, Uri uri, ControllerListener<ImageInfo> listener) {

    JungleSize size = ImageLoaderUtils.getAppropriateSize(draweeView);
    ImageRequest request = ImageRequestBuilder
            .newBuilderWithSource(uri)
            .setResizeOptions(new ResizeOptions(size.mWidth, size.mHeight))
            .setAutoRotateEnabled(true)
            .build();

    return Fresco.newDraweeControllerBuilder()
            .setUri(uri)
            .setImageRequest(request)
            .setControllerListener(listener)
            .setAutoPlayAnimations(true)
            .setOldController(draweeView.getController())
            .build();
}
 
開發者ID:Android-Jungle,項目名稱:android-jungle-framework,代碼行數:19,代碼來源:FrescoImageLoaderEngine.java

示例9: loadByFresco

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
private void loadByFresco(String url) {
    Uri uri = Uri.parse(url);
    ControllerListener listener = new BaseControllerListener<ImageInfo>() {
        @Override
        public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
            super.onFinalImageSet(id, imageInfo, animatable);
            Log.d(TAG, "Fresco----->onFinalImageSet: " + LogTime.getElapsedMillis(startTimeFresco) + "ms");
            textFresco.setText(getString(R.string.text_load_time, "Fresco", String.format("%.6f", LogTime.getElapsedMillis(startTimeFresco))));

        }
    };
    DraweeController controller = Fresco.newDraweeControllerBuilder()
            .setControllerListener(listener)
            .setUri(uri)
            .build();
    imgFresco.setController(controller);
}
 
開發者ID:Alluretears,項目名稱:ImageLoaders,代碼行數:18,代碼來源:MainActivity.java

示例10: display

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的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

示例11: updateImageSize

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
/**
 * 更新圖片的尺寸
 * @param imageView
 * @param imageInfo
 */
private void updateImageSize(SimpleDraweeView imageView, ImageInfo imageInfo){

    if(imageInfo != null){
        Log.d(TAG, "ImageInfo: width=" + imageInfo.getWidth() + ", height=" + imageInfo.getHeight());

        ViewGroup.LayoutParams lp = imageView.getLayoutParams();
        final int imageWidth = imageView.getMeasuredWidth();
        final int imageHeight = imageView.getMeasuredHeight();

        lp.width = imageWidth;
        lp.height = imageWidth * imageInfo.getHeight() / imageInfo.getWidth();

        imageView.setLayoutParams(lp);
        imageView.setAspectRatio((float)imageInfo.getWidth() / imageInfo.getHeight());
    }

}
 
開發者ID:zjupure,項目名稱:SneezeReader,代碼行數:23,代碼來源:ArticleAdapter.java

示例12: onCreate

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的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

示例13: onBindItemViewHolder

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
@Override
public void onBindItemViewHolder(final ViewHolder holder, final int position) {
    MediaEntity entity = getItem(position);
    holder.mImageViewCover.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onItemClickListener.onItemClick(getItem(position));
        }
    });
    holder.mTextViewLikesCount.setTextImageStart(18, R.mipmap.ic_thumb_up_gray_18dp, " " + entity.getLikes_count());
    holder.mTextViewRecommendCaption.setText(entity.getCaption());

    String url = entity.getCover_pic().replace("!thumb320", "");
    DraweeController controller = Fresco.newDraweeControllerBuilder()
            .setControllerListener(new BaseControllerListener<ImageInfo>() {
                @Override
                public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
                    float aspectRatio = (float)imageInfo.getWidth() / (float)imageInfo.getHeight();
                    holder.mImageViewCover.setAspectRatio(aspectRatio);
                }
            })
            .setUri(Uri.parse(url))
            .build();
    holder.mImageViewCover.setController(controller);
    AppUtils.loadSmallUserAvata(getItem(position).getUser(), holder.mImageViewAvatar);
}
 
開發者ID:sungerk,項目名稱:meiShi,代碼行數:27,代碼來源:MediasAdapter.java

示例14: onFinalImageSet

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的package包/類
@Override
public void onFinalImageSet(
    String id,
    ImageInfo imageInfo,
    Animatable animatable) {
  if (mEnableResizing &&
      imageInfo != null &&
      mDraweeSpan.getDraweeHolder().getTopLevelDrawable() != null) {
    Drawable topLevelDrawable = mDraweeSpan.getDraweeHolder().getTopLevelDrawable();
    Rect topLevelDrawableBounds = topLevelDrawable.getBounds();
    if (mFixedHeight != UNSET_SIZE) {
      float imageWidth = ((float) mFixedHeight / imageInfo.getHeight()) * imageInfo.getWidth();
      int imageWidthPx = (int) imageWidth;
      if (topLevelDrawableBounds.width() != imageWidthPx ||
          topLevelDrawableBounds.height() != mFixedHeight) {
        topLevelDrawable.setBounds(0, 0, imageWidthPx, mFixedHeight);

        if (mDraweeSpanChangedListener != null) {
          mDraweeSpanChangedListener.onDraweeSpanChanged(DraweeSpanStringBuilder.this);
        }
      }
    } else if (topLevelDrawableBounds.width() != imageInfo.getWidth() ||
        topLevelDrawableBounds.height() != imageInfo.getHeight()) {
      topLevelDrawable.setBounds(0, 0, imageInfo.getWidth(), imageInfo.getHeight());

      if (mDraweeSpanChangedListener != null) {
        mDraweeSpanChangedListener.onDraweeSpanChanged(DraweeSpanStringBuilder.this);
      }
    }
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:32,代碼來源:DraweeSpanStringBuilder.java

示例15: init

import com.facebook.imagepipeline.image.ImageInfo; //導入依賴的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


注:本文中的com.facebook.imagepipeline.image.ImageInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。