VideoShotEditActivity.java 文件源码

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

项目:letv 作者:
private RoundedImageView createImageViewFromFile(int position, String filename) {
    if (!FileUtils.checkFileIsEnabledPath(filename)) {
        return null;
    }
    Options newOpts = new Options();
    newOpts.inJustDecodeBounds = true;
    Bitmap bitmap = BitmapFactory.decodeFile(filename, newOpts);
    int w = newOpts.outWidth;
    int h = newOpts.outHeight;
    int be = 1;
    if (w > h && ((float) w) > 300.0f) {
        be = (int) (((float) newOpts.outWidth) / 300.0f);
    } else if (w < h && ((float) h) > 400.0f) {
        be = (int) (((float) newOpts.outHeight) / 400.0f);
    }
    if (be <= 0) {
        be = 1;
    }
    Options newOpts2 = new Options();
    newOpts2.inSampleSize = be;
    newOpts2.inJustDecodeBounds = false;
    Bitmap bitmap2 = BitmapFactory.decodeFile(filename, newOpts2);
    RoundedImageView imageView = (RoundedImageView) this.mInflater.inflate(R.layout.videoshot_rounded_item, null, false).findViewById(R.id.riv_imageView);
    imageView.setTag(Integer.valueOf(position));
    imageView.setImageBitmap(bitmap2);
    if (this.mIVArray != null) {
        this.mIVArray.add(imageView);
        return imageView;
    }
    this.mIVArray = new ArrayList();
    this.mIVArray.add(imageView);
    return imageView;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号