mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-07 11:17:25 +01:00
Merge pull request #92 from OHermesJunior/fix-image-view-resolution
Fix image view with low resolution in ViewImageActivity.
This commit is contained in:
commit
b4e6f00074
@ -91,6 +91,7 @@ public class ViewImageActivity extends AppCompatActivity {
|
|||||||
private String mImageFileName;
|
private String mImageFileName;
|
||||||
private float totalLengthY = 0.0f;
|
private float totalLengthY = 0.0f;
|
||||||
private float touchY = -1.0f;
|
private float touchY = -1.0f;
|
||||||
|
private float initialZoom = 1.0f;
|
||||||
private float zoom = 1.0f;
|
private float zoom = 1.0f;
|
||||||
private boolean isSwiping = false;
|
private boolean isSwiping = false;
|
||||||
private RequestManager glide;
|
private RequestManager glide;
|
||||||
@ -327,7 +328,7 @@ public class ViewImageActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStateReset(State oldState, State newState) {
|
public void onStateReset(State oldState, State newState) {
|
||||||
|
initialZoom = newState.getZoom();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -367,7 +368,7 @@ public class ViewImageActivity extends AppCompatActivity {
|
|||||||
mProgressBar.setVisibility(View.GONE);
|
mProgressBar.setVisibility(View.GONE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).apply(new RequestOptions().fitCenter()).into(mImageView);
|
}).into(mImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -455,7 +456,7 @@ public class ViewImageActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||||
if (zoom == 1.0) {
|
if (Math.abs(zoom - initialZoom) <= 0.000001) {
|
||||||
swipe.dispatchTouchEvent(ev);
|
swipe.dispatchTouchEvent(ev);
|
||||||
}
|
}
|
||||||
return super.dispatchTouchEvent(ev);
|
return super.dispatchTouchEvent(ev);
|
||||||
|
Loading…
Reference in New Issue
Block a user