{"id":13645408,"url":"https://github.com/Brioal/RangeSeekBar","last_synced_at":"2025-04-21T14:30:44.582Z","repository":{"id":106170505,"uuid":"68262438","full_name":"Brioal/RangeSeekBar","owner":"Brioal","description":"定值范围选择控件","archived":false,"fork":false,"pushed_at":"2016-09-15T09:01:11.000Z","size":269,"stargazers_count":43,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-09T18:42:20.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brioal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-15T03:05:04.000Z","updated_at":"2024-09-25T07:24:11.000Z","dependencies_parsed_at":"2023-06-15T22:00:37.270Z","dependency_job_id":null,"html_url":"https://github.com/Brioal/RangeSeekBar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brioal%2FRangeSeekBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brioal%2FRangeSeekBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brioal%2FRangeSeekBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brioal%2FRangeSeekBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brioal","download_url":"https://codeload.github.com/Brioal/RangeSeekBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070173,"owners_count":21369839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:02:34.630Z","updated_at":"2025-04-21T14:30:44.301Z","avatar_url":"https://github.com/Brioal.png","language":"Java","funding_links":[],"categories":["SeekBar"],"sub_categories":[],"readme":"##定值范围选择控件\n##效果演示:\n![](https://github.com/Brioal/RangeSeekBar/blob/master/art/1.gif)\n##添加依赖库的步骤\n###1.项目的gradle文件内的做以下改动\n```\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url \"https://jitpack.io\" }\n\t\t}\n\t}\n```\n###2.添加最新版本的依赖库,最新版本如右所示,修改末尾的版本即可(因为我有时候更新版本了会忘记修改readme)[![](https://jitpack.io/v/Brioal/BrioalSetting.svg)](https://jitpack.io/#Brioal/BrioalSetting)\n```\ndependencies {\n\t        compile 'com.github.Brioal:RangeSeekBar:1.0'\n\t        ////例如上面最新版本是1.1,则只要把1.0改成1.1即可使用最新版本\n\t}\n```\n##使用步骤:\n###1.xml布局文件\n####实际使用过程中发现如果与其他组件在一起,则滑动事件会实效,暂时没发现代码里面怎么解决,设置focus啥的都没用,暂时的解决办法是给组件添加一个父布局并且不包含其他组件即可,如下:\n```\n \u003cLinearLayout\n        android:id=\"@+id/layout\"\nandroid:layout_centerInParent=\"true\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\u003e\n        \u003ccom.brioal.rangeseek.view.RangeBar\n            android:id=\"@+id/main_container\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\"/\u003e\n\n    \u003c/LinearLayout\u003e\n```\n###2.代码设置\n```\n  mRangeBar = (RangeBar) findViewById(R.id.main_container);\n\t      //添加数据源\n        final List\u003cRangeEntity\u003e list = new ArrayList\u003c\u003e();\n        //要显示的文字和实际的值,分别是String 和 Object类型\n        list.add(new RangeEntity(\"15℃\", 15));\n        list.add(new RangeEntity(\"18℃\", 18));\n        list.add(new RangeEntity(\"21℃\", 21));\n        list.add(new RangeEntity(\"24℃\", 24));\n        list.add(new RangeEntity(\"27℃\", 27));\n        list.add(new RangeEntity(\"30℃\", 30));\n        //设置数据源\n        mRangeBar.setValues(list);\n        //添加范围改变监听器\n        mRangeBar.addOnRangeChangedListener(new OnRangeChangedListener() {\n            @Override\n            public void selected(int startIndex, int endIndex) {\n            //获取到的是起始和终止的数据在List中所对应的下标\n                mTvMin.setText(list.get(startIndex).getValue() + \"\");\n                mTvMax.setText(list.get(endIndex).getValue() + \"\");\n            }\n        });\n```\n###3.提供的供自定义视图的方法\n方法|功能\n:--|:--\n`void addOnRangeChangedListener(OnRangeChangedListener listener)`|设置事件监听器\n`void setLineColor(int lineColor)`|设置中间的线条颜色\n`void setLineWidth(int lineWidth)`|设置中间的线条宽度\n`void setCircleColor(int circleColor)`|设置圆点的边框颜色\n`void setCircleRadius(int circleRadius)`|设置圆点的半径\n`void setCircleWidth(int circleWidth)`|设置圆点的线条宽度\n`void setCenterColor(int centerColor)`|设置选中的圆点的填充颜色\n`void setPointColor(int pointColor)`|设置游标的填充颜色\n`void setStartIndex(int startIndex)`|设置选中的起始下标\n`int getStartIndex()`|获取选中的起始下标\n`void setEndIndex(int endIndex)`|设置终止下标\n`int getEndIndex()`|获取终止的下标\n\n####完毕~\n####写在后面\n####1.我的其他的一些开源库,有兴趣的可以点进去看看给个star啥的\n####[多达288种动画效果定制的侧滑菜单库](https://github.com/Brioal/SwipeMenuDemo)\n####[仿京东首页垂直跑马灯组件](https://github.com/Brioal/ADTextView)\n####[仿360底部菜单布局](https://github.com/Brioal/BottomTabLayout)\n####[快速搭建设置界面开源库](https://github.com/Brioal/BrioalSetting)\n####[仿知乎首页轮播组件](https://github.com/Brioal/Banner)\n####[流式布局,封装用于显示标签](https://github.com/Brioal/Label)\n\n####2.建了个交流Android开发的QQ群,欢迎新手老手:群号:375276053\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBrioal%2FRangeSeekBar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBrioal%2FRangeSeekBar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBrioal%2FRangeSeekBar/lists"}