diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2020-05-12 01:52:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 01:52:06 +0000 |
commit | b4e6f00074e1d9575fd95cd76ab58baa1545ceb9 (patch) | |
tree | 2eb6129d35e2a7be916c6ebcd608aff857034407 /app/src/main/java/ml | |
parent | c705292bf8f8568621e2831f58e9200479706e31 (diff) | |
parent | 6ea0e9e3e6fcdea0a1f0be7226d2977a805501f9 (diff) | |
download | infinity-for-reddit-b4e6f00074e1d9575fd95cd76ab58baa1545ceb9.tar infinity-for-reddit-b4e6f00074e1d9575fd95cd76ab58baa1545ceb9.tar.gz infinity-for-reddit-b4e6f00074e1d9575fd95cd76ab58baa1545ceb9.tar.bz2 infinity-for-reddit-b4e6f00074e1d9575fd95cd76ab58baa1545ceb9.tar.lz infinity-for-reddit-b4e6f00074e1d9575fd95cd76ab58baa1545ceb9.tar.xz infinity-for-reddit-b4e6f00074e1d9575fd95cd76ab58baa1545ceb9.tar.zst infinity-for-reddit-b4e6f00074e1d9575fd95cd76ab58baa1545ceb9.zip |
Merge pull request #92 from OHermesJunior/fix-image-view-resolution
Fix image view with low resolution in ViewImageActivity.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java index 1ec2de8d..4533818d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java @@ -91,6 +91,7 @@ public class ViewImageActivity extends AppCompatActivity { private String mImageFileName; private float totalLengthY = 0.0f; private float touchY = -1.0f; + private float initialZoom = 1.0f; private float zoom = 1.0f; private boolean isSwiping = false; private RequestManager glide; @@ -327,7 +328,7 @@ public class ViewImageActivity extends AppCompatActivity { @Override public void onStateReset(State oldState, State newState) { - + initialZoom = newState.getZoom(); } }); @@ -367,7 +368,7 @@ public class ViewImageActivity extends AppCompatActivity { mProgressBar.setVisibility(View.GONE); return false; } - }).apply(new RequestOptions().fitCenter()).into(mImageView); + }).into(mImageView); } @Override @@ -455,7 +456,7 @@ public class ViewImageActivity extends AppCompatActivity { @Override public boolean dispatchTouchEvent(MotionEvent ev) { - if (zoom == 1.0) { + if (Math.abs(zoom - initialZoom) <= 0.000001) { swipe.dispatchTouchEvent(ev); } return super.dispatchTouchEvent(ev); |