diff --git a/build.gradle b/build.gradle index 010afe941..454b51990 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.appcompat_version = "1.3.1" repositories { - jcenter() + mavenCentral() + google() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.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 @@ -17,6 +19,7 @@ allprojects { group = GROUP repositories { - jcenter() + 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/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/library/build.gradle b/library/build.gradle index 8dc7eed88..d01b9b504 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -5,17 +5,19 @@ repositories { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + 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..30b9c97d6 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; @@ -532,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; @@ -626,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; @@ -714,11 +715,11 @@ 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. - 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); @@ -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 4ceeab2f1..a9efa6f53 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" } @@ -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.