Skip to content

Commit

Permalink
Changed from extending ImageView to extending AppCompatImageView with…
Browse files Browse the repository at this point in the history
…in androidx
  • Loading branch information
Gareth Deli authored and hannesa2 committed Nov 24, 2018
1 parent f101476 commit a6e38aa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
4 changes: 4 additions & 0 deletions touchview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.0.1'
}
25 changes: 13 additions & 12 deletions touchview/src/main/java/com/ortiz/touchview/TouchImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6e38aa

Please sign in to comment.