diff options
-rw-r--r-- | app/build.gradle | 5 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImageActivity.java | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/app/build.gradle b/app/build.gradle index 707333bf..f81e6e53 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,9 @@ android { } buildTypes { release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { 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); |