From df18fc63ad19511efed96ff04aa35f4f2b01afce Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 7 Jan 2021 15:59:45 +0800 Subject: Fix some images not showing in center. --- .../infinityforreddit/activities/ViewImageOrGifActivity.java | 1 + .../infinityforreddit/fragments/ViewImgurImageFragment.java | 1 + .../infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java | 1 + 3 files changed, 3 insertions(+) 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 63fc42a9..1a5a8c38 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java @@ -223,6 +223,7 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa view.setDoubleTapZoomDpi(240); view.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_FIXED); view.setQuickScaleEnabled(true); + view.resetScaleAndCenter(); } @Override 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 51bfeb6c..df4c01cb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java @@ -104,6 +104,7 @@ public class ViewImgurImageFragment extends Fragment { }); imageView.setMinimumDpi(80); imageView.setDoubleTapZoomDpi(240); + imageView.resetScaleAndCenter(); 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 b93068c5..7373279e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java @@ -141,6 +141,7 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { view.setDoubleTapZoomDpi(240); view.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_FIXED); view.setQuickScaleEnabled(true); + view.resetScaleAndCenter(); } @Override -- cgit v1.2.3