From a6e38aa521e7bd5c76d70c4a4d7b7addd236d351 Mon Sep 17 00:00:00 2001 From: Gareth Deli Date: Sat, 24 Nov 2018 16:20:06 +0000 Subject: [PATCH] Changed from extending ImageView to extending AppCompatImageView within androidx --- app/build.gradle | 2 +- touchview/build.gradle | 4 +++ .../com/ortiz/touchview/TouchImageView.java | 25 ++++++++++--------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f2d29aa9..48137028 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,6 +18,6 @@ android { } dependencies { - implementation "androidx.legacy:legacy-support-v4:1.0.0" + implementation 'androidx.appcompat:appcompat:1.0.1' implementation project(':touchview') } diff --git a/touchview/build.gradle b/touchview/build.gradle index b0951131..186bf411 100644 --- a/touchview/build.gradle +++ b/touchview/build.gradle @@ -20,4 +20,8 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } +} + +dependencies { + implementation 'androidx.appcompat:appcompat:1.0.1' } \ No newline at end of file diff --git a/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java b/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java index 7357ab51..eaad2942 100644 --- a/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java +++ b/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java @@ -35,21 +35,22 @@ import android.view.ScaleGestureDetector; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; -import android.widget.ImageView; import android.widget.OverScroller; import android.widget.Scroller; -public class TouchImageView extends ImageView { - - private static final String DEBUG = "DEBUG"; - - // - // SuperMin and SuperMax multipliers. Determine how much the image can be - // zoomed below or above the zoom boundaries, before animating back to the - // min/max zoom boundary. - // - private static final float SUPER_MIN_MULTIPLIER = .75f; - private static final float SUPER_MAX_MULTIPLIER = 1.25f; +import androidx.appcompat.widget.AppCompatImageView; + +public class TouchImageView extends AppCompatImageView { + + private static final String DEBUG = "DEBUG"; + + // + // SuperMin and SuperMax multipliers. Determine how much the image can be + // zoomed below or above the zoom boundaries, before animating back to the + // min/max zoom boundary. + // + private static final float SUPER_MIN_MULTIPLIER = .75f; + private static final float SUPER_MAX_MULTIPLIER = 1.25f; // // Scale of image ranges from minScale to maxScale, where minScale == 1