问题描述
谁能帮助我的build.gradle Android Studio中添加该库。
can anyone help me add this library in build.gradle Android Studio.
https://github.com/chrisbanes/Android-PullToRefresh
我知道这是pcated德$ P $,但我想用它,我会AP preciate如果有人可以帮助我
I know it is deprecated but I want to use it, I would appreciate if someone could help me
什么就写在
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:+'
compile '????'
}
提到我想用德precated库并不是新的动作条,Pulltorefresh。试图谷歌,但找不到任何帮助。
as mentioned I want to use the deprecated library not new Actionbar-Pulltorefresh. tried to google it but couldn't find any help.
推荐答案
我建议你使用ActionBarPullToRefresh(同一作者)。
I suggest you to use ActionBarPullToRefresh (same author).
不过,如果你想用PullToRefresh,你必须在本地克隆的lib文件夹中,然后将其添加为本地依赖性。这LIB不上中央Maven作为AAR。
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.
root
app
build.gradle
lib
pull
src
res
build.gradle
settings.gradle
在您应用程序/的build.gradle
您必须添加:
dependencies {
// Library
compile project(':lib:pull')
}
在LIB /拉/的build.gradle你必须把它定义为库,并指定正确的sourceset(这是一个要点):
In lib/pull/build.gradle you have to define it as library and specify the right sourceset (it is a gist):
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['aidl']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
在settings.gradle:
In settings.gradle:
include ':lib:pull' ,':app'
这篇关于Pulltorefresh添加到摇篮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!