From bc6a83823b0e43fd606cb85944b5cf3cbf91abb1 Mon Sep 17 00:00:00 2001 From: Vadiraj Purohit Date: Sun, 12 Aug 2018 17:29:58 -0400 Subject: [PATCH 1/3] Fixed Issue #41 java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed --- .gitignore | 1 + .idea/compiler.xml | 22 ------ .idea/copyright/profiles_settings.xml | 3 - .idea/encodings.xml | 6 -- .idea/misc.xml | 94 +++++++++++++++++++----- build.gradle | 4 +- gradle/wrapper/gradle-wrapper.properties | 4 +- library/build.gradle | 14 ++-- sample/build.gradle | 17 ++--- 9 files changed, 93 insertions(+), 72 deletions(-) delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/encodings.xml diff --git a/.gitignore b/.gitignore index c6cbe56..47e9145 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea *.iml .gradle /local.properties diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 96cc43e..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 656f5d4..fa789f1 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,15 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -24,26 +94,10 @@ - + - - - - - Android API 15 Platform - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index cd5c3ad..780c70c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,10 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' + classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // NOTE: Do not place your application dependencies here; they belong @@ -16,5 +17,6 @@ buildscript { allprojects { repositories { jcenter() + google() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 50e05ac..1923d51 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jul 19 11:30:51 EET 2017 +#Sun Aug 12 17:15:54 EDT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/library/build.gradle b/library/build.gradle index 64bde14..1427f0c 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -4,12 +4,10 @@ apply plugin: 'com.github.dcendents.android-maven' group = 'com.github.ceryle' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" - + compileSdkVersion 28 defaultConfig { - minSdkVersion 11 - targetSdkVersion 25 + minSdkVersion 18 + targetSdkVersion 28 versionCode 1 versionName "1.0" } @@ -45,7 +43,7 @@ artifacts { dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:25.3.1' + implementation fileTree(dir: 'libs', include: ['*.jar']) + testImplementation 'junit:junit:4.12' + implementation 'com.android.support:appcompat-v7:28.0.0-rc01' } diff --git a/sample/build.gradle b/sample/build.gradle index 2d4250b..8ea6b6d 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,13 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" - + compileSdkVersion 28 defaultConfig { applicationId "co.ceryle.radiorealbutton.sample" - minSdkVersion 11 - targetSdkVersion 25 + minSdkVersion 18 + targetSdkVersion 28 versionCode 1 versionName "1.0" } @@ -20,9 +18,8 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:25.3.1' - - compile project(":library") + implementation fileTree(dir: 'libs', include: ['*.jar']) + testImplementation 'junit:junit:4.12' + implementation 'com.android.support:appcompat-v7:28.0.0-rc01' + implementation project(":library") } From 26715506e6f2a19a019bcfdaa60d1b46efdaec0b Mon Sep 17 00:00:00 2001 From: Vadiraj Purohit Date: Sun, 12 Aug 2018 17:38:26 -0400 Subject: [PATCH 2/3] Fixed Issue #41 java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed --- .../co/ceryle/radiorealbutton/RoundedCornerLayout.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java b/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java index fa308bd..e6a2682 100644 --- a/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java +++ b/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java @@ -77,8 +77,12 @@ protected void dispatchDraw(Canvas canvas) { final Path path = new Path(); path.addRoundRect(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()), cornerRadius, cornerRadius, Path.Direction.CW); - canvas.clipPath(path, Region.Op.REPLACE); - canvas.clipPath(path); + // https://developer.android.com/reference/android/graphics/Canvas#clipPath(android.graphics.Path,%20android.graphics.Region.Op) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + canvas.clipOutPath(path); + } else { + canvas.clipPath(path, Region.Op.REPLACE); + } super.dispatchDraw(canvas); From 1ff037a301dc702b3099377b8183a20a58c31698 Mon Sep 17 00:00:00 2001 From: Vadiraj Purohit Date: Tue, 14 Aug 2018 09:25:03 -0400 Subject: [PATCH 3/3] Fixed the radio real button appearance for Android P with Region.Op.INTERSECT --- build.gradle | 2 +- .../java/co/ceryle/radiorealbutton/RoundedCornerLayout.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 780c70c..a2f6bcc 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' + classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // NOTE: Do not place your application dependencies here; they belong diff --git a/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java b/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java index e6a2682..8564e7c 100644 --- a/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java +++ b/library/src/main/java/co/ceryle/radiorealbutton/RoundedCornerLayout.java @@ -78,8 +78,8 @@ protected void dispatchDraw(Canvas canvas) { final Path path = new Path(); path.addRoundRect(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()), cornerRadius, cornerRadius, Path.Direction.CW); // https://developer.android.com/reference/android/graphics/Canvas#clipPath(android.graphics.Path,%20android.graphics.Region.Op) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - canvas.clipOutPath(path); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + canvas.clipPath(path, Region.Op.INTERSECT); } else { canvas.clipPath(path, Region.Op.REPLACE); }