如何在android studio中导入ViewPagerIndicator?

时间:2016-10-08 15:24:24

标签: android android-viewpager viewpagerindicator

我想在我的应用中使用ViewPagerIndicator。所以我需要它的库。我找到了这两个要下载的链接,Link1Link2

但我不知道如何将其添加到我的项目中?

这是我的构建gradle文件:

apply plugin: 'com.android.application'

android {
    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
        maven { url "http://dl.bintray.com/populov/maven" }
        jcenter()
        mavenCentral()
    }
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "standup.maxsoft.com.standup"
        minSdkVersion 13
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile 'com.google.android.gms:play-services-ads:8.3.0'
    compile 'com.google.android.gms:play-services-identity:8.3.0'
    compile 'com.google.android.gms:play-services-gcm:8.3.0'
}

我只需复制libs.folder中的2个文件。你能帮我一步吗?感谢

2 个答案:

答案 0 :(得分:1)

您可以使用此依赖项(它是模拟的):

compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'

答案 1 :(得分:1)

我这样做:

  1. here
  2. 下载图书馆
  3. 将文件复制到Android studio的libs文件夹
  4. 在项目gradle.build中添加此行:compile project(':library-2.4.1')