From 650d2d1cb3b889e15fcfa17edb1fa359b899b551 Mon Sep 17 00:00:00 2001 From: Alex Florescu Date: Sun, 24 May 2015 19:06:22 +0100 Subject: [PATCH 1/4] Changes for publishing --- gradle.properties | 18 +++++++++++++++++- rangeseekbar-sample/gradle.properties | 4 ++++ .../client/android/demo/DemoActivity.java | 2 +- .../src/main/res/layout/main.xml | 12 ++++++++---- rangeseekbar/build.gradle | 1 + rangeseekbar/gradle.properties | 4 ++++ rangeseekbar/src/main/AndroidManifest.xml | 2 +- .../util/{ => rangeseekbar}/RangeSeekBar.java | 19 +++++++------------ .../{ => rangeseekbar}/RangeSeekBarTest.java | 3 +-- 9 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 rangeseekbar-sample/gradle.properties create mode 100644 rangeseekbar/gradle.properties rename rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/{ => rangeseekbar}/RangeSeekBar.java (98%) rename rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/{ => rangeseekbar}/RangeSeekBarTest.java (92%) diff --git a/gradle.properties b/gradle.properties index 1d3591c..1636123 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,20 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true + +VERSION_NAME=0.1.0-SNAPSHOT +VERSION_CODE=1 +GROUP=com.yahoo.mobile.client.android.util.rangeseekbar + +POM_DESCRIPTION=A SeekBar similar to the default Android one, but with two thumb controls allowing a range to be selected, and some other extras as well. +POM_URL=https://github.com/yahoo/android-range-seek-bar +POM_SCM_URL=https://github.com/yahoo/android-range-seek-bar +POM_SCM_CONNECTION=scm:git@github.com:yahoo/android-range-seek-bar.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:yahoo/android-range-seek-bar.git +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=anothem +POM_DEVELOPER_NAME=Alex Florescu + diff --git a/rangeseekbar-sample/gradle.properties b/rangeseekbar-sample/gradle.properties new file mode 100644 index 0000000..8c12409 --- /dev/null +++ b/rangeseekbar-sample/gradle.properties @@ -0,0 +1,4 @@ +POM_NAME=Android RangeSeekBar Sample +POM_ARTIFACT_ID=rangeseekbar-sample +POM_PACKAGING=aar + diff --git a/rangeseekbar-sample/src/main/java/com/yahoo/mobile/client/android/demo/DemoActivity.java b/rangeseekbar-sample/src/main/java/com/yahoo/mobile/client/android/demo/DemoActivity.java index 81de87a..abb8f66 100644 --- a/rangeseekbar-sample/src/main/java/com/yahoo/mobile/client/android/demo/DemoActivity.java +++ b/rangeseekbar-sample/src/main/java/com/yahoo/mobile/client/android/demo/DemoActivity.java @@ -19,7 +19,7 @@ import android.app.Activity; import android.os.Bundle; import android.widget.LinearLayout; -import com.yahoo.mobile.client.android.util.RangeSeekBar; +import com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar; public class DemoActivity extends Activity { diff --git a/rangeseekbar-sample/src/main/res/layout/main.xml b/rangeseekbar-sample/src/main/res/layout/main.xml index 6e2b72d..0143cb3 100644 --- a/rangeseekbar-sample/src/main/res/layout/main.xml +++ b/rangeseekbar-sample/src/main/res/layout/main.xml @@ -24,7 +24,8 @@ android:text="Range seek bar from xml with default range" /> - - - - + package="com.yahoo.mobile.client.android.util.rangeseekbar"> diff --git a/rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/RangeSeekBar.java b/rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBar.java similarity index 98% rename from rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/RangeSeekBar.java rename to rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBar.java index e0a6905..e18e1a2 100644 --- a/rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/RangeSeekBar.java +++ b/rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBar.java @@ -14,7 +14,7 @@ limitations under the License. */ -package com.yahoo.mobile.client.android.util; +package com.yahoo.mobile.client.android.util.rangeseekbar; import android.content.Context; import android.content.res.TypedArray; @@ -27,23 +27,18 @@ import android.view.MotionEvent; import android.view.ViewConfiguration; import android.widget.ImageView; + +import com.yahoo.mobile.client.android.util.PixelUtil; + import java.math.BigDecimal; /** * Widget that lets users select a minimum and maximum value on a given numerical range. - * The range value types can be one of Long, Double, Integer, Float, Short, Byte or BigDecimal.
- *
+ * The range value types can be one of Long, Double, Integer, Float, Short, Byte or BigDecimal.
+ *
* Improved {@link android.view.MotionEvent} handling for smoother use, anti-aliased painting for improved aesthetics. * * @param The Number type of the range values. One of Long, Double, Integer, Float, Short, Byte or BigDecimal. - *

- *

- *

- * https://code.google.com/p/range-seek-bar/ - *

- * Apache License - *

- *

* @author Stephan Tittel (stephan.tittel@kom.tu-darmstadt.de) * @author Peter Sinnott (psinnott@gmail.com) * @author Thomas Barrasso (tbarrasso@sevenplusandroid.org) @@ -78,7 +73,7 @@ public class RangeSeekBar extends ImageView { private boolean notifyWhileDragging = false; private OnRangeSeekBarChangeListener listener; /** - * Default color of a {@link com.yahoo.mobile.client.android.util.RangeSeekBar}, #FF33B5E5. This is also known as "Ice Cream Sandwich" blue. + * Default color of a {@link RangeSeekBar}, #FF33B5E5. This is also known as "Ice Cream Sandwich" blue. */ public static final int DEFAULT_COLOR = Color.argb(0xFF, 0x33, 0xB5, 0xE5); /** diff --git a/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/RangeSeekBarTest.java b/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBarTest.java similarity index 92% rename from rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/RangeSeekBarTest.java rename to rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBarTest.java index ca837aa..0ec6edd 100644 --- a/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/RangeSeekBarTest.java +++ b/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBarTest.java @@ -1,5 +1,4 @@ -package com.yahoo.mobile.client.android.util; - +package com.yahoo.mobile.client.android.util.rangeseekbar; import org.junit.Assert; import org.junit.Test; From 5be7068e6e184954229da64c87a3ec2aaeed03d4 Mon Sep 17 00:00:00 2001 From: Alex Florescu Date: Sun, 31 May 2015 15:25:03 +0100 Subject: [PATCH 2/4] Sample uses snapshot --- rangeseekbar-sample/build.gradle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rangeseekbar-sample/build.gradle b/rangeseekbar-sample/build.gradle index 64de496..b2c80f9 100644 --- a/rangeseekbar-sample/build.gradle +++ b/rangeseekbar-sample/build.gradle @@ -1,4 +1,9 @@ apply plugin: 'com.android.application' +repositories { + maven { + url "https://oss.sonatype.org/content/repositories/snapshots" + } +} android { compileSdkVersion 21 @@ -22,5 +27,5 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.0' - compile project(':rangeseekbar') + compile 'com.yahoo.mobile.client.android.util.rangeseekbar:rangeseekbar-library:0.1.0-SNAPSHOT' } From b907ca81bb04ea396ea718c304179aea57af338b Mon Sep 17 00:00:00 2001 From: Alex Florescu Date: Sun, 31 May 2015 16:06:25 +0100 Subject: [PATCH 3/4] Update test dependencies --- rangeseekbar/build.gradle | 29 ++----------------- rangeseekbar/src/main/AndroidManifest.xml | 4 --- .../util/rangeseekbar/RangeSeekBarTest.java | 11 +++---- 3 files changed, 9 insertions(+), 35 deletions(-) diff --git a/rangeseekbar/build.gradle b/rangeseekbar/build.gradle index 7ba4ca3..be4ebac 100644 --- a/rangeseekbar/build.gradle +++ b/rangeseekbar/build.gradle @@ -4,8 +4,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:1.1.0' - classpath 'com.github.jcandksolutions.gradle:android-unit-test:2.1.1' + classpath 'com.android.tools.build:gradle:1.2.3' } } @@ -40,29 +39,7 @@ dependencies { compile 'com.android.support:appcompat-v7:21.0.3' // Robolectric - testCompile 'junit:junit:4.12' - testCompile 'org.hamcrest:hamcrest-core:1.1' - testCompile 'org.hamcrest:hamcrest-library:1.1' - testCompile 'org.hamcrest:hamcrest-integration:1.1' - - // TODO: requires special build of robolectric right now. working on this... - testCompile('org.robolectric:robolectric:2.4') { - exclude module: 'classworlds' - exclude module: 'commons-logging' - exclude module: 'httpclient' - exclude module: 'maven-artifact' - exclude module: 'maven-artifact-manager' - exclude module: 'maven-error-diagnostics' - exclude module: 'maven-model' - exclude module: 'maven-project' - exclude module: 'maven-settings' - exclude module: 'plexus-container-default' - exclude module: 'plexus-interpolation' - exclude module: 'plexus-utils' - exclude module: 'wagon-file' - exclude module: 'wagon-http-lightweight' - exclude module: 'wagon-provider-api' - } -} + testCompile 'org.robolectric:robolectric:3.0+' + testCompile "org.mockito:mockito-core:1.9.5"} apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' \ No newline at end of file diff --git a/rangeseekbar/src/main/AndroidManifest.xml b/rangeseekbar/src/main/AndroidManifest.xml index 40f9bcd..749252c 100644 --- a/rangeseekbar/src/main/AndroidManifest.xml +++ b/rangeseekbar/src/main/AndroidManifest.xml @@ -1,8 +1,4 @@ - - - - diff --git a/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBarTest.java b/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBarTest.java index 0ec6edd..00cb765 100644 --- a/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBarTest.java +++ b/rangeseekbar/src/test/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBarTest.java @@ -3,17 +3,17 @@ import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.robolectric.Robolectric; -import org.robolectric.RobolectricTestRunner; +import org.robolectric.RobolectricGradleTestRunner; +import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; -@Config(emulateSdk = 18) -@RunWith(RobolectricTestRunner.class) +@RunWith(RobolectricGradleTestRunner.class) +@Config(constants = BuildConfig.class, sdk = 21) public class RangeSeekBarTest { @Test public void rsb_should_handle_long_values() { - RangeSeekBar mSeekBar = new RangeSeekBar(Robolectric.application); + RangeSeekBar mSeekBar = new RangeSeekBar<>(RuntimeEnvironment.application); // Set up the seek bar mSeekBar.setRangeValues(0L, 100L); long minValue = mSeekBar.getAbsoluteMinValue(); @@ -21,4 +21,5 @@ public void rsb_should_handle_long_values() { long maxValue = mSeekBar.getAbsoluteMaxValue(); Assert.assertEquals(100L, maxValue); } + } \ No newline at end of file From d07ab0ef70311803e4105bf0082c667befbbaa82 Mon Sep 17 00:00:00 2001 From: Alex Florescu Date: Sun, 31 May 2015 16:08:33 +0100 Subject: [PATCH 4/4] new build tasks --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eb19546..640d5bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,4 @@ android: - android-21 script: - - ./gradlew clean assembleDebug test \ No newline at end of file + - ./gradlew clean build