Android studio import PullToRefresh

Android studio import PullToRefresh

First, the following method is to add an address for build.gradle no way dependent items such as columns users: compile project ( '*****')


1. First download PullToRefresh to github project

Address is: https://github.com/chrisbanes/Android-PullToRefresh

Decompress and find the library

2. Create a root directory of your project lib directory
[the PATH]
[App]
    [src]
    [RES]
    [Build]
    build.gradle
    ...
[Build]
[Gradle]
[lib]
    // named the library the same name pull
    [pull]
        [the src]
        [RES]
        [Build]
        ... 
the build.gradle
settings.gradle
...

3. Modify settings.gradle 

include ':app', ':lib:pull'

4. 修改 [app]/build.gradle
dependencies {
    // Library
    compile project(':lib:pull')
}

5. Create [lib] / [pull] /build.gradle
'Android-Library': the Apply plugin
Android {
    consistent compileSdkVersion 17 // only need third-party libraries into the next version of the compiler and build.gradle project It can be.
    buildToolsVersion "21.1.2" // This only needs to be consistent to change compiler version and projects under the third-party libraries build.gradle.
    {sourceSets
    main {
        manifest.srcFile 'the AndroidManifest.xml'
        java.srcDirs = [ 'the src']
        resources.srcDirs = [ 'the src']
        aidl.srcDirs = [ 'AIDL']
        renderscript.srcDirs = [ 'the src']
        RES. = srcDirs [ 'RES']
        assets.srcDirs = [ 'Assets']
    }
    }
}



Completed, the last do not forget Sync Now and Rebuild (Build -> Rebuild Project)


Published 40 original articles · won praise 19 · views 60000 +

Guess you like

Origin blog.csdn.net/u010090644/article/details/50128625