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 dependencies to your app's Build.gradleDependencies{Compile Project(': library ')}
Note: If you already have support-v4 in the project, you need to remove it because the Android-viewpagerindicator added will contain this library. There can be no more than two such libraries in a project (the project will share this jar in the library). If the support-v4 in Android-viewpagerindicator Library can not meet your requirements, it can only be used in the 2nd way, after downloading, the support-v4 you want to replace the library folder, and then follow the steps.
Android Studion using Android-viewpagerindicator