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

add top and below feature for tick mark text. #81

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
72b6369
minor change.
farhadhesari Jan 17, 2019
3026fcf
add new features.
farhadhesari Jan 17, 2019
30c40ea
upgrade version.
farhadhesari Jan 17, 2019
4a513b6
Update README.md
farhadhesari Jan 17, 2019
86a44af
Update README.md
farhadhesari Jan 17, 2019
e39596b
Update README.md
farhadhesari Jan 17, 2019
5060e26
Update README.md
farhadhesari Jan 17, 2019
ee6a4d0
Update README.md
farhadhesari Jan 17, 2019
b20dd72
Update README.md
farhadhesari Jan 17, 2019
4242a7a
Update README.md
farhadhesari Jan 17, 2019
f4e6a44
Update README.md
farhadhesari Jan 17, 2019
f8f592b
add screen shot of the new feature.
farhadhesari Jan 17, 2019
5dbcc29
Delete Screenshot_2019-01-17-17-44-07.jpg
farhadhesari Jan 17, 2019
42d7e42
Screen shot of the new feature.
farhadhesari Jan 17, 2019
22ff8cd
Update README.md
farhadhesari Jan 17, 2019
3b548de
Update README.md
farhadhesari Jan 17, 2019
879e891
Update README.md
farhadhesari Jan 17, 2019
0ae8ac1
add OneTouchMode to single seekBarMode.
farhadhesari Jan 21, 2019
62c21cc
upgrade version.
farhadhesari Jan 21, 2019
e7fbd30
Merge branch 'master' into master
farhadhesari Jan 21, 2019
cc73f32
Update README.md
farhadhesari Jan 21, 2019
ed3b123
Update README.md
farhadhesari Jan 21, 2019
2c60424
add attrs isOneTouchMode for using in xml file.
farhadhesari Jan 21, 2019
74c164c
Merge remote-tracking branch 'origin/master'
farhadhesari Jan 21, 2019
a1e208d
upgrade version.
farhadhesari Jan 21, 2019
48e22d8
minor fix in licenses.
farhadhesari Jan 21, 2019
c6f8810
minor fix
farhadhesari Jan 21, 2019
2a04b19
minor fix
farhadhesari Jan 21, 2019
15e1983
minor fix.
farhadhesari Jan 21, 2019
8668b90
minor fix.
farhadhesari Jan 21, 2019
d572d05
Revert "minor fix."
farhadhesari Jan 22, 2019
51ece6d
Update README.md
farhadhesari Jan 22, 2019
41e1fb8
Update README.md
farhadhesari Jan 22, 2019
6484ed3
Update README.md
farhadhesari Jan 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Gif/Screenshot_2019-01-17-17-44-07.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 60 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@

## [文档还是中文好](https://github.com/Jay-Goo/RangeSeekBar/blob/master/README_ZH.md)

`Release Version` [![](https://jitpack.io/v/Jay-Goo/RangeSeekBar.svg)](https://jitpack.io/#Jay-Goo/RangeSeekBar)

<div>
<img src="https://github.com/Jay-Goo/RangeSeekBar/blob/master/Gif/demo.gif" height="500px" ><img src="https://github.com/Jay-Goo/RangeSeekBar/blob/master/Gif/vertical_demo.gif" height="500px">
<img src="https://github.com/Jay-Goo/RangeSeekBar/blob/master/Gif/demo.gif" height="500px" ><img src="https://github.com/Jay-Goo/RangeSeekBar/blob/master/Gif/vertical_demo.gif" height="500px"><img src="https://github.com/fa-hessari/RangeSeekBar/blob/master/Gif/Screenshot_2019-01-17-17-44-07.jpg" height="500px">
</div>


# Attention

**RangeSeekBar v2.x is coming!!!**
**New feature 1/21/2019 !!!**

Add oneTouchMode for single seekbarMode.No need to drag thumb,just move it by one touch.

**New feature 1/17/2019 !!!**

**The v2.x's API has a very different from v1.x because I rebuilt the project. I strongly suggest you to use v2.x because it has more powerful functions. If you still want to use v1.x, please to see** [RangeSeekBar v1.x Guide](https://github.com/Jay-Goo/RangeSeekBar/blob/master/README_RETIRED.md)
Add tick mark text on the top and below of the progress bar.

## Usage

### Dependencies

[![](https://jitpack.io/v/fa-hessari/RangeSeekBar.svg)](https://jitpack.io/#fa-hessari/RangeSeekBar)

```xml
allprojects {
repositories {
Expand All @@ -30,8 +34,7 @@
}

dependencies {
// sample: implementation 'com.github.Jay-Goo:RangeSeekBar:v2.0.4'
implementation 'com.github.Jay-Goo:RangeSeekBar:Release Version'
implementation 'com.github.fa-hessari:RangeSeekBar:TAG'
}

```
Expand All @@ -46,6 +49,23 @@
/>
```

## New Features
**Use these attrs for the new features:**

in xml use:
```
app:rsb_tick_mark_is_from_first_item="false"
app:rsb_tick_mark_is_top_and_below="true"
app:rsb_tick_mark_is_one_touch_mode="true"
```

or in code use:
```
rangeSeekBar.setTickMarkTopAndBelow(true, false);
rangeSeekBar.setOneTouchMode(true);
```


### VerticalRangeSeekBar
```
<com.jaygoo.widget.VerticalRangeSeekBar
Expand All @@ -58,6 +78,39 @@
`VerticalRangeSeekBar` rotates `RangeSeekBar` 90 degrees, and its attribute usage is same as `RangeSeekBar` .The only difference is the
`rsb_orientation`, it controls the direction of rotation.

### Example For New Features
```
<com.jaygoo.widget.RangeSeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="10dp"
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
app:rsb_indicator_height="20dp"
app:rsb_indicator_padding_left="20dp"
app:rsb_indicator_padding_right="20dp"
app:rsb_indicator_text_size="12sp"
app:rsb_mode="single"
app:rsb_progress_color="#28369f"
app:rsb_progress_default_color=#28369f"
app:rsb_progress_height="4dp"
app:rsb_thumb_drawable="@drawable/shape_circle"
app:rsb_thumb_size="30dp"
app:rsb_tick_mark_gravity="center"
app:rsb_tick_mark_is_from_first_item="false"
app:rsb_tick_mark_is_one_touch_mode="true"
app:rsb_tick_mark_is_top_and_below="true"
app:rsb_tick_mark_mode="other"
app:rsb_tick_mark_text_array="@array/my_array"
app:rsb_tick_mark_text_margin="20dp"
app:rsb_tick_mark_text_size="14sp"
/>
```

## Attributes
If you want to know more attributes's usage , please to see [attrs](https://github.com/Jay-Goo/RangeSeekBar/blob/master/RangeSeekBar/src/main/res/values/attrs.xml)

Expand Down
64 changes: 31 additions & 33 deletions RangeSeekBar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,61 +1,59 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group='com.github.Jay-Goo'
group = 'com.github.Jay-Goo'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion


defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion '28.0.2'


defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "com.android.support:appcompat-v7:$buildToolsVersion"
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "com.android.support:appcompat-v7:$buildToolsVersion"
}

// 指定编码
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.encoding = "UTF-8"
}

// 打包源码
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

// 制作文档(Javadoc)
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
archives sourcesJar
archives javadocJar
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -14,13 +13,11 @@
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
@RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest {
@Test public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.jaygoo.widget.test", appContext.getPackageName());
}
assertEquals("com.jaygoo.widget.test", appContext.getPackageName());
}
}
15 changes: 7 additions & 8 deletions RangeSeekBar/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jaygoo.widget">

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

</application>
package="com.jaygoo.widget">

<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* ================================================
*/
public interface OnRangeChangedListener {
void onRangeChanged(RangeSeekBar view, float leftValue, float rightValue, boolean isFromUser);
void onRangeChanged(RangeSeekBar view, float leftValue, float rightValue, boolean isFromUser);

void onStartTrackingTouch(RangeSeekBar view, boolean isLeft);
void onStartTrackingTouch(RangeSeekBar view, boolean isLeft);

void onStopTrackingTouch(RangeSeekBar view, boolean isLeft);
void onStopTrackingTouch(RangeSeekBar view, boolean isLeft);
}
Loading