You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mImgView.setImageResource(R.drawable.icon_load_fail);
mAttacher.update();
------update() public void update() {
ImageView imageView = getImageView();
if (null != imageView) {
if (mZoomEnabled) {
// Make sure we using MATRIX Scale Type
setImageViewScaleTypeMatrix(imageView);
// Update the base matrix using the current drawable
updateBaseMatrix(imageView.getDrawable());
} else {
// Reset the Matrix...
resetMatrix();
}
}
}
------resetMatrix private void resetMatrix() {
mSuppMatrix.reset();
setImageViewMatrix(getDrawMatrix());
checkMatrixBounds();
}
------ getDrawMatrix public Matrix getDrawMatrix() {
mDrawMatrix.set(mBaseMatrix);
mDrawMatrix.postConcat(mSuppMatrix);
return mDrawMatrix;
}
------ checkMatrixBounds private boolean checkMatrixBounds() {
final ImageView imageView = getImageView();
if (null == imageView) {
return false;
}
final RectF rect = getDisplayRect(getDrawMatrix());
if (null == rect) {
return false;
}
final float height = rect.height(), width = rect.width();
float deltaX = 0, deltaY = 0;
final int viewHeight = getImageViewHeight(imageView);
..
final int viewWidth = getImageViewWidth(imageView);
..
// Finally actually translate the matrix
mSuppMatrix.postTranslate(deltaX, deltaY);
return true;
}
The text was updated successfully, but these errors were encountered:
给控件更新宽高 是在onFinalImageSet,加载成功后request
1.假如说我加载网络图片识别,给控件展示加载识别默认图,此时控件大小不易控制,不是我相要的结果
2.加载成功后如果photoDraweeView.update(imageInfo.getWidth(), imageInfo.getHeight());我发现有的图片左右会多出大概40dp的距离
3.通过查看PhotoView代码,发现它的update大小未设置值,内部是得到与IAttacher 绑定的imageView,用iamgeview的测量宽高,即通过计算 加载识别后图片的宽高 去重新调整宽高
mImgView.setImageResource(R.drawable.icon_load_fail);
mAttacher.update();
------update() public void update() {
ImageView imageView = getImageView();
if (null != imageView) {
if (mZoomEnabled) {
// Make sure we using MATRIX Scale Type
setImageViewScaleTypeMatrix(imageView);
// Update the base matrix using the current drawable
updateBaseMatrix(imageView.getDrawable());
} else {
// Reset the Matrix...
resetMatrix();
}
}
}
------resetMatrix private void resetMatrix() {
mSuppMatrix.reset();
setImageViewMatrix(getDrawMatrix());
checkMatrixBounds();
}
------ getDrawMatrix public Matrix getDrawMatrix() {
mDrawMatrix.set(mBaseMatrix);
mDrawMatrix.postConcat(mSuppMatrix);
return mDrawMatrix;
}
------ checkMatrixBounds private boolean checkMatrixBounds() {
final ImageView imageView = getImageView();
if (null == imageView) {
return false;
}
The text was updated successfully, but these errors were encountered: