Java Code Examples for com.facebook.imagepipeline.request.ImageRequest#getPreferredWidth()

The following examples show how to use com.facebook.imagepipeline.request.ImageRequest#getPreferredWidth() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BranchOnSeparateImagesProducer.java    From FanXin-based-HuanXin with GNU General Public License v2.0 5 votes vote down vote up
private boolean isResultGoodEnough(
    Pair<CloseableReference<PooledByteBuffer>, ImageTransformMetaData> newResult,
    ImageRequest imageRequest) {
  if (newResult == null) {
    return false;
  }

  ImageTransformMetaData metaData = newResult.second;
  return metaData.getWidth() >= imageRequest.getPreferredWidth() &&
      metaData.getHeight() >= imageRequest.getPreferredHeight();
}
 
Example 2
Source File: LocalVideoThumbnailProducer.java    From FanXin-based-HuanXin with GNU General Public License v2.0 4 votes vote down vote up
private static int calculateKind(ImageRequest imageRequest) {
  if (imageRequest.getPreferredWidth() > 96 || imageRequest.getPreferredHeight() > 96) {
    return MediaStore.Images.Thumbnails.MINI_KIND;
  }
  return MediaStore.Images.Thumbnails.MICRO_KIND;
}
 
Example 3
Source File: LocalVideoThumbnailProducer.java    From fresco with MIT License 4 votes vote down vote up
private static int calculateKind(ImageRequest imageRequest) {
  if (imageRequest.getPreferredWidth() > 96 || imageRequest.getPreferredHeight() > 96) {
    return MediaStore.Images.Thumbnails.MINI_KIND;
  }
  return MediaStore.Images.Thumbnails.MICRO_KIND;
}