Giter Club home page Giter Club logo

rangebar_test's Introduction

RangeBar_Test

项目中主要用来做音频打标签和AB复读功能

img

Examples

Layout XML

 <com.lygit.rangebar.RangeBar
            android:id="@+id/rangebar"
            android:layout_width="match_parent"
            android:layout_height="72dp"
            custom:tickStart="0"
            custom:tickInterval="1"
            custom:tickEnd="20"
            custom:temporaryPins="false"
            custom:pinMaxFont="10sp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            />

Adding a rangebar listener

  • Add a listener - rangeBar.setOnRangeBarChangeListener which returns left and right index as well as value.
rangebar.setOnRangeBarChangeListener(new RangeBar.OnRangeBarChangeListener() {
            @Override
            public void onRangeChangeListener(RangeBar rangeBar, int leftPinIndex,
                                              int rightPinIndex, String leftPinValue, String rightPinValue) {
            }

        });

Adding a text formatter

Formats the text inside the pin.

  • Add a formater - IRangeBarFormatter which will return the value of the current text inside of the pin
  • Transform string s into any string you want and return the newly formated string.
rangebar.setFormatter(new IRangeBarFormatter() {
            @Override
            public String format(String s) {
            // 格式化你想要展示的字符串,将会展示在滑块上
                return s;
            }
        });

How to Use

Method I

In your app build.gradle. Add the following lines

	dependencies {
	        implementation 'com.ly.design:RangeBarLib:1.0.1'
	}

Method II

In your project build.gradle. Add the following lines

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

In your app build.gradle. Add the following lines

	dependencies {
	        implementation 'com.github.luoyongVM:RangeBar_Test:v1.1.0'
	}

if you are already using android support library inside your project and run into multiple version issues related to android support library then modify the gradle path like this

dependencies {
    implementation ('com.github.luoyongVM:RangeBar_Test:Tag') {
            exclude module: 'support-compat'
    }
}

个人博客地址:https://blog.csdn.net/luoyong_blog

rangebar_test's People

Contributors

luoyongvm avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.