can anyone help me add this library in build.gradle Android Studio.
https://github.com/chrisbanes/Android-PullToRefresh
I know it is deprecated but I want to use it, I would appreciate if someone could help me
what to write in
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:+'
compile '????'
}
as mentioned I want to use the deprecated library not new Actionbar-Pulltorefresh. tried to google it but couldn't find any help.
Easiest way to add ActionBar-PullToRefresh to your project is via Gradle, you just need to add the following dependency to your
build.gradle
Rest gradle will do all work for you.
I suggest you to use ActionBarPullToRefresh (same author).
However, if you would like to use PullToRefresh, you have to clone the lib locally in a folder, and then add it as local dependency. This lib isn't on Central Maven as aar.
In you
app/build.gradle
you have to add:In lib/pull/build.gradle you have to define it as library and specify the right sourceset (it is a gist):
In settings.gradle:
I've succesfully imported the libproject in Android Studio 1.0. The steps are the following
1.- Download and install PullToRefresh from the official GitHub. Unzip it. 2.- Create an empty Android Studio project. Mine is named "PrjLibDeps" 3.- In project's root folder, create a folder named "libs". Inside libs/, copy a "pulltorefresh" folder containing the unzipped file. Structure remains as shown below:
4.- Create a build.gradle file inside "pulltorefresh" folder. Copy-paste this sample code and set proper values to compileSdkVersion, buildToolsVersion, minSdkVersion, targetSdkVersion (just copy them from app/build.gradle)
5.- on app/build.gradle
6.- Now, on project_root/settings.gradle:
7.- "Sync now" 8.- CMD+F9 (Make project)
Hope it helps! more detailed info in my blog