Skip to content

Commit

Permalink
Merge pull request #17 from yahoo/aar
Browse files Browse the repository at this point in the history
Changes for publishing
  • Loading branch information
anothem committed May 31, 2015
2 parents 629befc + d07ab0e commit 1ac0794
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,4 +7,4 @@ android:
- android-21

script:
- ./gradlew clean assembleDebug test
- ./gradlew clean build
18 changes: 17 additions & 1 deletion gradle.properties
Expand Up @@ -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
# 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

7 changes: 6 additions & 1 deletion 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
Expand All @@ -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'
}
4 changes: 4 additions & 0 deletions rangeseekbar-sample/gradle.properties
@@ -0,0 +1,4 @@
POM_NAME=Android RangeSeekBar Sample
POM_ARTIFACT_ID=rangeseekbar-sample
POM_PACKAGING=aar

Expand Up @@ -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 {

Expand Down
12 changes: 8 additions & 4 deletions rangeseekbar-sample/src/main/res/layout/main.xml
Expand Up @@ -24,7 +24,8 @@
android:text="Range seek bar from xml with default range"
/>

<com.yahoo.mobile.client.android.util.RangeSeekBar android:layout_width="fill_parent"
<com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

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

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

<com.yahoo.mobile.client.android.util.RangeSeekBar android:layout_width="fill_parent"
<com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
rsb:absoluteMinValue="15.23"
rsb:absoluteMaxValue="140.54"
Expand All @@ -57,7 +60,8 @@
android:text="Range seek bar from xml with single thumb to true"
/>

<com.yahoo.mobile.client.android.util.RangeSeekBar android:layout_width="fill_parent"
<com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
rsb:absoluteMinValue="20"
rsb:absoluteMaxValue="150"
Expand Down
30 changes: 4 additions & 26 deletions rangeseekbar/build.gradle
Expand Up @@ -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'
}
}

Expand Down Expand Up @@ -40,28 +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'
4 changes: 4 additions & 0 deletions rangeseekbar/gradle.properties
@@ -0,0 +1,4 @@
POM_NAME=Android RangeSeekBar Library
POM_ARTIFACT_ID=rangeseekbar-library
POM_PACKAGING=aar

6 changes: 1 addition & 5 deletions rangeseekbar/src/main/AndroidManifest.xml
@@ -1,8 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yahoo.mobile.client.android.util">

<application android:allowBackup="true" android:label="@string/app_name">

</application>
package="com.yahoo.mobile.client.android.util.rangeseekbar">

</manifest>
Expand Up @@ -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;
Expand All @@ -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.<br />
* <br />
* The range value types can be one of Long, Double, Integer, Float, Short, Byte or BigDecimal.<br>
* <br>
* Improved {@link android.view.MotionEvent} handling for smoother use, anti-aliased painting for improved aesthetics.
*
* @param <T> The Number type of the range values. One of Long, Double, Integer, Float, Short, Byte or BigDecimal.
* <p/>
* <p/>
* <p/>
* https://code.google.com/p/range-seek-bar/
* <p/>
* Apache License
* <p/>
* <p/>
* @author Stephan Tittel (stephan.tittel@kom.tu-darmstadt.de)
* @author Peter Sinnott (psinnott@gmail.com)
* @author Thomas Barrasso (tbarrasso@sevenplusandroid.org)
Expand Down Expand Up @@ -78,7 +73,7 @@ public class RangeSeekBar<T extends Number> extends ImageView {
private boolean notifyWhileDragging = false;
private OnRangeSeekBarChangeListener<T> 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);
/**
Expand Down
@@ -1,25 +1,25 @@
package com.yahoo.mobile.client.android.util;

package com.yahoo.mobile.client.android.util.rangeseekbar;

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<Long> mSeekBar = new RangeSeekBar<Long>(Robolectric.application);
RangeSeekBar<Long> mSeekBar = new RangeSeekBar<>(RuntimeEnvironment.application);
// Set up the seek bar
mSeekBar.setRangeValues(0L, 100L);
long minValue = mSeekBar.getAbsoluteMinValue();
Assert.assertEquals(0L, minValue);
long maxValue = mSeekBar.getAbsoluteMaxValue();
Assert.assertEquals(100L, maxValue);
}

}

0 comments on commit 1ac0794

Please sign in to comment.