From b6012cd968175330cccfcb77239225854377b3de Mon Sep 17 00:00:00 2001 From: Andrew Samuel Date: Tue, 27 Jul 2021 00:02:35 +0200 Subject: [PATCH 1/5] fix(Gradle) updated grade version, min and target sdk --- build.gradle | 4 +++- gradle/wrapper/gradle-wrapper.properties | 2 +- sample/build.gradle | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 010afe941..a0e6cd97e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,10 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.android.tools.build:gradle:4.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -18,5 +19,6 @@ allprojects { repositories { jcenter() + google() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1dbd8cc09..d78960d3f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https://services.gradle.org/distributions/gradle-7.1.1-bin.zip diff --git a/sample/build.gradle b/sample/build.gradle index 4ceeab2f1..f805055f7 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + compileSdkVersion 30 + buildToolsVersion "30.0.3" defaultConfig { applicationId "com.alamkanak.weekview" - minSdkVersion 9 - targetSdkVersion 23 + minSdkVersion 21 + targetSdkVersion 30 versionCode 1 versionName "1.0" } From 620c311fb6c8bb73af162394df0a0978757b7483 Mon Sep 17 00:00:00 2001 From: Andrew Samuel Date: Tue, 27 Jul 2021 00:24:06 +0200 Subject: [PATCH 2/5] fix(Gradle) updated gradle version --- build.gradle | 6 +++--- library/build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index a0e6cd97e..5469715de 100644 --- a/build.gradle +++ b/build.gradle @@ -2,11 +2,11 @@ buildscript { repositories { - jcenter() + mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' + classpath 'com.android.tools.build:gradle:4.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -18,7 +18,7 @@ allprojects { group = GROUP repositories { - jcenter() + mavenCentral() google() } } diff --git a/library/build.gradle b/library/build.gradle index 8dc7eed88..b3db44121 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -6,7 +6,7 @@ repositories { android { compileSdkVersion 23 - buildToolsVersion "23.0.1" + buildToolsVersion "23.0.3" defaultConfig { minSdkVersion 9 From e32ee78959794e47ebaf9a3d1b4d842075882230 Mon Sep 17 00:00:00 2001 From: Andrew Samuel Date: Tue, 27 Jul 2021 00:32:55 +0200 Subject: [PATCH 3/5] fix: added androidx AppCompat to the project --- build.gradle | 1 + gradle.properties | 3 ++- library/build.gradle | 12 +++++++----- .../main/java/com/alamkanak/weekview/WeekView.java | 12 +++++++----- sample/build.gradle | 10 ++++++---- .../com/alamkanak/weekview/sample/BaseActivity.java | 3 ++- .../com/alamkanak/weekview/sample/MainActivity.java | 3 ++- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 5469715de..454b51990 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.appcompat_version = "1.3.1" repositories { mavenCentral() google() diff --git a/gradle.properties b/gradle.properties index dc21e80b5..f01fc6f46 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,5 @@ POM_LICENCE_NAME=The Apache Software License, Version 2.0 POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt POM_LICENCE_DIST=repo POM_DEVELOPER_ID=alamkanak -POM_DEVELOPER_NAME=Raquib-ul-Alam (Kanak) \ No newline at end of file +POM_DEVELOPER_NAME=Raquib-ul-Alam (Kanak) +android.useAndroidX=true diff --git a/library/build.gradle b/library/build.gradle index b3db44121..d01b9b504 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -5,17 +5,19 @@ repositories { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion 30 + buildToolsVersion "30.0.3" defaultConfig { - minSdkVersion 9 - targetSdkVersion 23 + minSdkVersion 21 + targetSdkVersion 30 } } dependencies { - compile 'com.android.support:appcompat-v7:23.1.1' + implementation "androidx.appcompat:appcompat:$appcompat_version" + // For loading and tinting drawables on older versions of the platform + implementation "androidx.appcompat:appcompat-resources:$appcompat_version" } apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' \ No newline at end of file diff --git a/library/src/main/java/com/alamkanak/weekview/WeekView.java b/library/src/main/java/com/alamkanak/weekview/WeekView.java index a4a673b11..8225175d2 100755 --- a/library/src/main/java/com/alamkanak/weekview/WeekView.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekView.java @@ -11,10 +11,6 @@ import android.graphics.Region; import android.graphics.Typeface; import android.os.Build; -import android.support.annotation.Nullable; -import android.support.v4.view.GestureDetectorCompat; -import android.support.v4.view.ViewCompat; -import android.support.v4.view.animation.FastOutLinearInInterpolator; import android.text.Layout; import android.text.SpannableStringBuilder; import android.text.StaticLayout; @@ -34,6 +30,11 @@ import android.view.ViewConfiguration; import android.widget.OverScroller; +import androidx.annotation.Nullable; +import androidx.core.view.GestureDetectorCompat; +import androidx.core.view.ViewCompat; +import androidx.interpolator.view.animation.FastOutLinearInInterpolator; + import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; @@ -1231,7 +1232,8 @@ public EventClickListener getEventClickListener() { return mEventClickListener; } - public @Nullable MonthLoader.MonthChangeListener getMonthChangeListener() { + public @Nullable + MonthLoader.MonthChangeListener getMonthChangeListener() { if (mWeekViewLoader instanceof MonthLoader) return ((MonthLoader) mWeekViewLoader).getOnMonthChangeListener(); return null; diff --git a/sample/build.gradle b/sample/build.gradle index f805055f7..a9efa6f53 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -20,8 +20,10 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile project(':library') - compile 'com.android.support:appcompat-v7:23.1.1' - compile 'com.squareup.retrofit:retrofit:1.9.0' + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation project(':library') + implementation "androidx.appcompat:appcompat:$appcompat_version" + // For loading and tinting drawables on older versions of the platform + implementation "androidx.appcompat:appcompat-resources:$appcompat_version" + implementation 'com.squareup.retrofit:retrofit:1.9.0' } diff --git a/sample/src/main/java/com/alamkanak/weekview/sample/BaseActivity.java b/sample/src/main/java/com/alamkanak/weekview/sample/BaseActivity.java index e311d1943..dc308adad 100644 --- a/sample/src/main/java/com/alamkanak/weekview/sample/BaseActivity.java +++ b/sample/src/main/java/com/alamkanak/weekview/sample/BaseActivity.java @@ -2,12 +2,13 @@ import android.graphics.RectF; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; import android.util.TypedValue; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; + import com.alamkanak.weekview.DateTimeInterpreter; import com.alamkanak.weekview.MonthLoader; import com.alamkanak.weekview.WeekView; diff --git a/sample/src/main/java/com/alamkanak/weekview/sample/MainActivity.java b/sample/src/main/java/com/alamkanak/weekview/sample/MainActivity.java index 678396799..cf02d1c67 100644 --- a/sample/src/main/java/com/alamkanak/weekview/sample/MainActivity.java +++ b/sample/src/main/java/com/alamkanak/weekview/sample/MainActivity.java @@ -2,9 +2,10 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; import android.view.View; +import androidx.appcompat.app.AppCompatActivity; + /** * The launcher activity of the sample app. It contains the links to visit all the example screens. From fccfa5549973d60e4b7d6dc2182c66fef21d66eb Mon Sep 17 00:00:00 2001 From: Andrew Samuel Date: Tue, 27 Jul 2021 00:42:11 +0200 Subject: [PATCH 4/5] fix(WeekView) stopped using Region.Op op as parameter for clipRect() --- library/src/main/java/com/alamkanak/weekview/WeekView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/alamkanak/weekview/WeekView.java b/library/src/main/java/com/alamkanak/weekview/WeekView.java index 8225175d2..2a56db03d 100755 --- a/library/src/main/java/com/alamkanak/weekview/WeekView.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekView.java @@ -533,7 +533,7 @@ private void drawTimeColumnAndAxes(Canvas canvas) { canvas.drawRect(0, mHeaderHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight(), mHeaderColumnBackgroundPaint); // Clip to paint in left column only. - canvas.clipRect(0, mHeaderHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight(), Region.Op.REPLACE); + canvas.clipRect(0, mHeaderHeight + mHeaderRowPadding * 2, mHeaderColumnWidth, getHeight()); for (int i = 0; i < 24; i++) { float top = mHeaderHeight + mHeaderRowPadding * 2 + mCurrentOrigin.y + mHourHeight * i + mHeaderMarginBottom; @@ -627,7 +627,7 @@ else if (mNewHourHeight > mMaxHourHeight) } // Clip to paint events only. - canvas.clipRect(mHeaderColumnWidth, mHeaderHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2, getWidth(), getHeight(), Region.Op.REPLACE); + canvas.clipRect(mHeaderColumnWidth, mHeaderHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2, getWidth(), getHeight()); // Iterate through each day. Calendar oldFirstVisibleDay = mFirstVisibleDay; @@ -715,7 +715,7 @@ else if (day.before(today)) { } // Hide everything in the first cell (top left corner). - canvas.clipRect(0, 0, mTimeTextWidth + mHeaderColumnPadding * 2, mHeaderHeight + mHeaderRowPadding * 2, Region.Op.REPLACE); + canvas.clipRect(0, 0, mTimeTextWidth + mHeaderColumnPadding * 2, mHeaderHeight + mHeaderRowPadding * 2); canvas.drawRect(0, 0, mTimeTextWidth + mHeaderColumnPadding * 2, mHeaderHeight + mHeaderRowPadding * 2, mHeaderBackgroundPaint); // Clip to paint header row only. From 9baa33584e922d3b72f9c8062ce0cf8e671127d4 Mon Sep 17 00:00:00 2001 From: Andrew Samuel Date: Tue, 27 Jul 2021 00:43:08 +0200 Subject: [PATCH 5/5] fix(WeekView) stopped using Region.Op op as parameter for clipRect() --- library/src/main/java/com/alamkanak/weekview/WeekView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/com/alamkanak/weekview/WeekView.java b/library/src/main/java/com/alamkanak/weekview/WeekView.java index 2a56db03d..30b9c97d6 100755 --- a/library/src/main/java/com/alamkanak/weekview/WeekView.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekView.java @@ -719,7 +719,7 @@ else if (day.before(today)) { canvas.drawRect(0, 0, mTimeTextWidth + mHeaderColumnPadding * 2, mHeaderHeight + mHeaderRowPadding * 2, mHeaderBackgroundPaint); // Clip to paint header row only. - canvas.clipRect(mHeaderColumnWidth, 0, getWidth(), mHeaderHeight + mHeaderRowPadding * 2, Region.Op.REPLACE); + canvas.clipRect(mHeaderColumnWidth, 0, getWidth(), mHeaderHeight + mHeaderRowPadding * 2); // Draw the header background. canvas.drawRect(0, 0, getWidth(), mHeaderHeight + mHeaderRowPadding * 2, mHeaderBackgroundPaint);