MainActivity.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:photo-affix 作者:
@Size(2)
private int[] getNextBitmapSize() {
  if (selectedPhotos == null || selectedPhotos.length == 0) {
    selectedPhotos = adapter.getSelectedPhotos();
    if (selectedPhotos == null || selectedPhotos.length == 0)
      return new int[]{10, 10}; // crash workaround
  }
  traverseIndex++;
  if (traverseIndex > selectedPhotos.length - 1) return null;
  Photo nextPhoto = selectedPhotos[traverseIndex];
  BitmapFactory.Options options = new BitmapFactory.Options();
  options.inJustDecodeBounds = true;
  InputStream is = null;
  try {
    is = Util.openStream(this, nextPhoto.getUri());
    BitmapFactory.decodeStream(is, null, options);
  } catch (Exception e) {
    Util.showError(this, e);
    return new int[]{0, 0};
  } finally {
    Util.closeQuietely(is);
  }
  return new int[]{options.outWidth, options.outHeight};
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号