Skip to content

Commit 7f47d5c

Browse files
author
zagum
committed
- fixed clipPath deprecation on android P
- updated versions
1 parent 0d8175f commit 7f47d5c

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
google()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:3.1.0'
7+
classpath 'com.android.tools.build:gradle:3.1.4'
88
}
99
}
1010

@@ -17,11 +17,11 @@ allprojects {
1717

1818
ext {
1919
compileSdkVersion = 27
20-
buildToolsVersion = '27.0.0'
20+
buildToolsVersion = '27.0.3'
2121
minSdkVersion = 15
2222
targetSdkVersion = compileSdkVersion
2323

24-
supportLibVersion = '27.1.0'
24+
supportLibVersion = '27.1.1'
2525
}
2626

2727
task clean(type: Delete) {

switchicon-sample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'com.android.application'
22

33
dependencies {
4-
compile project(":switchicon")
5-
compile "com.android.support:appcompat-v7:$supportLibVersion"
4+
implementation project(":switchicon")
5+
implementation "com.android.support:appcompat-v7:$supportLibVersion"
66
}
77

88
android {

switchicon/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
apply plugin: 'com.android.library'
22

33
dependencies {
4-
compile "com.android.support:appcompat-v7:$supportLibVersion"
4+
implementation "com.android.support:appcompat-v7:$supportLibVersion"
55
}
66

77
android {
8-
compileSdkVersion rootProject.ext.compileSdkVersion
9-
buildToolsVersion rootProject.ext.buildToolsVersion
8+
compileSdkVersion rootProject.ext.compileSdkVersion
9+
buildToolsVersion rootProject.ext.buildToolsVersion
1010

11-
defaultConfig {
12-
minSdkVersion rootProject.ext.minSdkVersion
13-
}
11+
defaultConfig {
12+
minSdkVersion rootProject.ext.minSdkVersion
13+
}
1414
}

switchicon/src/main/java/com/github/zagum/switchicon/SwitchIconView.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight)
208208
protected void onDraw(Canvas canvas) {
209209
if (!noDash) {
210210
drawDash(canvas);
211-
canvas.clipPath(clipPath, Region.Op.XOR);
211+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
212+
canvas.clipOutPath(clipPath);
213+
} else {
214+
canvas.clipPath(clipPath, Region.Op.XOR);
215+
}
212216
}
213217
super.onDraw(canvas);
214218
}

0 commit comments

Comments
 (0)