From 86b54b168e0eb62b47a90fb567326663352a7338 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Wed, 12 Sep 2012 09:09:09 -0700 Subject: [PATCH 1/8] [maven-release-plugin] prepare for next development iteration --- library/pom.xml | 2 +- pom.xml | 2 +- sample/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/pom.xml b/library/pom.xml index 0360f9bae..7779729c7 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -10,7 +10,7 @@ com.viewpagerindicator parent - 2.4.1 + 2.4.2-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 2bc576408..8ccb567a1 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ com.viewpagerindicator parent pom - 2.4.1 + 2.4.2-SNAPSHOT Android-ViewPagerIndicator (Parent) Android library for. diff --git a/sample/pom.xml b/sample/pom.xml index 1d09ba1ac..54c235bf0 100644 --- a/sample/pom.xml +++ b/sample/pom.xml @@ -10,7 +10,7 @@ com.viewpagerindicator parent - 2.4.1 + 2.4.2-SNAPSHOT ../pom.xml From 423501ba12cdeec977317ce17d834b0a3ed665dd Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Sat, 6 Oct 2012 00:02:04 -0700 Subject: [PATCH 2/8] Add Travis config. --- .travis.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..a1ec39d7b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: java + +branches: + excludes: + - gh-pages + +notifications: + email: false + +before_install: + - wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz + - tar -zxf android-sdk_r20.0.3-linux.tgz + - export ANDROID_HOME=~/builds/JakeWharton/Android-ViewPagerIndicator/android-sdk-linux + - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools + - android update sdk --filter 1,3 --no-ui --force From d5bd4c862052fa540f127302a819fbbfc9cc3edd Mon Sep 17 00:00:00 2001 From: Aleksander Pyszny Date: Wed, 27 Jun 2012 12:37:12 +0200 Subject: [PATCH 3/8] removed android-support-v4.jar from apklib --- library/pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/pom.xml b/library/pom.xml index 0360f9bae..c75d3dbee 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -35,6 +35,9 @@ com.jayway.maven.plugins.android.generation2 android-maven-plugin true + + ignored + From 1d886b682a1e7bed2649ed8cd9355113cadb9f73 Mon Sep 17 00:00:00 2001 From: Aldryd Date: Wed, 19 Dec 2012 22:39:33 -0600 Subject: [PATCH 4/8] Adding a gap parameter to the CirclePageIndicator Allows for extra distance between the circles if desired --- library/res/values/vpi__attrs.xml | 2 ++ library/res/values/vpi__defaults.xml | 1 + .../viewpagerindicator/CirclePageIndicator.java | 16 ++++++++++++++-- sample/res/layout/themed_circles.xml | 1 + .../sample/SampleCirclesStyledMethods.java | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/library/res/values/vpi__attrs.xml b/library/res/values/vpi__attrs.xml index a4d1f1093..8b1ccdb92 100644 --- a/library/res/values/vpi__attrs.xml +++ b/library/res/values/vpi__attrs.xml @@ -47,6 +47,8 @@ + + diff --git a/library/res/values/vpi__defaults.xml b/library/res/values/vpi__defaults.xml index e4d44cbff..327959597 100644 --- a/library/res/values/vpi__defaults.xml +++ b/library/res/values/vpi__defaults.xml @@ -20,6 +20,7 @@ #00000000 0 3dp + 0dp false #FFDDDDDD 1dp diff --git a/library/src/com/viewpagerindicator/CirclePageIndicator.java b/library/src/com/viewpagerindicator/CirclePageIndicator.java index f441e89fd..4ef05aa3c 100644 --- a/library/src/com/viewpagerindicator/CirclePageIndicator.java +++ b/library/src/com/viewpagerindicator/CirclePageIndicator.java @@ -45,6 +45,7 @@ public class CirclePageIndicator extends View implements PageIndicator { private static final int INVALID_POINTER = -1; private float mRadius; + private float mGapWidth; private final Paint mPaintPageFill = new Paint(ANTI_ALIAS_FLAG); private final Paint mPaintStroke = new Paint(ANTI_ALIAS_FLAG); private final Paint mPaintFill = new Paint(ANTI_ALIAS_FLAG); @@ -84,6 +85,7 @@ public CirclePageIndicator(Context context, AttributeSet attrs, int defStyle) { final int defaultStrokeColor = res.getColor(R.color.default_circle_indicator_stroke_color); final float defaultStrokeWidth = res.getDimension(R.dimen.default_circle_indicator_stroke_width); final float defaultRadius = res.getDimension(R.dimen.default_circle_indicator_radius); + final float defaultGap = res.getDimension(R.dimen.default_circle_indicator_gap); final boolean defaultCentered = res.getBoolean(R.bool.default_circle_indicator_centered); final boolean defaultSnap = res.getBoolean(R.bool.default_circle_indicator_snap); @@ -100,6 +102,7 @@ public CirclePageIndicator(Context context, AttributeSet attrs, int defStyle) { mPaintFill.setStyle(Style.FILL); mPaintFill.setColor(a.getColor(R.styleable.CirclePageIndicator_fillColor, defaultFillColor)); mRadius = a.getDimension(R.styleable.CirclePageIndicator_radius, defaultRadius); + mGapWidth = a.getDimension(R.styleable.CirclePageIndicator_gap, defaultGap); mSnap = a.getBoolean(R.styleable.CirclePageIndicator_snap, defaultSnap); Drawable background = a.getDrawable(R.styleable.CirclePageIndicator_android_background); @@ -185,6 +188,15 @@ public float getRadius() { return mRadius; } + public void setGapWidth(float gap) { + mGapWidth = gap; + invalidate(); + } + + public float getGapWidth() { + return mGapWidth; + } + public void setSnap(boolean snap) { mSnap = snap; invalidate(); @@ -227,9 +239,9 @@ protected void onDraw(Canvas canvas) { shortPaddingBefore = getPaddingLeft(); } - final float threeRadius = mRadius * 3; + final float threeRadius = mRadius * 3 + mGapWidth; final float shortOffset = shortPaddingBefore + mRadius; - float longOffset = longPaddingBefore + mRadius; + float longOffset = longPaddingBefore + mRadius + mGapWidth; if (mCentered) { longOffset += ((longSize - longPaddingBefore - longPaddingAfter) / 2.0f) - ((count * threeRadius) / 2.0f); } diff --git a/sample/res/layout/themed_circles.xml b/sample/res/layout/themed_circles.xml index 5978db9f0..8e9229c76 100644 --- a/sample/res/layout/themed_circles.xml +++ b/sample/res/layout/themed_circles.xml @@ -34,6 +34,7 @@ android:layout_width="fill_parent" android:background="#FFCCCCCC" app:radius="10dp" + app:gap="15dp" app:fillColor="#FF888888" app:pageColor="#88FF0000" app:strokeColor="#FF000000" diff --git a/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java b/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java index 2ed8b05f4..d73a99c19 100644 --- a/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java +++ b/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java @@ -22,6 +22,7 @@ protected void onCreate(Bundle savedInstanceState) { final float density = getResources().getDisplayMetrics().density; indicator.setBackgroundColor(0xFFCCCCCC); indicator.setRadius(10 * density); + indicator.setGapWidth(15 * density); indicator.setPageColor(0x880000FF); indicator.setFillColor(0xFF888888); indicator.setStrokeColor(0xFF000000); From 33b75705586da25ae875deff53d1ebdaa59bfea5 Mon Sep 17 00:00:00 2001 From: Brock Atchison Date: Thu, 20 Dec 2012 16:35:26 -0600 Subject: [PATCH 5/8] Renaming mGapWidth to just mGap to avoid confusion with vertical orientation --- .../viewpagerindicator/CirclePageIndicator.java | 16 ++++++++-------- .../sample/SampleCirclesStyledMethods.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/library/src/com/viewpagerindicator/CirclePageIndicator.java b/library/src/com/viewpagerindicator/CirclePageIndicator.java index 4ef05aa3c..885daaa6a 100644 --- a/library/src/com/viewpagerindicator/CirclePageIndicator.java +++ b/library/src/com/viewpagerindicator/CirclePageIndicator.java @@ -45,7 +45,7 @@ public class CirclePageIndicator extends View implements PageIndicator { private static final int INVALID_POINTER = -1; private float mRadius; - private float mGapWidth; + private float mGap; private final Paint mPaintPageFill = new Paint(ANTI_ALIAS_FLAG); private final Paint mPaintStroke = new Paint(ANTI_ALIAS_FLAG); private final Paint mPaintFill = new Paint(ANTI_ALIAS_FLAG); @@ -102,7 +102,7 @@ public CirclePageIndicator(Context context, AttributeSet attrs, int defStyle) { mPaintFill.setStyle(Style.FILL); mPaintFill.setColor(a.getColor(R.styleable.CirclePageIndicator_fillColor, defaultFillColor)); mRadius = a.getDimension(R.styleable.CirclePageIndicator_radius, defaultRadius); - mGapWidth = a.getDimension(R.styleable.CirclePageIndicator_gap, defaultGap); + mGap = a.getDimension(R.styleable.CirclePageIndicator_gap, defaultGap); mSnap = a.getBoolean(R.styleable.CirclePageIndicator_snap, defaultSnap); Drawable background = a.getDrawable(R.styleable.CirclePageIndicator_android_background); @@ -188,13 +188,13 @@ public float getRadius() { return mRadius; } - public void setGapWidth(float gap) { - mGapWidth = gap; + public void setGap(float gap) { + mGap = gap; invalidate(); } - public float getGapWidth() { - return mGapWidth; + public float getGapSize() { + return mGap; } public void setSnap(boolean snap) { @@ -239,9 +239,9 @@ protected void onDraw(Canvas canvas) { shortPaddingBefore = getPaddingLeft(); } - final float threeRadius = mRadius * 3 + mGapWidth; + final float threeRadius = mRadius * 3 + mGap; final float shortOffset = shortPaddingBefore + mRadius; - float longOffset = longPaddingBefore + mRadius + mGapWidth; + float longOffset = longPaddingBefore + mRadius + mGap; if (mCentered) { longOffset += ((longSize - longPaddingBefore - longPaddingAfter) / 2.0f) - ((count * threeRadius) / 2.0f); } diff --git a/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java b/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java index d73a99c19..a4b25cce0 100644 --- a/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java +++ b/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java @@ -22,7 +22,7 @@ protected void onCreate(Bundle savedInstanceState) { final float density = getResources().getDisplayMetrics().density; indicator.setBackgroundColor(0xFFCCCCCC); indicator.setRadius(10 * density); - indicator.setGapWidth(15 * density); + indicator.setGap(15 * density); indicator.setPageColor(0x880000FF); indicator.setFillColor(0xFF888888); indicator.setStrokeColor(0xFF000000); From 04312723942392dd387dace850f26bfe669850a8 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Sat, 22 Dec 2012 15:48:33 -0600 Subject: [PATCH 6/8] Better travis config. --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1ec39d7b..f404d8db8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,11 @@ notifications: email: false before_install: - - wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz - - tar -zxf android-sdk_r20.0.3-linux.tgz + - wget http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz + - tar -zxf android-sdk_r21.0.1-linux.tgz - export ANDROID_HOME=~/builds/JakeWharton/Android-ViewPagerIndicator/android-sdk-linux - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools - - android update sdk --filter 1,3 --no-ui --force + - TOOLS=$(android list sdk --no-ui | grep "Android SDK Platform-tools" | cut -d"-" -f1) + - android update sdk --filter "$TOOLS" --no-ui --force + - SDK=$(android list sdk --no-ui | grep ", API 16," | cut -d"-" -f1) + - android update sdk --filter "$SDK" --no-ui --force From 6a30a5833f9c40267bce8fd220dd2fecedf24fb2 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Tue, 8 Jan 2013 08:50:27 -0800 Subject: [PATCH 7/8] Fix travis build. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f404d8db8..377eef0da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: java branches: - excludes: + except: - gh-pages notifications: From a35a79b57bdbd9081e6edebc10efcc6b347b9b89 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Mon, 14 Jan 2013 10:47:56 -0800 Subject: [PATCH 8/8] Maven pom updates. Convert to two spaces. --- library/pom.xml | 82 +++++------- pom.xml | 336 +++++++++++++++++++++++++----------------------- sample/pom.xml | 161 ++++++++++------------- 3 files changed, 274 insertions(+), 305 deletions(-) diff --git a/library/pom.xml b/library/pom.xml index 60bfcb8a4..9b8f314ee 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -1,60 +1,40 @@ - 4.0.0 + 4.0.0 - library - Android-ViewPagerIndicator - apklib + library + ViewPagerIndicator + apklib - - com.viewpagerindicator - parent - 2.4.2-SNAPSHOT - ../pom.xml - - - - - com.google.android - android - provided - + + com.viewpagerindicator + parent + 2.4.2-SNAPSHOT + ../pom.xml + - - com.google.android - support-v4 - - + + + com.google.android + android + provided + + + com.google.android + support-v4 + + - - src + + src - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - true - - ignored - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - ../checkstyle.xml - - - - verify - - checkstyle - - - - - - + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + true + + + diff --git a/pom.xml b/pom.xml index 8ccb567a1..146ebe175 100644 --- a/pom.xml +++ b/pom.xml @@ -1,167 +1,177 @@ - 4.0.0 - - - org.sonatype.oss - oss-parent - 7 - - - com.viewpagerindicator - parent - pom - 2.4.2-SNAPSHOT - - Android-ViewPagerIndicator (Parent) - Android library for. - https://github.com/JakeWharton/Android-ViewPagerIndicator - 2011 - - - library - sample - - - - http://github.com/JakeWharton/Android-ViewPagerIndicator/ - scm:git:git://github.com/JakeWharton/Android-ViewPagerIndicator.git - scm:git:git@github.com:JakeWharton/Android-ViewPagerIndicator.git - - - - - Jake Wharton - jakewharton@gmail.com - jakewharton - http://jakewharton.com - -5 - - developer - - - - - - - Apache License Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - Jake Wharton - http://jakewharton.com - - - - GitHub Issues - https://github.com/JakeWharton/Android-ViewPagerIndicator/issues - - - - UTF-8 - UTF-8 - - 1.6 - 4.1.1.4 - 16 - r7 - - 3.3.0 - - - - - - com.google.android - android - ${android.version} - - - - com.google.android - support-v4 - ${android.support.version} - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - ${java.version} - ${java.version} - - - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - ${android-maven.version} - - - ${android.platform} - - true - - true - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.6 - - true - - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.1 - - true - - - - - org.apache.maven.plugins - maven-eclipse-plugin - 2.9 - - - android:android - com.google.android.maps:maps - - bin - - com.android.ide.eclipse.adt.ANDROID_FRAMEWORK - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.ajdt.ui.ajnature - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - com.android.ide.eclipse.adt.PreCompilerBuilder - org.eclipse.jdt.core.javabuilder - com.android.ide.eclipse.adt.ApkBuilder - - false - - - - + 4.0.0 + + + org.sonatype.oss + oss-parent + 7 + + + com.viewpagerindicator + parent + pom + 2.4.2-SNAPSHOT + + ViewPagerIndicator (Parent) + Android library for. + https://github.com/JakeWharton/Android-ViewPagerIndicator + 2011 + + + library + sample + + + + http://github.com/JakeWharton/Android-ViewPagerIndicator/ + scm:git:git://github.com/JakeWharton/Android-ViewPagerIndicator.git + scm:git:git@github.com:JakeWharton/Android-ViewPagerIndicator.git + + + + + Jake Wharton + jakewharton@gmail.com + jakewharton + http://jakewharton.com + -5 + + developer + + + + + + + Apache License Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + Jake Wharton + http://jakewharton.com + + + + GitHub Issues + https://github.com/JakeWharton/Android-ViewPagerIndicator/issues + + + + UTF-8 + UTF-8 + + 1.6 + 4.1.1.4 + 16 + r7 + + 3.5.0 + + + + + + com.google.android + android + ${android.version} + + + + com.google.android + support-v4 + ${android.support.version} + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + ${java.version} + ${java.version} + + + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + ${android-maven.version} + + ignored + + ${android.platform} + + true + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.6 + + checkstyle.xml + true + true + + + + verify + + checkstyle + + + + + + + + + + org.apache.maven.plugins + maven-release-plugin + 2.1 + + true + + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.9 + + + android:android + com.google.android.maps:maps + + bin + + com.android.ide.eclipse.adt.ANDROID_FRAMEWORK + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.ajdt.ui.ajnature + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + com.android.ide.eclipse.adt.PreCompilerBuilder + org.eclipse.jdt.core.javabuilder + com.android.ide.eclipse.adt.ApkBuilder + + false + + + + diff --git a/sample/pom.xml b/sample/pom.xml index 54c235bf0..afb6c1df3 100644 --- a/sample/pom.xml +++ b/sample/pom.xml @@ -1,102 +1,81 @@ - 4.0.0 + 4.0.0 - sample - Android-ViewPagerIndicator Sample - apk + sample + ViewPagerIndicator Sample + apk - - com.viewpagerindicator - parent - 2.4.2-SNAPSHOT - ../pom.xml - + + com.viewpagerindicator + parent + 2.4.2-SNAPSHOT + ../pom.xml + - - - com.google.android - android - provided - + + + com.google.android + android + provided + - - com.google.android - support-v4 - + + ${project.groupId} + library + ${project.version} + apklib + + - - com.viewpagerindicator - library - ${project.version} - apklib - - + + src + ${project.artifactId}-unaligned - - src - ${project.artifactId}-unaligned + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + true + + + - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - true - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - ../checkstyle.xml - - - - verify - - checkstyle - - - - - - - - - - release - - - performRelease - true - - - - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - ${android-maven.version} - true - - - ${project.build.directory}/${project.build.finalName}.apk - ${project.build.directory}/${project.artifactId}.apk - - - - - alignApk - package - - zipalign - - - - - - - - + + + release + + + performRelease + true + + + + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + ${android-maven.version} + true + + + ${project.build.directory}/${project.build.finalName}.apk + ${project.build.directory}/${project.artifactId}.apk + + + + + alignApk + package + + zipalign + + + + + + + +