{"id":13395956,"url":"https://github.com/oli107/material-range-bar","last_synced_at":"2025-12-30T14:28:23.845Z","repository":{"id":21548386,"uuid":"24868009","full_name":"oli107/material-range-bar","owner":"oli107","description":"Android widget for selecting a range of values.","archived":false,"fork":true,"pushed_at":"2020-12-09T06:32:19.000Z","size":4973,"stargazers_count":1677,"open_issues_count":97,"forks_count":370,"subscribers_count":58,"default_branch":"master","last_synced_at":"2024-09-27T03:01:31.957Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"RyanTech/range-bar","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oli107.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-06T22:49:25.000Z","updated_at":"2024-09-25T10:51:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/oli107/material-range-bar","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oli107%2Fmaterial-range-bar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oli107%2Fmaterial-range-bar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oli107%2Fmaterial-range-bar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oli107%2Fmaterial-range-bar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oli107","download_url":"https://codeload.github.com/oli107/material-range-bar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234556429,"owners_count":18851950,"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-07-30T18:00:36.261Z","updated_at":"2025-09-28T20:30:43.731Z","avatar_url":"https://github.com/oli107.png","language":"Java","funding_links":[],"categories":["Index `(light-weight pages)`","Java","Index","Libs","\u003ca name=\"Widget\"\u003eWidget\u003c/a\u003e"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget","Personal Blog"],"readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MaterialRangeBar-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1272)\n\nMaterialRangeBar\n=======\nMaterialRangeBar is a fork from https://github.com/edmodo/range-bar that adds some basic material styling, as well as start and end values, values as floats and some other things. It is aiming to mimic this:\n\nhttp://www.google.com/design/spec/components/sliders.html\n\nIt is similar to an enhanced SeekBar widget, though it doesn't make use of the SeekBar. It provides for the selection of a range of values as well as for a single value. The selectable range values are discrete values designated by tick marks; the pin (handle) will snap to the nearest tick mark. This is my first library project, apologies for poor coding, etc etc.\n\nSupported on API Level 12 and above for animations.\n\n![Img](https://github.com/oli107/material-range-bar/blob/master/Screenshots/materialrangebar_demo.gif)\n\n### Change Log\n```\n1.4.8 - Added mrb_minThumbDistance for specifying distances between 2 thumbs. All the selector properties are renamed to thumb.\n1.4.7 - Fixed selector boundary cut-off issue\n1.4.6 - Added tick colors, Added Left,Right and Default Selector Color. Added Touch Started /Touch Ended events to Rangebar. Fixed rangebar so that it behaves correctly inside scrollview. Also fixed Selected Tick label color issue.\n1.4.5 - Added TOP and BOTTOM tick labels properties and drag only option. Also updated Gradle and screenshots.\n1.4.4 - Added List of colors for connecting line and fix pins invisibility issue.\n1.4.3 - Fixes an issue where you user was able to drag a thumb outside of the valid range of Rangebar.\n1.4.2 - Added option for rounding status Bar progress using mrb_rangeBar_rounded. Also Implemented seekbar to select the nearest tick, when clicked. Also Fixed Rangebar issue that was causing right pin to move left of left pin when both had same value.\n1.4.1 - Small Ui fixes\n1.4 - Added mrb_ prefix to all attributes. Also added mrb_selectorBoundaryColor and mrb_selectorBoundarySize attribute.  \n1.3 - Stopped pins appearing on initialisation when temporary. Margin correct even if pin radius = 0. PR to correct motion down\n1.2 - NPE fixed for movePin\n1.1 - Merged pull requests\n1.0 - Merged pull requests to fix range bar issues and issues in scrollview, promoted to 1.0 release due to few other PRs.\n0.1 - released onto Maven Central. Fixed color pickers in sample. Added ability to set pin color via XML and pin text color via XML or programatically\n0.0.1 - 0.0.7 - Initial releases.\n```\n\nDevelopers can customize the following attributes (both via XML and programatically)\n### Tick Properties\n```\nmrb_tickStart | float\nmrb_tickEnd | float\nmrb_tickInterval | float\nmrb_tickHeight | dimension\nmrb_tickDefaultColor | color\nmrb_tickColors  | reference (array of hex colors)\n```\n\n### Tick Label Properties\n```\nmrb_tickLabelColor | reference or color         // Unselected label color\nmrb_tickLabelSelectedColor | reference or color         // Selected Label Color\nmrb_tickTopLabels | reference (String array)\nmrb_tickBottomLabels | reference (String array)\nmrb_tickDefaultLabel | reference or string          // Used in cases when top/bottom labels are not equal to number of ticks\nmrb_tickLabelSize | dimension (sp)\n```\n\n###  Bar Properties\n```\nmrb_rangeBar | boolean\nmrb_barWeight | dimension\nmrb_rangeBarColor | reference or color\nmrb_rangeBarPaddingBottom | dimension\nmrb_rangeBar_rounded | boolean\nmrb_connectingLineWeight | dimension\nmrb_connectingLineColors | reference (array of hex colors)\nmrb_connectingLineColor | reference or color\nmrb_onlyOnDrag | boolean\n```\n\n### Pin Properties\n```\nmrb_pinPadding | dimension\nmrb_pinRadius | dimension\nmrb_pinMinFont | dimension\nmrb_pinMaxFont | dimension\nmrb_pinColor | reference or color\nmrb_pinTextColor | reference or color\nmrb_temporaryPins | boolean\n```\n\n### Thumb Properties\n```\nmrb_minThumbDistance | float or -1 for ignoring\nmrb_thumbSize | dimension\nmrb_thumbColor | reference or color\nmrb_leftThumbColor | reference or color\nmrb_rightThumbColor | reference or color\nmrb_thumbBoundaryColor | reference or color\nmrb_thumbBoundarySize | dimension\n```\n\n### Selector Properties (Deprecated \u0026 Replaced by Thumb Properties since version 1.4.8)\n```\nmrb_selectorColor | reference or color\nmrb_leftSelectorColor | reference or color\nmrb_rightSelectorColor | reference or color\nmrb_selectorSize | dimension\nmrb_selectorBoundaryColor | reference or color\nmrb_selectorBoundarySize | dimension\n```\n\n![ScreenShot](https://github.com/oli107/material-range-bar/blob/master/Screenshots/screenshot.png)\n\n\nExamples\n=======\n\n## Layout XML\n\nThis is a rangebar with both a lower and upper value\n```xml\n\n   \u003ccom.appyvet.materialrangebar.RangeBar\n        android:id=\"@+id/rangebar1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginStart=\"40dp\"\n        android:layout_marginEnd=\"40dp\"\n        app:mrb_barWeight=\"2dp\"\n        app:mrb_connectingLineColors=\"@array/connecting_colors\"\n        app:mrb_connectingLineWeight=\"4dp\"\n        app:mrb_leftThumbColor=\"#FFB300\"\n        app:mrb_minThumbDistance=\"-1\"\n        app:mrb_pinColor=\"#6c3f6a\"\n        app:mrb_pinMaxFont=\"15sp\"\n        app:mrb_pinMinFont=\"12sp\"\n        app:mrb_pinRadius=\"14dp\"\n        app:mrb_pinTextColor=\"@color/white\"\n        app:mrb_rangeBar=\"true\"\n        app:mrb_rangeBarPaddingBottom=\"30dp\"\n        app:mrb_rangeBar_rounded=\"true\"\n        app:mrb_rightThumbColor=\"#1E88E5\"\n        app:mrb_thumbBoundaryColor=\"@color/accent\"\n        app:mrb_thumbBoundarySize=\"2dp\"\n        app:mrb_thumbSize=\"10dp\"\n        app:mrb_temporaryPins=\"true\"\n        app:mrb_tickBottomLabels=\"@array/ticks_labels\"\n        app:mrb_tickColors=\"@array/tick_colors\"\n        app:mrb_tickDefaultColor=\"@color/indigo500\"\n        app:mrb_tickDefaultLabel=\"label\"\n        app:mrb_tickEnd=\"10\"\n        app:mrb_tickHeight=\"4dp\"\n        app:mrb_tickInterval=\"1\"\n        app:mrb_tickLabelColor=\"@color/indigo500\"\n        app:mrb_tickLabelSelectedColor=\"@color/accent\"\n        app:mrb_tickLabelSize=\"4sp\"\n        app:mrb_tickStart=\"1\"\n        app:mrb_tickTopLabels=\"@array/ticks_labels\" /\u003e\n```\n\nThis is a seekbar with only a single pin (note mrb_rangeBar=false)\n```xml\n\n   \u003ccom.appyvet.materialrangebar.RangeBar\n        android:id=\"@+id/rangebar1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginStart=\"40dp\"\n        android:layout_marginEnd=\"40dp\"\n        app:mrb_barWeight=\"2dp\"\n        app:mrb_connectingLineColors=\"@array/connecting_colors\"\n        app:mrb_connectingLineWeight=\"4dp\"\n        app:mrb_leftThumbColor=\"#FFB300\"\n        app:mrb_minThumbDistance=\"-1\"\n        app:mrb_pinColor=\"#6c3f6a\"\n        app:mrb_pinMaxFont=\"15sp\"\n        app:mrb_pinMinFont=\"12sp\"\n        app:mrb_pinRadius=\"14dp\"\n        app:mrb_pinTextColor=\"@color/white\"\n        app:mrb_rangeBar=\"false\"\n        app:mrb_rangeBarPaddingBottom=\"30dp\"\n        app:mrb_rangeBar_rounded=\"true\"\n        app:mrb_rightThumbColor=\"#1E88E5\"\n        app:mrb_thumbBoundaryColor=\"@color/accent\"\n        app:mrb_thumbBoundarySize=\"2dp\"\n        app:mrb_thumbSize=\"10dp\"\n        app:mrb_temporaryPins=\"true\"\n        app:mrb_tickBottomLabels=\"@array/ticks_labels\"\n        app:mrb_tickColors=\"@array/tick_colors\"\n        app:mrb_tickDefaultColor=\"@color/indigo500\"\n        app:mrb_tickDefaultLabel=\"label\"\n        app:mrb_tickEnd=\"10\"\n        app:mrb_tickHeight=\"4dp\"\n        app:mrb_tickInterval=\"1\"\n        app:mrb_tickLabelColor=\"@color/indigo500\"\n        app:mrb_tickLabelSelectedColor=\"@color/accent\"\n        app:mrb_tickLabelSize=\"4sp\"\n        app:mrb_tickStart=\"1\"\n        app:mrb_tickTopLabels=\"@array/ticks_labels\" /\u003e\n\n```\n\n## Adding a rangebar listener\n- Add a listener - rangeBar.setOnRangeBarChangeListener which returns left and right index as well as value.\n```java\n  rangebar.setOnRangeBarChangeListener(new RangeBar.OnRangeBarChangeListener() {\n            @Override\n            public void onRangeChangeListener(RangeBar rangeBar, int leftPinIndex, int rightPinIndex, String leftPinValue, String rightPinValue) {\n\n            }\n\n            @Override\n            public void onTouchEnded(RangeBar rangeBar) {\n\n            }\n\n            @Override\n            public void onTouchStarted(RangeBar rangeBar) {\n\n            }\n        });\n```\n## Adding a text formatter\nFormats the text inside the pin.\n- Add a formater - IRangeBarFormatter which will return the value of the current text inside of the pin\n- Transform string s into any string you want and return the newly formated string. \n```java\nrangebar.setFormatter(new IRangeBarFormatter() {\n            @Override\n            public String format(String s) {\n            // Transform the String s here then return s\n                return null;\n            }\n        });\n```\n\nPlan for Future\n=======\n- Better documentation.\n- Kotlin conversion\n\nDemo (Outdated)\n=======\n[Get it from the Google Play Store](https://play.google.com/store/apps/details?id=com.appyvet.rangebarsample)\n\n\nHow to Use\n=======\n\n**In your project build.gradle. Add the following lines**\n```groovy\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n```\n- Note: Don't put the above lines inside the buildscript block.\n\n**In your app build.gradle. Add the following lines**\n\n```groovy\ndependencies {\n    implementation 'com.appyvet:materialrangebar:1.4.8'\n}\n```\n\n\n**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**\n```groovy\ndependencies {\n    compile ('com.appyvet:materialrangebar:1.4.8') {\n            exclude module: 'support-compat'\n    }\n}\n```\n\nContribution\n=======\nWe don't have enough time to constantly answer the issues and handle updates. So we need all the help we can get.\nYou are always welcome to contribute and help us maintain the library.\nFor Moderator Access create an issue on Github and tag oli107.\n\nLicense\n=======\n\n    Copyright 2019  AppyVet, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foli107%2Fmaterial-range-bar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foli107%2Fmaterial-range-bar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foli107%2Fmaterial-range-bar/lists"}