Skip to content

Commit 1ac0794

Browse files
committed
Merge pull request #17 from yahoo/aar
Changes for publishing
2 parents 629befc + d07ab0e commit 1ac0794

File tree

11 files changed

+60
-58
lines changed

11 files changed

+60
-58
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ android:
77
- android-21
88

99
script:
10-
- ./gradlew clean assembleDebug test
10+
- ./gradlew clean build

gradle.properties

+17-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,20 @@
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
# org.gradle.parallel=true
19+
20+
VERSION_NAME=0.1.0-SNAPSHOT
21+
VERSION_CODE=1
22+
GROUP=com.yahoo.mobile.client.android.util.rangeseekbar
23+
24+
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.
25+
POM_URL=https://github.com/yahoo/android-range-seek-bar
26+
POM_SCM_URL=https://github.com/yahoo/android-range-seek-bar
27+
POM_SCM_CONNECTION=scm:[email protected]:yahoo/android-range-seek-bar.git
28+
POM_SCM_DEV_CONNECTION=scm:[email protected]:yahoo/android-range-seek-bar.git
29+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
30+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
31+
POM_LICENCE_DIST=repo
32+
POM_DEVELOPER_ID=anothem
33+
POM_DEVELOPER_NAME=Alex Florescu
34+

rangeseekbar-sample/build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
apply plugin: 'com.android.application'
2+
repositories {
3+
maven {
4+
url "https://oss.sonatype.org/content/repositories/snapshots"
5+
}
6+
}
27

38
android {
49
compileSdkVersion 21
@@ -22,5 +27,5 @@ android {
2227
dependencies {
2328
compile fileTree(dir: 'libs', include: ['*.jar'])
2429
compile 'com.android.support:appcompat-v7:21.0.0'
25-
compile project(':rangeseekbar')
30+
compile 'com.yahoo.mobile.client.android.util.rangeseekbar:rangeseekbar-library:0.1.0-SNAPSHOT'
2631
}

rangeseekbar-sample/gradle.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
POM_NAME=Android RangeSeekBar Sample
2+
POM_ARTIFACT_ID=rangeseekbar-sample
3+
POM_PACKAGING=aar
4+

rangeseekbar-sample/src/main/java/com/yahoo/mobile/client/android/demo/DemoActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import android.app.Activity;
2020
import android.os.Bundle;
2121
import android.widget.LinearLayout;
22-
import com.yahoo.mobile.client.android.util.RangeSeekBar;
22+
import com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar;
2323

2424
public class DemoActivity extends Activity {
2525

rangeseekbar-sample/src/main/res/layout/main.xml

+8-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
android:text="Range seek bar from xml with default range"
2525
/>
2626

27-
<com.yahoo.mobile.client.android.util.RangeSeekBar android:layout_width="fill_parent"
27+
<com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
28+
android:layout_width="fill_parent"
2829
android:layout_height="wrap_content"/>
2930

3031
<TextView
@@ -33,7 +34,8 @@
3334
android:text="Range seek bar from xml with ranges set"
3435
/>
3536

36-
<com.yahoo.mobile.client.android.util.RangeSeekBar android:layout_width="fill_parent"
37+
<com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
38+
android:layout_width="fill_parent"
3739
android:layout_height="wrap_content"
3840
rsb:absoluteMinValue="20"
3941
rsb:absoluteMaxValue="150"
@@ -45,7 +47,8 @@
4547
android:text="Range seek bar from xml with ranges set and double values"
4648
/>
4749

48-
<com.yahoo.mobile.client.android.util.RangeSeekBar android:layout_width="fill_parent"
50+
<com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
51+
android:layout_width="fill_parent"
4952
android:layout_height="wrap_content"
5053
rsb:absoluteMinValue="15.23"
5154
rsb:absoluteMaxValue="140.54"
@@ -57,7 +60,8 @@
5760
android:text="Range seek bar from xml with single thumb to true"
5861
/>
5962

60-
<com.yahoo.mobile.client.android.util.RangeSeekBar android:layout_width="fill_parent"
63+
<com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
64+
android:layout_width="fill_parent"
6165
android:layout_height="wrap_content"
6266
rsb:absoluteMinValue="20"
6367
rsb:absoluteMaxValue="150"

rangeseekbar/build.gradle

+4-26
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ buildscript {
44
}
55

66
dependencies {
7-
classpath 'com.android.tools.build:gradle:1.1.0'
8-
classpath 'com.github.jcandksolutions.gradle:android-unit-test:2.1.1'
7+
classpath 'com.android.tools.build:gradle:1.2.3'
98
}
109
}
1110

@@ -40,28 +39,7 @@ dependencies {
4039
compile 'com.android.support:appcompat-v7:21.0.3'
4140

4241
// Robolectric
43-
testCompile 'junit:junit:4.12'
44-
testCompile 'org.hamcrest:hamcrest-core:1.1'
45-
testCompile 'org.hamcrest:hamcrest-library:1.1'
46-
testCompile 'org.hamcrest:hamcrest-integration:1.1'
47-
48-
// TODO: requires special build of robolectric right now. working on this...
49-
testCompile('org.robolectric:robolectric:2.4') {
50-
exclude module: 'classworlds'
51-
exclude module: 'commons-logging'
52-
exclude module: 'httpclient'
53-
exclude module: 'maven-artifact'
54-
exclude module: 'maven-artifact-manager'
55-
exclude module: 'maven-error-diagnostics'
56-
exclude module: 'maven-model'
57-
exclude module: 'maven-project'
58-
exclude module: 'maven-settings'
59-
exclude module: 'plexus-container-default'
60-
exclude module: 'plexus-interpolation'
61-
exclude module: 'plexus-utils'
62-
exclude module: 'wagon-file'
63-
exclude module: 'wagon-http-lightweight'
64-
exclude module: 'wagon-provider-api'
65-
}
66-
}
42+
testCompile 'org.robolectric:robolectric:3.0+'
43+
testCompile "org.mockito:mockito-core:1.9.5"}
6744

45+
apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

rangeseekbar/gradle.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
POM_NAME=Android RangeSeekBar Library
2+
POM_ARTIFACT_ID=rangeseekbar-library
3+
POM_PACKAGING=aar
4+
+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.yahoo.mobile.client.android.util">
3-
4-
<application android:allowBackup="true" android:label="@string/app_name">
5-
6-
</application>
2+
package="com.yahoo.mobile.client.android.util.rangeseekbar">
73

84
</manifest>

rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/RangeSeekBar.java rangeseekbar/src/main/java/com/yahoo/mobile/client/android/util/rangeseekbar/RangeSeekBar.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package com.yahoo.mobile.client.android.util;
17+
package com.yahoo.mobile.client.android.util.rangeseekbar;
1818

1919
import android.content.Context;
2020
import android.content.res.TypedArray;
@@ -27,23 +27,18 @@
2727
import android.view.MotionEvent;
2828
import android.view.ViewConfiguration;
2929
import android.widget.ImageView;
30+
31+
import com.yahoo.mobile.client.android.util.PixelUtil;
32+
3033
import java.math.BigDecimal;
3134

3235
/**
3336
* Widget that lets users select a minimum and maximum value on a given numerical range.
34-
* The range value types can be one of Long, Double, Integer, Float, Short, Byte or BigDecimal.<br />
35-
* <br />
37+
* The range value types can be one of Long, Double, Integer, Float, Short, Byte or BigDecimal.<br>
38+
* <br>
3639
* Improved {@link android.view.MotionEvent} handling for smoother use, anti-aliased painting for improved aesthetics.
3740
*
3841
* @param <T> The Number type of the range values. One of Long, Double, Integer, Float, Short, Byte or BigDecimal.
39-
* <p/>
40-
* <p/>
41-
* <p/>
42-
* https://code.google.com/p/range-seek-bar/
43-
* <p/>
44-
* Apache License
45-
* <p/>
46-
* <p/>
4742
* @author Stephan Tittel ([email protected])
4843
* @author Peter Sinnott ([email protected])
4944
* @author Thomas Barrasso ([email protected])
@@ -78,7 +73,7 @@ public class RangeSeekBar<T extends Number> extends ImageView {
7873
private boolean notifyWhileDragging = false;
7974
private OnRangeSeekBarChangeListener<T> listener;
8075
/**
81-
* Default color of a {@link com.yahoo.mobile.client.android.util.RangeSeekBar}, #FF33B5E5. This is also known as "Ice Cream Sandwich" blue.
76+
* Default color of a {@link RangeSeekBar}, #FF33B5E5. This is also known as "Ice Cream Sandwich" blue.
8277
*/
8378
public static final int DEFAULT_COLOR = Color.argb(0xFF, 0x33, 0xB5, 0xE5);
8479
/**
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
package com.yahoo.mobile.client.android.util;
2-
1+
package com.yahoo.mobile.client.android.util.rangeseekbar;
32

43
import org.junit.Assert;
54
import org.junit.Test;
65
import org.junit.runner.RunWith;
7-
import org.robolectric.Robolectric;
8-
import org.robolectric.RobolectricTestRunner;
6+
import org.robolectric.RobolectricGradleTestRunner;
7+
import org.robolectric.RuntimeEnvironment;
98
import org.robolectric.annotation.Config;
109

11-
@Config(emulateSdk = 18)
12-
@RunWith(RobolectricTestRunner.class)
10+
@RunWith(RobolectricGradleTestRunner.class)
11+
@Config(constants = BuildConfig.class, sdk = 21)
1312
public class RangeSeekBarTest {
1413

1514
@Test
1615
public void rsb_should_handle_long_values() {
17-
RangeSeekBar<Long> mSeekBar = new RangeSeekBar<Long>(Robolectric.application);
16+
RangeSeekBar<Long> mSeekBar = new RangeSeekBar<>(RuntimeEnvironment.application);
1817
// Set up the seek bar
1918
mSeekBar.setRangeValues(0L, 100L);
2019
long minValue = mSeekBar.getAbsoluteMinValue();
2120
Assert.assertEquals(0L, minValue);
2221
long maxValue = mSeekBar.getAbsoluteMaxValue();
2322
Assert.assertEquals(100L, maxValue);
2423
}
24+
2525
}

0 commit comments

Comments
 (0)