Android-viewpagerindicator function does not introduce, want to see the click to see. Because not will not import, took a lot of time, now record, if just need, and just see, that reference.
1. Using MAVEN Import
1) Add the following code to the top-level build.gradle:
Buildscript {
repositories {
Maven {URL "Http://dl.bintray.com/populov/maven"}
Mavencentral ()
}
dependencies {
Classpath ' com.android.tools.build:gradle:0.12.+ '
}
}
allprojects {
repositories {
Maven {URL "Http://dl.bintray.com/populov/maven"}
Mavencentral ()
}
}
2) Add in your own app's Build.gradle
compile ' com.viewpagerindicator:library:2.4.1 '
Later you want to add a third-party library, only need to search in the http://search.maven.org/, and then add in the 2nd on the line.
2. Download the good source code and add the source code that has been downloaded:
#1 Download source code
#2 Import Existing Project, add (+ symbol), Project Structure, Android Studio project:file. K Just import the library folder instead of the entire project (leave the import options as Android Studio suggests).
# 3 Follow the steps set (SDK version), then next
# 4 Add dependency build.gradle dependencies compile Project ': library ' }
注意:如果你项目中已经存在了support-v4,你需要删除,因为添加的 Android-ViewPagerIndicator 会包含这个库。在一个工程中不能有两个这样的库(工程会共用库中的这个jar)。如果Android-ViewPagerIndicator Library 中的support-v4 不能满足你的要求,那只能用第2种方法,下载好后,把你要的support-v4替换Library文件夹中的,然后按步骤进行。
Android Studion using Android-viewpagerindicator