Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start towards 1.0 API #92

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: android
jdk: oraclejdk7
jdk: oraclejdk8
android:
components:
- platform-tools
- tools
- build-tools-23.0.3
- android-23
- build-tools-25.0.0
- android-25

#Additional libs from Android
- extra-google-m2repository
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ The rangeseekbar-sample shows the available features and customizations in code

```groovy
dependencies {
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.4.0'
}
```

* For the latest work-in-progress snapshot:
(NOTE: Version 1.0 is making breaking API modifications and the API may continue to change until development has finished)

```groovy
dependencies {
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.4.0-SNAPSHOT'
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:1.0.0-SNAPSHOT'
}
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
# 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

VERSION_NAME=0.4.0
VERSION_CODE=004000
VERSION_NAME=1.0.0-SNAPSHOT
VERSION_CODE=100000
GROUP=org.florescu.android.rangeseekbar

SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu May 26 16:38:46 BST 2016
#Fri Nov 25 14:42:07 GMT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
9 changes: 5 additions & 4 deletions rangeseekbar-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ repositories {
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "org.florescu.android.rangeseekbar.sample"
minSdkVersion 15
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
Expand All @@ -26,6 +27,6 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:appcompat-v7:25.0.1'
compile project(':rangeseekbar')
}
3 changes: 2 additions & 1 deletion rangeseekbar-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
android:label="@string/app_name">
<activity
android:name=".DemoActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.app.Activity;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import org.florescu.android.rangeseekbar.RangeSeekBar;

Expand All @@ -35,11 +34,17 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.main);

// Setup the new range seek bar
RangeSeekBar<Integer> rangeSeekBar = new RangeSeekBar<>(this);
RangeSeekBar rangeSeekBar = new RangeSeekBar(this);
// Set the range
rangeSeekBar.setRangeValues(15, 90);
rangeSeekBar.setSelectedMinValue(20);
rangeSeekBar.setSelectedMaxValue(88);
rangeSeekBar.setTextFormatter(new RangeSeekBar.TextFormatter() {
@Override
public String formatValue(int value) {
return value + " kittens";
}
});

// Add to layout
FrameLayout layout = (FrameLayout) findViewById(R.id.seekbar_placeholder);
Expand All @@ -48,5 +53,15 @@ public void onCreate(Bundle savedInstanceState) {
// Seek bar for which we will set text color in code
RangeSeekBar rangeSeekBarTextColorWithCode = (RangeSeekBar) findViewById(R.id.rangeSeekBarTextColorWithCode);
rangeSeekBarTextColorWithCode.setTextAboveThumbsColorResource(android.R.color.holo_blue_bright);

// Seekbar with double values
RangeSeekBar rsbDoubles = (RangeSeekBar) findViewById(R.id.rsb_double_values);
rsbDoubles.setRangeValues(1523, 14835);
rsbDoubles.setTextFormatter(new RangeSeekBar.TextFormatter() {
@Override
public String formatValue(int value) {
return "£" + value / 100d;
}
});
}
}
18 changes: 14 additions & 4 deletions rangeseekbar-sample/src/main/res/layout/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"

android:padding="8dp">

<TextView
Expand All @@ -27,6 +28,7 @@
android:text="Range seek bar from xml with default range"/>

<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_default_range"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

Expand All @@ -37,6 +39,7 @@


<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_set_range"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
Expand All @@ -49,23 +52,24 @@


<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_range_step"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
rsb:absoluteMinValue="20"
rsb:step="10" />


<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Range seek bar from xml with ranges set and double values"/>
android:text="Range seek bar with double values" />


<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_double_values"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="140.54"
rsb:absoluteMinValue="15.23"/>
android:layout_height="wrap_content" />

<TextView
android:layout_width="match_parent"
Expand All @@ -74,6 +78,7 @@


<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_single_thumb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
Expand All @@ -86,6 +91,7 @@
android:text="Range seek bar from xml with custom color to text above thumbs "/>

<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_custom_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
Expand Down Expand Up @@ -113,6 +119,7 @@


<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_custom_handle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
Expand All @@ -130,6 +137,7 @@


<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_no_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
Expand All @@ -145,6 +153,7 @@
/>

<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_shadow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
Expand All @@ -163,6 +172,7 @@
/>

<org.florescu.android.rangeseekbar.RangeSeekBar
android:id="@+id/rsb_custom_shadow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
rsb:absoluteMaxValue="150"
Expand Down
4 changes: 1 addition & 3 deletions rangeseekbar-sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
</style>

</resources>
34 changes: 12 additions & 22 deletions rangeseekbar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
minSdkVersion 15
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -27,21 +17,21 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android.sourceSets.test.java.srcDirs += "build/generated/source/r/debug"
}

dependencies {
repositories {
mavenCentral()
}

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-annotations:23.4.0'
compile 'com.android.support:support-compat:25.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'

// Robolectric
testCompile 'org.robolectric:robolectric:3.1-rc1'
testCompile "org.mockito:mockito-core:2.0.53-beta"
testCompile 'org.robolectric:robolectric:3.1.4'
testCompile "org.mockito:mockito-core:2.2.23"
testCompile 'junit:junit:4.12'
testCompile('com.squareup.assertj:assertj-android:1.1.1') {
exclude group: 'com.android.support', module: 'support-annotations'
}

}

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