This repository has been archived by the owner on Jan 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from yahoo/aar
Changes for publishing
- Loading branch information
Showing
11 changed files
with
60 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ android: | |
- android-21 | ||
|
||
script: | ||
- ./gradlew clean assembleDebug test | ||
- ./gradlew clean build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[email protected]:yahoo/android-range-seek-bar.git | ||
POM_SCM_DEV_CONNECTION=scm:[email protected]: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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
POM_NAME=Android RangeSeekBar Sample | ||
POM_ARTIFACT_ID=rangeseekbar-sample | ||
POM_PACKAGING=aar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
POM_NAME=Android RangeSeekBar Library | ||
POM_ARTIFACT_ID=rangeseekbar-library | ||
POM_PACKAGING=aar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.<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 ([email protected]) | ||
* @author Peter Sinnott ([email protected]) | ||
* @author Thomas Barrasso ([email protected]) | ||
|
@@ -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); | ||
/** | ||
|
14 changes: 7 additions & 7 deletions
14
...client/android/util/RangeSeekBarTest.java → ...d/util/rangeseekbar/RangeSeekBarTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
} |