提供可以左右滑动的标尺控件,获取到用户选择的值,整个控件为纯绘制。
支持主题配置,提供一套默认主题。
支持所有绘制元素的自定义,可自定义元素
在你的build.gradle的dependencies中加入
dependencies {
implementation 'ke.tang:ruler:1.0.5'
}
```xml
<ke.tang.ruler.RulerView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
```
Java中直接使用RulerView类,详细用法以及接口功能,请查看Javadoc| 属性名 | 属性类型 | 说明 |
|---|---|---|
| stepWidth | dimension | 刻度之间的间距 |
| rulerValueFormatter | string | 用于格式化值的完整类名 |
| scaleColor | color|reference | 设置刻度颜色 |
| rulerColor | color|reference | 设置标尺颜色 |
| sectionScaleCount | integer | 刻度分组数量 |
| scaleMinHeight | dimension | 小刻度高度 |
| scaleMaxHeight | dimension | 大刻度高度 |
| scaleSize | dimension | 刻度宽度 |
| rulerSize | dimension | 标尺高度 |
| indicator | reference | 中间指示器 |
| maxValue | integer | 标尺最大值(范围0-10000) |
| minValue | integer | 标尺最小值(范围0-10000) |
| value | integer | 当前值(范围0-10000) |
| android:textSize | dimension | 文本尺寸 |
| android:textColor | color|reference | 文本颜色 |
Copyright 2018 TangKe
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.
$ claude mcp add Ruler \
-- python -m otcore.mcp_server <graph>