From 6895e239e5cd4de0de3820493cdc93b2311d3f34 Mon Sep 17 00:00:00 2001 From: dmorozov Date: Tue, 20 Sep 2022 13:06:39 +0300 Subject: [PATCH 1/2] Update project - Update gradle version - Fix gradle issues - Update mavenpush.gradle script - Update compileSdkVersion - Update targetSdkVersion - Update buildToolsVersion - Migrate to AndroidX --- build.gradle | 4 +- gradle.properties | 4 ++ gradle/wrapper/gradle-wrapper.properties | 3 +- library/build.gradle | 14 ++--- .../yalantis/phoenix/PullToRefreshView.java | 7 +-- .../phoenix/refresh_view/BaseRefreshView.java | 3 +- mavenpush.gradle | 54 ++++++++++--------- sample/build.gradle | 19 +++---- sample/src/main/AndroidManifest.xml | 3 +- .../phoenix/sample/BaseRefreshFragment.java | 3 +- .../phoenix/sample/ListViewFragment.java | 3 +- .../phoenix/sample/PullToRefreshActivity.java | 16 +++--- .../phoenix/sample/RecyclerViewFragment.java | 5 +- .../res/layout/activity_pull_to_refresh.xml | 6 +-- .../res/layout/fragment_recycler_view.xml | 2 +- 15 files changed, 83 insertions(+), 63 deletions(-) diff --git a/build.gradle b/build.gradle index c63c5b9..90cf81c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,10 @@ buildscript { repositories { + google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0-alpha1' + classpath 'com.android.tools.build:gradle:7.3.0' } } @@ -16,6 +17,7 @@ allprojects { group = GROUP repositories { + google() mavenCentral() } } diff --git a/gradle.properties b/gradle.properties index 3c87cdc..9908150 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,6 +17,10 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official + VERSION_NAME=1.2.3 VERSION_CODE=8 GROUP=com.yalantis diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 137ca20..41dfb87 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Nov 30 13:15:11 EET 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/library/build.gradle b/library/build.gradle index 519d7b3..2bec8b4 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,24 +1,24 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 23 - buildToolsVersion '23.0.2' + compileSdkVersion 33 + buildToolsVersion '30.0.3' defaultConfig { minSdkVersion 9 - targetSdkVersion 23 + targetSdkVersion 33 versionCode 8 versionName "1.2.3" } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:support-v4:23.1.1' + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation "androidx.appcompat:appcompat:1.5.1" } apply from: '../mavenpush.gradle' \ No newline at end of file diff --git a/library/src/main/java/com/yalantis/phoenix/PullToRefreshView.java b/library/src/main/java/com/yalantis/phoenix/PullToRefreshView.java index 91dba70..15ed94d 100644 --- a/library/src/main/java/com/yalantis/phoenix/PullToRefreshView.java +++ b/library/src/main/java/com/yalantis/phoenix/PullToRefreshView.java @@ -2,9 +2,6 @@ import android.content.Context; import android.content.res.TypedArray; -import android.support.annotation.NonNull; -import android.support.v4.view.MotionEventCompat; -import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -17,6 +14,10 @@ import android.widget.AbsListView; import android.widget.ImageView; +import androidx.annotation.NonNull; +import androidx.core.view.MotionEventCompat; +import androidx.core.view.ViewCompat; + import com.yalantis.phoenix.refresh_view.BaseRefreshView; import com.yalantis.phoenix.refresh_view.SunRefreshView; import com.yalantis.phoenix.util.Utils; diff --git a/library/src/main/java/com/yalantis/phoenix/refresh_view/BaseRefreshView.java b/library/src/main/java/com/yalantis/phoenix/refresh_view/BaseRefreshView.java index 5b0ea29..be6b027 100644 --- a/library/src/main/java/com/yalantis/phoenix/refresh_view/BaseRefreshView.java +++ b/library/src/main/java/com/yalantis/phoenix/refresh_view/BaseRefreshView.java @@ -5,7 +5,8 @@ import android.graphics.PixelFormat; import android.graphics.drawable.Animatable; import android.graphics.drawable.Drawable; -import android.support.annotation.NonNull; + +import androidx.annotation.NonNull; import com.yalantis.phoenix.PullToRefreshView; diff --git a/mavenpush.gradle b/mavenpush.gradle index b741e61..62396d5 100644 --- a/mavenpush.gradle +++ b/mavenpush.gradle @@ -1,4 +1,4 @@ -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' def sonatypeRepositoryUrl @@ -21,51 +21,57 @@ def getRepositoryPassword() { } afterEvaluate { project -> - uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - pom.artifactId = POM_ARTIFACT_ID + publishing { + publications { + mavenJava(MavenPublication) { - repository(url: sonatypeRepositoryUrl) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } + artifactId = POM_ARTIFACT_ID - pom.project { - name POM_NAME - packaging POM_PACKAGING - description POM_DESCRIPTION - url POM_URL + pom { + name = POM_NAME + packaging = POM_PACKAGING + description = POM_DESCRIPTION + url = POM_URL scm { - url POM_SCM_URL - connection POM_SCM_CONNECTION - developerConnection POM_SCM_DEV_CONNECTION + url = POM_SCM_URL + connection = POM_SCM_CONNECTION + developerConnection = POM_SCM_DEV_CONNECTION } licenses { license { - name POM_LICENCE_NAME - url POM_LICENCE_URL - distribution POM_LICENCE_DIST + name = POM_LICENCE_NAME + url = POM_LICENCE_URL + distribution = POM_LICENCE_DIST } } developers { developer { - id POM_DEVELOPER_ID - name POM_DEVELOPER_NAME + id = POM_DEVELOPER_ID + name = POM_DEVELOPER_NAME } } } } } + + repositories { + maven { + url = sonatypeRepositoryUrl + + credentials { + username = getRepositoryUsername() + password = getRepositoryPassword() + } + } + } } signing { required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives + sign publishing.publications.mavenJava } task androidJavadocs(type: Javadoc) { diff --git a/sample/build.gradle b/sample/build.gradle index 9d18865..a1eab87 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,24 +1,25 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '23.0.2' + compileSdkVersion 33 + buildToolsVersion '30.0.3' defaultConfig { applicationId "com.yalantis.phoenix.sample" - minSdkVersion 9 - targetSdkVersion 23 + minSdkVersion 14 + targetSdkVersion 33 versionCode 2 versionName "2.0" } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { - compile 'com.android.support:design:23.1.1' - compile 'com.android.support:recyclerview-v7:23.1.1' - compile project(':library') + implementation project(':library') + + implementation "com.google.android.material:material:1.6.1" + implementation "androidx.recyclerview:recyclerview:1.2.1" } diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index f3e6dbb..44b4ff4 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -10,7 +10,8 @@ + android:screenOrientation="fullSensor" + android:exported="true"> diff --git a/sample/src/main/java/com/yalantis/phoenix/sample/BaseRefreshFragment.java b/sample/src/main/java/com/yalantis/phoenix/sample/BaseRefreshFragment.java index 1e8cf98..a50dae8 100644 --- a/sample/src/main/java/com/yalantis/phoenix/sample/BaseRefreshFragment.java +++ b/sample/src/main/java/com/yalantis/phoenix/sample/BaseRefreshFragment.java @@ -1,7 +1,8 @@ package com.yalantis.phoenix.sample; import android.os.Bundle; -import android.support.v4.app.Fragment; + +import androidx.fragment.app.Fragment; import java.util.ArrayList; import java.util.HashMap; diff --git a/sample/src/main/java/com/yalantis/phoenix/sample/ListViewFragment.java b/sample/src/main/java/com/yalantis/phoenix/sample/ListViewFragment.java index 9b76277..135bbd0 100644 --- a/sample/src/main/java/com/yalantis/phoenix/sample/ListViewFragment.java +++ b/sample/src/main/java/com/yalantis/phoenix/sample/ListViewFragment.java @@ -2,7 +2,6 @@ import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -10,6 +9,8 @@ import android.widget.ImageView; import android.widget.ListView; +import androidx.annotation.NonNull; + import com.yalantis.phoenix.PullToRefreshView; import java.util.List; diff --git a/sample/src/main/java/com/yalantis/phoenix/sample/PullToRefreshActivity.java b/sample/src/main/java/com/yalantis/phoenix/sample/PullToRefreshActivity.java index 977ddcd..ba9b42e 100644 --- a/sample/src/main/java/com/yalantis/phoenix/sample/PullToRefreshActivity.java +++ b/sample/src/main/java/com/yalantis/phoenix/sample/PullToRefreshActivity.java @@ -1,13 +1,15 @@ package com.yalantis.phoenix.sample; import android.os.Bundle; -import android.support.design.widget.TabLayout; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import com.google.android.material.tabs.TabLayout; /** * Created by Oleksii Shliama. diff --git a/sample/src/main/java/com/yalantis/phoenix/sample/RecyclerViewFragment.java b/sample/src/main/java/com/yalantis/phoenix/sample/RecyclerViewFragment.java index 490ad52..06d892b 100644 --- a/sample/src/main/java/com/yalantis/phoenix/sample/RecyclerViewFragment.java +++ b/sample/src/main/java/com/yalantis/phoenix/sample/RecyclerViewFragment.java @@ -1,13 +1,14 @@ package com.yalantis.phoenix.sample; import android.os.Bundle; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import com.yalantis.phoenix.PullToRefreshView; import java.util.Map; diff --git a/sample/src/main/res/layout/activity_pull_to_refresh.xml b/sample/src/main/res/layout/activity_pull_to_refresh.xml index 3035688..d0cec16 100644 --- a/sample/src/main/res/layout/activity_pull_to_refresh.xml +++ b/sample/src/main/res/layout/activity_pull_to_refresh.xml @@ -4,18 +4,18 @@ android:layout_height="match_parent" android:orientation="vertical"> - - - diff --git a/sample/src/main/res/layout/fragment_recycler_view.xml b/sample/src/main/res/layout/fragment_recycler_view.xml index cd9c85a..0bb4871 100644 --- a/sample/src/main/res/layout/fragment_recycler_view.xml +++ b/sample/src/main/res/layout/fragment_recycler_view.xml @@ -7,7 +7,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - Date: Thu, 22 Sep 2022 12:38:57 +0300 Subject: [PATCH 2/2] Update release version - Update release version - Update README.md --- README.md | 7 ++++++- gradle.properties | 4 ++-- library/build.gradle | 4 ++-- sample/build.gradle | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 08bdde7..c047253 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Check this [project on Behance] (https://www.behance.net/gallery/20411445/Mobile 1. Include the library as local library project. - ``` compile 'com.yalantis:phoenix:1.2.3' ``` + ``` implementation 'com.yalantis:phoenix:1.2.4' ``` 2. Include the PullToRefreshView widget in your layout. @@ -69,6 +69,11 @@ If you need to change progress state: # Changelog +### Version: 1.2.4 + + * Update dependencies + * Migrate to AndroidX + ### Version: 1.2 * Sample updated with RecyclerView example diff --git a/gradle.properties b/gradle.properties index 9908150..60a4b8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,8 +21,8 @@ android.useAndroidX=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official -VERSION_NAME=1.2.3 -VERSION_CODE=8 +VERSION_NAME=1.2.4 +VERSION_CODE=9 GROUP=com.yalantis POM_DESCRIPTION=Android Library to add beautiful Pull-to-Refresh widget diff --git a/library/build.gradle b/library/build.gradle index 2bec8b4..288500d 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 9 targetSdkVersion 33 - versionCode 8 - versionName "1.2.3" + versionCode 9 + versionName "1.2.4" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/sample/build.gradle b/sample/build.gradle index a1eab87..3a0a7b1 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.yalantis.phoenix.sample" minSdkVersion 14 targetSdkVersion 33 - versionCode 2 - versionName "2.0" + versionCode 3 + versionName "2.1" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8