aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-11-19 08:25:41 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-11-19 08:25:41 +0000
commitc21d59e9796800d250d6ec55e6a027933ef2d528 (patch)
treebae132cda435116af197330314886bbcdb03e9b7 /app/src/main/java
parent994df9062cdcbed8799a3b6862428cf64bf6fdb3 (diff)
downloadinfinity-for-reddit-c21d59e9796800d250d6ec55e6a027933ef2d528.tar
infinity-for-reddit-c21d59e9796800d250d6ec55e6a027933ef2d528.tar.gz
infinity-for-reddit-c21d59e9796800d250d6ec55e6a027933ef2d528.tar.bz2
infinity-for-reddit-c21d59e9796800d250d6ec55e6a027933ef2d528.tar.lz
infinity-for-reddit-c21d59e9796800d250d6ec55e6a027933ef2d528.tar.xz
infinity-for-reddit-c21d59e9796800d250d6ec55e6a027933ef2d528.tar.zst
infinity-for-reddit-c21d59e9796800d250d6ec55e6a027933ef2d528.zip
Change some zoom scalings in activitys and fragments for image viewing.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java15
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java11
3 files changed, 14 insertions, 14 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java
index 62ef3ddf..f336f94f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java
@@ -52,22 +52,22 @@ import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
+import ml.docilealligator.infinityforreddit.BuildConfig;
+import ml.docilealligator.infinityforreddit.Infinity;
+import ml.docilealligator.infinityforreddit.R;
+import ml.docilealligator.infinityforreddit.SetAsWallpaperCallback;
+import ml.docilealligator.infinityforreddit.WallpaperSetter;
import ml.docilealligator.infinityforreddit.asynctasks.SaveBitmapImageToFileAsyncTask;
import ml.docilealligator.infinityforreddit.asynctasks.SaveGIFToFileAsyncTask;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.SetAsWallpaperBottomSheetFragment;
-import ml.docilealligator.infinityforreddit.BuildConfig;
import ml.docilealligator.infinityforreddit.font.ContentFontFamily;
import ml.docilealligator.infinityforreddit.font.ContentFontStyle;
import ml.docilealligator.infinityforreddit.font.FontFamily;
import ml.docilealligator.infinityforreddit.font.FontStyle;
import ml.docilealligator.infinityforreddit.font.TitleFontFamily;
import ml.docilealligator.infinityforreddit.font.TitleFontStyle;
-import ml.docilealligator.infinityforreddit.Infinity;
-import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.services.DownloadMediaService;
-import ml.docilealligator.infinityforreddit.SetAsWallpaperCallback;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
-import ml.docilealligator.infinityforreddit.WallpaperSetter;
public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWallpaperCallback {
@@ -211,8 +211,6 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa
final SubsamplingScaleImageView view = mImageView.getSSIV();
if (view != null) {
- view.setMinimumDpi(80);
-
view.setOnImageEventListener(new SubsamplingScaleImageView.OnImageEventListener() {
@Override
public void onReady() {
@@ -221,7 +219,8 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa
@Override
public void onImageLoaded() {
- view.setDoubleTapZoomDpi(70);
+ view.setMinimumDpi(80);
+ view.setDoubleTapZoomDpi(240);
view.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_FIXED);
view.setQuickScaleEnabled(true);
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java
index 66d63fa8..d97fedd4 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java
@@ -102,6 +102,8 @@ public class ViewImgurImageFragment extends Fragment {
isActionBarHidden = true;
}
});
+ imageView.setMinimumDpi(80);
+ imageView.setDoubleTapZoomDpi(240);
errorLinearLayout.setOnClickListener(view -> {
progressBar.setVisibility(View.VISIBLE);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java
index 7c03154e..12e4a884 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java
@@ -45,15 +45,15 @@ import java.io.File;
import butterknife.BindView;
import butterknife.ButterKnife;
+import ml.docilealligator.infinityforreddit.BuildConfig;
+import ml.docilealligator.infinityforreddit.R;
+import ml.docilealligator.infinityforreddit.SetAsWallpaperCallback;
import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity;
import ml.docilealligator.infinityforreddit.asynctasks.SaveBitmapImageToFileAsyncTask;
import ml.docilealligator.infinityforreddit.asynctasks.SaveGIFToFileAsyncTask;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.SetAsWallpaperBottomSheetFragment;
-import ml.docilealligator.infinityforreddit.BuildConfig;
import ml.docilealligator.infinityforreddit.post.Post;
-import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.services.DownloadMediaService;
-import ml.docilealligator.infinityforreddit.SetAsWallpaperCallback;
public class ViewRedditGalleryImageOrGifFragment extends Fragment {
@@ -129,8 +129,6 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
final SubsamplingScaleImageView view = imageView.getSSIV();
if (view != null) {
- view.setMinimumDpi(80);
-
view.setOnImageEventListener(new SubsamplingScaleImageView.OnImageEventListener() {
@Override
public void onReady() {
@@ -139,7 +137,8 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment {
@Override
public void onImageLoaded() {
- view.setDoubleTapZoomDpi(70);
+ view.setMinimumDpi(80);
+ view.setDoubleTapZoomDpi(240);
view.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_FIXED);
view.setQuickScaleEnabled(true);
}