Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions main/src/com/polites/android/GestureImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(displayWidth, displayHeight);
}

/**
* View reusing fix borrowed from
* https://github.com/jasonpolites/gesture-imageview/issues/64
* and slightly modified to match code conventions.
*/
private void resetForNextImage() {
layout = false;
startingScale = -1.0f;
}

@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
Expand Down Expand Up @@ -376,6 +386,8 @@ protected void onDetachedFromWindow() {
}

protected void initImage() {
resetForNextImage();

if(this.drawable != null) {
this.drawable.setAlpha(alpha);
this.drawable.setFilterBitmap(true);
Expand Down