diff --git a/.idea/libraries/support_v4_19_0_1.xml b/.idea/libraries/support_v4_19_0_1.xml
new file mode 100644
index 0000000..617c323
--- /dev/null
+++ b/.idea/libraries/support_v4_19_0_1.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/support_v4_19_1_0.xml b/.idea/libraries/support_v4_19_1_0.xml
deleted file mode 100644
index faa34d9..0000000
--- a/.idea/libraries/support_v4_19_1_0.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 7215f0d..17b9276 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,121 +1,38 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- localhost
- 5050
-
-
-
+
+
+
+
+
+
+
+
+
+ Android API 19 Platform
+
+
+
+
+
+
+
+
+
+
- Android API 14 Platform
diff --git a/GuideBackgroundColorAnimation.iml b/GuideBackgroundColorAnimation.iml
index d9c631d..edb62a6 100644
--- a/GuideBackgroundColorAnimation.iml
+++ b/GuideBackgroundColorAnimation.iml
@@ -4,7 +4,6 @@
-
diff --git a/build.gradle b/build.gradle
index 80eec1a..4c8f6d8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:0.9.+'
+ classpath 'com.android.tools.build:gradle:0.11.+'
}
}
diff --git a/build/intermediates/dex-cache/cache.xml b/build/intermediates/dex-cache/cache.xml
new file mode 100644
index 0000000..4f79200
--- /dev/null
+++ b/build/intermediates/dex-cache/cache.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/AndroidManifest.xml b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/AndroidManifest.xml
new file mode 100644
index 0000000..9da621d
--- /dev/null
+++ b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/AndroidManifest.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/R.txt b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/R.txt
new file mode 100644
index 0000000..7bb8821
--- /dev/null
+++ b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/R.txt
@@ -0,0 +1,7 @@
+int dimen activity_horizontal_margin 0x7f040000
+int dimen activity_vertical_margin 0x7f040001
+int drawable ic_launcher 0x7f020000
+int layout activity_main 0x7f030000
+int string action_settings 0x7f050000
+int string app_name 0x7f050001
+int string hello_world 0x7f050002
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/classes.jar b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/classes.jar
new file mode 100644
index 0000000..1bac51c
Binary files /dev/null and b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/classes.jar differ
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-hdpi-v4/ic_launcher.png b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-hdpi-v4/ic_launcher.png
new file mode 100644
index 0000000..96a442e
Binary files /dev/null and b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-hdpi-v4/ic_launcher.png differ
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-mdpi-v4/ic_launcher.png b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-mdpi-v4/ic_launcher.png
new file mode 100644
index 0000000..359047d
Binary files /dev/null and b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-mdpi-v4/ic_launcher.png differ
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-xhdpi-v4/ic_launcher.png b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-xhdpi-v4/ic_launcher.png
new file mode 100644
index 0000000..71c6d76
Binary files /dev/null and b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-xhdpi-v4/ic_launcher.png differ
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-xxhdpi-v4/ic_launcher.png b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-xxhdpi-v4/ic_launcher.png
new file mode 100644
index 0000000..4df1894
Binary files /dev/null and b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/drawable-xxhdpi-v4/ic_launcher.png differ
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/layout/activity_main.xml b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/layout/activity_main.xml
new file mode 100644
index 0000000..7daa235
--- /dev/null
+++ b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/layout/activity_main.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/values-w820dp-v13/values.xml b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/values-w820dp-v13/values.xml
new file mode 100644
index 0000000..6785051
--- /dev/null
+++ b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/values-w820dp-v13/values.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+ 64dp
+
+
diff --git a/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/values/values.xml b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/values/values.xml
new file mode 100644
index 0000000..07c8536
--- /dev/null
+++ b/build/intermediates/exploded-aar/GuideBackgroundColorAnimation/library/unspecified/res/values/values.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+ 16dp
+ 16dp
+
+
+
+ Settings
+ Library
+ Hello world!
+
+
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 5de946b..347fc24 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip
diff --git a/library/build.gradle b/library/build.gradle
index f4703d0..cc031e2 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'android-library'
android {
compileSdkVersion 19
- buildToolsVersion "19.0.3"
+ buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 14
@@ -21,6 +21,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:+'
-
}
diff --git a/library/library.iml b/library/library.iml
index 9d95f4a..07c28f0 100644
--- a/library/library.iml
+++ b/library/library.iml
@@ -23,19 +23,19 @@
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -57,21 +57,13 @@
-
-
-
-
-
-
-
-
-
-
+
+
-
+
diff --git a/library/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/library/ColorAnimationView.java b/library/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/library/ColorAnimationView.java
index 05bec1f..5de747f 100644
--- a/library/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/library/ColorAnimationView.java
+++ b/library/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/library/ColorAnimationView.java
@@ -20,25 +20,15 @@ public class ColorAnimationView
private static final int GREEN = 0xff80ff80;
private static final int DURATION = 3000;
ValueAnimator colorAnim = null;
- private ViewPager mViewPager;
+
private PageChangeListener mPageChangeListener;
- OnPageChangeListener onPageChangeListener;
+ ViewPager.OnPageChangeListener onPageChangeListener;
- public void setOnPageChangeListener(OnPageChangeListener onPageChangeListener) {
+ public void setOnPageChangeListener(ViewPager.OnPageChangeListener onPageChangeListener) {
this.onPageChangeListener = onPageChangeListener;
}
- /**
- * This is used by calling the default OnPageChangeListener for viewpager
- * */
- public static interface OnPageChangeListener{
- public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) ;
-
- public void onPageSelected(int position) ;
-
- public void onPageScrollStateChanged(int state) ;
- }
/**
@@ -51,24 +41,20 @@ public static interface OnPageChangeListener{
/**
* This is the only method you need care about.
* @param mViewPager ,you need set the adpater before you call this.
- * @param obj ,this is a Object implements the interface(ColorAnimationView.OnPageChangeListener)
- * so,you can call back.
* @param count ,this param set the count of the viewpaper's child
* @param colors ,this param set the change color use (int... colors),
* so,you could set any length if you want.And by default.
* if you set nothing , don't worry i have already creat
* a default good change color!
* */
- public void setmViewPager(ViewPager mViewPager,Object obj, int count, int... colors) {
- this.mViewPager = mViewPager;
+ public void setmViewPager(ViewPager mViewPager, int count, int... colors) {
+// this.mViewPager = mViewPager;
if (mViewPager.getAdapter() == null) {
throw new IllegalStateException(
"ViewPager does not have adapter instance.");
}
mPageChangeListener.setViewPagerChildCount(count);
- if(obj instanceof OnPageChangeListener){
- setOnPageChangeListener((OnPageChangeListener)obj);
- }
+
mViewPager.setOnPageChangeListener(mPageChangeListener);
if (colors.length == 0) {
createDefaultAnimation();
@@ -134,7 +120,7 @@ private void createDefaultAnimation() {
@Override public void onAnimationUpdate(ValueAnimator animation) {
invalidate();
- long playtime = colorAnim.getCurrentPlayTime();
+// long playtime = colorAnim.getCurrentPlayTime();
}
private class PageChangeListener
@@ -159,15 +145,22 @@ public int getViewPagerChildCount() {
ColorAnimationView.this.seek(progress);
}
// call the method by default
- onPageChangeListener.onPageScrolled(position,positionOffset,positionOffsetPixels);
+ if (onPageChangeListener!=null){
+ onPageChangeListener.onPageScrolled(position,positionOffset,positionOffsetPixels);
+ }
+
}
@Override public void onPageSelected(int position) {
- onPageChangeListener.onPageSelected(position);
+ if (onPageChangeListener!=null) {
+ onPageChangeListener.onPageSelected(position);
+ }
}
@Override public void onPageScrollStateChanged(int state) {
- onPageChangeListener.onPageScrollStateChanged(state);
+ if (onPageChangeListener!=null) {
+ onPageChangeListener.onPageScrollStateChanged(state);
+ }
}
}
}
diff --git a/sample/build.gradle b/sample/build.gradle
index dc5d62e..cecdf87 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'android'
android {
compileSdkVersion 19
- buildToolsVersion "19.0.3"
+ buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 14
diff --git a/sample/sample.iml b/sample/sample.iml
index ec07a65..d55b455 100644
--- a/sample/sample.iml
+++ b/sample/sample.iml
@@ -22,19 +22,19 @@
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -56,21 +56,12 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
diff --git a/sample/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/sample/SampleActivity.java b/sample/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/sample/SampleActivity.java
index b91df61..f4b6e57 100644
--- a/sample/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/sample/SampleActivity.java
+++ b/sample/src/main/java/cn/taurusxi/guidebackgroundcoloranimation/sample/SampleActivity.java
@@ -17,7 +17,7 @@
public class SampleActivity
extends FragmentActivity
- implements ColorAnimationView.OnPageChangeListener {
+ {
private static final int[] resource = new int[]{R.drawable.welcome1, R.drawable.welcome4,
R.drawable.welcome3, R.drawable.welcome4};
private static final String TAG = SampleActivity.class.getSimpleName();
@@ -45,28 +45,27 @@ protected void onCreate(Bundle savedInstanceState) {
* Third: If you call this method like below, make the colors no data, it will create
* a change color by default.
* */
- colorAnimationView.setmViewPager(viewPager, this, resource.length);
- // Four : Also ,you can call this method like this:
- // colorAnimationView.setmViewPager(viewPager,this,resource.length,0xffFF8080,0xff8080FF,0xffffffff,0xff80ff80);
- }
+ colorAnimationView.setmViewPager(viewPager, resource.length);
+ colorAnimationView.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+ Log.e("TAG","onPageScrolled");
+ }
- // 实现 OnPageChangeListener的回调方法
- //Implement OnPageChangeListener callback methods
- @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
- Log.e(TAG, "call onPageScrolled method");
- }
+ @Override
+ public void onPageSelected(int position) {
+ Log.e("TAG","onPageSelected");
+ }
- // 实现 OnPageChangeListener的回调方法
- //Implement OnPageChangeListener callback methods
- @Override public void onPageSelected(int position) {
- Log.e(TAG, "call onPageSelected method");
+ @Override
+ public void onPageScrollStateChanged(int state) {
+ Log.e("TAG","onPageScrollStateChanged");
+ }
+ });
+ // Four : Also ,you can call this method like this:
+ // colorAnimationView.setmViewPager(viewPager,this,resource.length,0xffFF8080,0xff8080FF,0xffffffff,0xff80ff80);
}
- // 实现 OnPageChangeListener的回调方法
- //Implement OnPageChangeListener callback methods
- @Override public void onPageScrollStateChanged(int state) {
- Log.e(TAG, "call onPageScrollStateChanged method");
- }
public class MyFragmentStatePager