Coder Social home page Coder Social logo

rangebar's Introduction

Preview

效果图

Usage

    <com.dreamer.library.RangeBar
        android:id="@+id/rangeBar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        app:range_background="#8a8a8a"
        app:range_num="5"
        app:range_checked="1"
        app:thumb_color="#33475f"
        app:thumb_radius="10dp"
        app:vertical_line_height="5dp"
        app:vertical_line_width="5dp"
        app:horizontal_line_height="5dp"/>
 RangeBar mRangeBar = (RangeBar) findViewById(R.id.rangeBar);
        mRangeBar.setOnRangeBarListener(new RangeBar.OnRangeBarListener() {
            @Override
            public void onClick(int position) {
                // do something
            }
        });

Attributes

name format description default_value
range_background color RangeBar的背景颜色 #8a8a8a
range_num integer RangeBar中Range的数量 5
range_checked integer 默认选中的Range 0
thumb_color color RangeBar中thumb的背景颜色 #33475f
thumb_radius dimension RangeBar中thumb的半径 10
vertical_line_width dimension RangeBar中Range的竖线宽度 5
vertical_line_height dimension RangeBar中Range的竖线高度 5
horizontal_line_height dimension RangeBar的高度 5

Thanks for

  • 感谢大恒同学指点实现点击事件

License

   Copyright 2016 Dreamer

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

rangebar's People

Contributors

dreamfighting avatar yangshaoxiong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.