Skip to content

Commit d69cc12

Browse files
committed
Extend AppCompatImageView instead
1 parent e0fb4f8 commit d69cc12

File tree

5 files changed

+11
-19
lines changed

5 files changed

+11
-19
lines changed

build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
buildscript {
22
repositories {
3-
jcenter()
43
google()
5-
mavenCentral()
4+
jcenter()
65
}
76

87
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.1.2'
8+
classpath 'com.android.tools.build:gradle:3.1.3'
109
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1110
}
1211
}
1312

1413
allprojects {
15-
1614
repositories {
17-
jcenter()
1815
google()
16+
jcenter()
1917
}
2018
}
2119

2220
ext {
2321
sdkVersion = 27
24-
buildToolsVersion = '27.0.3'
2522
supportLibVersion = '27.1.1'
2623
}

photoview/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ apply plugin: 'com.github.dcendents.android-maven'
33

44
android {
55
compileSdkVersion rootProject.ext.sdkVersion
6-
buildToolsVersion rootProject.ext.buildToolsVersion
76

87
defaultConfig {
98
minSdkVersion 14
@@ -13,4 +12,8 @@ android {
1312
}
1413
}
1514

15+
dependencies {
16+
implementation "com.android.support:appcompat-v7:$supportLibVersion"
17+
}
18+
1619
apply from: 'https://raw.githubusercontent.com/Commit451/gradle-android-javadocs/1.0.0/gradle-android-javadocs.gradle'

photoview/src/main/java/com/github/chrisbanes/photoview/PhotoView.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,20 @@
1515
*******************************************************************************/
1616
package com.github.chrisbanes.photoview;
1717

18-
import android.annotation.TargetApi;
1918
import android.content.Context;
2019
import android.graphics.Matrix;
2120
import android.graphics.RectF;
2221
import android.graphics.drawable.Drawable;
2322
import android.net.Uri;
23+
import android.support.v7.widget.AppCompatImageView;
2424
import android.util.AttributeSet;
2525
import android.view.GestureDetector;
26-
import android.widget.ImageView;
2726

2827
/**
29-
* A zoomable {@link ImageView}. See {@link PhotoViewAttacher} for most of the details on how the zooming
28+
* A zoomable ImageView. See {@link PhotoViewAttacher} for most of the details on how the zooming
3029
* is accomplished
3130
*/
32-
public class PhotoView extends ImageView {
31+
public class PhotoView extends AppCompatImageView {
3332

3433
private PhotoViewAttacher attacher;
3534
private ScaleType pendingScaleType;
@@ -47,12 +46,6 @@ public PhotoView(Context context, AttributeSet attr, int defStyle) {
4746
init();
4847
}
4948

50-
@TargetApi(21)
51-
public PhotoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
52-
super(context, attrs, defStyleAttr, defStyleRes);
53-
init();
54-
}
55-
5649
private void init() {
5750
attacher = new PhotoViewAttacher(this);
5851
//We always pose as a Matrix scale type, though we can change to another scale type

photoview/src/main/java/com/github/chrisbanes/photoview/PhotoViewAttacher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
/**
3535
* The component of {@link PhotoView} which does the work allowing for zooming, scaling, panning, etc.
36-
* It is made public in case you need to subclass something other than {@link ImageView} and still
36+
* It is made public in case you need to subclass something other than AppCompatImageView and still
3737
* gain the functionality that {@link PhotoView} offers
3838
*/
3939
public class PhotoViewAttacher implements View.OnTouchListener,

sample/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion rootProject.ext.sdkVersion
5-
buildToolsVersion rootProject.ext.buildToolsVersion
65

76
defaultConfig {
87
applicationId "uk.co.senab.photoview.sample"

0 commit comments

Comments
 (0)