diff --git a/.idea/gradle.xml b/.idea/gradle.xml index cd2ead8..a1299e5 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -10,12 +10,14 @@ diff --git a/.idea/modules.xml b/.idea/modules.xml index edfdfc6..3efe563 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -4,6 +4,7 @@ + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 4530bd7..a0980b2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,8 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) + compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.1.1' + compile project(':bannerlibrary') } diff --git a/app/src/main/java/com/github/wanglu1209/banner/demo/AdapterDemo.java b/app/src/main/java/com/github/wanglu1209/banner/demo/AdapterDemo.java index 7717f6e..7204a5d 100644 --- a/app/src/main/java/com/github/wanglu1209/banner/demo/AdapterDemo.java +++ b/app/src/main/java/com/github/wanglu1209/banner/demo/AdapterDemo.java @@ -5,8 +5,8 @@ import android.view.View; import android.widget.ImageView; -import com.github.wanglu1209.banner.BannerPagerAdapter; import com.github.wanglu1209.banner.R; +import com.github.wanglu1209.bannerlibrary.BannerPagerAdapter; import java.util.List; diff --git a/app/src/main/java/com/github/wanglu1209/banner/demo/MainActivity.java b/app/src/main/java/com/github/wanglu1209/banner/demo/MainActivity.java index 4cd1b40..6b90a41 100644 --- a/app/src/main/java/com/github/wanglu1209/banner/demo/MainActivity.java +++ b/app/src/main/java/com/github/wanglu1209/banner/demo/MainActivity.java @@ -4,9 +4,9 @@ import android.support.v7.app.AppCompatActivity; import android.widget.Toast; -import com.github.wanglu1209.banner.Banner; -import com.github.wanglu1209.banner.BannerPagerAdapter; import com.github.wanglu1209.banner.R; +import com.github.wanglu1209.bannerlibrary.Banner; +import com.github.wanglu1209.bannerlibrary.BannerPagerAdapter; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 78c621a..605ed63 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,8 +6,8 @@ tools:context=".demo.MainActivity"> - + android:layout_height="200dp"> diff --git a/bannerlibrary/.gitignore b/bannerlibrary/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/bannerlibrary/.gitignore @@ -0,0 +1 @@ +/build diff --git a/bannerlibrary/build.gradle b/bannerlibrary/build.gradle new file mode 100644 index 0000000..4ba234e --- /dev/null +++ b/bannerlibrary/build.gradle @@ -0,0 +1,25 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 24 + buildToolsVersion "24.0.1" + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 24 + 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.android.support:appcompat-v7:24.1.1' +} diff --git a/bannerlibrary/proguard-rules.pro b/bannerlibrary/proguard-rules.pro new file mode 100644 index 0000000..942a0af --- /dev/null +++ b/bannerlibrary/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/WangLu/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/bannerlibrary/src/androidTest/java/com/github/wanglu1209/bannerlibrary/ApplicationTest.java b/bannerlibrary/src/androidTest/java/com/github/wanglu1209/bannerlibrary/ApplicationTest.java new file mode 100644 index 0000000..4255daa --- /dev/null +++ b/bannerlibrary/src/androidTest/java/com/github/wanglu1209/bannerlibrary/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.github.wanglu1209.bannerlibrary; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/bannerlibrary/src/main/AndroidManifest.xml b/bannerlibrary/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7351134 --- /dev/null +++ b/bannerlibrary/src/main/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/app/src/main/java/com/github/wanglu1209/banner/Banner.java b/bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/Banner.java similarity index 99% rename from app/src/main/java/com/github/wanglu1209/banner/Banner.java rename to bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/Banner.java index efaece6..eaeff47 100644 --- a/app/src/main/java/com/github/wanglu1209/banner/Banner.java +++ b/bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/Banner.java @@ -1,4 +1,4 @@ -package com.github.wanglu1209.banner; +package com.github.wanglu1209.bannerlibrary; import android.content.Context; import android.support.v4.view.ViewPager; diff --git a/app/src/main/java/com/github/wanglu1209/banner/BannerPagerAdapter.java b/bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/BannerPagerAdapter.java similarity index 98% rename from app/src/main/java/com/github/wanglu1209/banner/BannerPagerAdapter.java rename to bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/BannerPagerAdapter.java index efe5de6..1d37a89 100644 --- a/app/src/main/java/com/github/wanglu1209/banner/BannerPagerAdapter.java +++ b/bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/BannerPagerAdapter.java @@ -1,4 +1,4 @@ -package com.github.wanglu1209.banner; +package com.github.wanglu1209.bannerlibrary; import android.content.Context; import android.support.v4.view.PagerAdapter; diff --git a/app/src/main/java/com/github/wanglu1209/banner/BannerViewPager.java b/bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/BannerViewPager.java similarity index 97% rename from app/src/main/java/com/github/wanglu1209/banner/BannerViewPager.java rename to bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/BannerViewPager.java index dea7ae4..4a54ddf 100644 --- a/app/src/main/java/com/github/wanglu1209/banner/BannerViewPager.java +++ b/bannerlibrary/src/main/java/com/github/wanglu1209/bannerlibrary/BannerViewPager.java @@ -1,4 +1,4 @@ -package com.github.wanglu1209.banner; +package com.github.wanglu1209.bannerlibrary; import android.content.Context; import android.os.Handler; diff --git a/bannerlibrary/src/main/res/values/strings.xml b/bannerlibrary/src/main/res/values/strings.xml new file mode 100644 index 0000000..fd7665e --- /dev/null +++ b/bannerlibrary/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + BannerLibrary + diff --git a/bannerlibrary/src/test/java/com/github/wanglu1209/bannerlibrary/ExampleUnitTest.java b/bannerlibrary/src/test/java/com/github/wanglu1209/bannerlibrary/ExampleUnitTest.java new file mode 100644 index 0000000..86982c8 --- /dev/null +++ b/bannerlibrary/src/test/java/com/github/wanglu1209/bannerlibrary/ExampleUnitTest.java @@ -0,0 +1,15 @@ +package com.github.wanglu1209.bannerlibrary; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * To work on unit tests, switch the Test Artifact in the Build Variants view. + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() throws Exception { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e7b4def..e20afa0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app' +include ':app', ':bannerlibrary'