{"id":13645657,"url":"https://github.com/cStor-cDeep/RuleView","last_synced_at":"2025-04-21T14:32:01.808Z","repository":{"id":76720527,"uuid":"77465216","full_name":"cStor-cDeep/RuleView","owner":"cStor-cDeep","description":"Android自定义标尺控件(选择身高、体重等)","archived":false,"fork":false,"pushed_at":"2016-12-29T07:01:31.000Z","size":2749,"stargazers_count":178,"open_issues_count":1,"forks_count":46,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-08T17:59:00.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.jianshu.com/users/61f41588151d/latest_articles","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/cStor-cDeep.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-12-27T15:33:45.000Z","updated_at":"2024-12-25T12:28:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f99d419-b184-4acd-b54e-b3e76f2ded6c","html_url":"https://github.com/cStor-cDeep/RuleView","commit_stats":null,"previous_names":["panacena/ruleview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cStor-cDeep%2FRuleView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cStor-cDeep%2FRuleView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cStor-cDeep%2FRuleView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cStor-cDeep%2FRuleView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cStor-cDeep","download_url":"https://codeload.github.com/cStor-cDeep/RuleView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070250,"owners_count":21369842,"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:39.178Z","updated_at":"2025-04-21T14:32:00.991Z","avatar_url":"https://github.com/cStor-cDeep.png","language":"Java","readme":"# RuleView\n尺子刻度 --   自定义view\n###自定义view学习(第一章)\n\n***\n##### 1、自定义刻度尺控件\n    \n  在我们想要获取用户的身高体重等信息时，直接让他们输入显然不够友好偶然看到一款App用了类似刻度尺的界面让用户选择，觉得很赞。所有决定实现下。\n   实现的最终效果如下图所示:\n     \n![7c0d4213-1242-496b-9898-0d04d14f3097.gif](https://github.com/panacena/RuleView/blob/master/7c0d4213-1242-496b-9898-0d04d14f3097.gif)\n\n***\n#####2、使用方式\n\n######2.1 在gradle添加依赖\n```\ncompile 'com.zkk.view:ZkkRulerView:1.0.0'\n```\n######2.2 在xml中设置\n\n```\n\u003ccom.zkk.view.rulerview.RulerView\n\tandroid:id=\"@+id/ruler_height\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"58.0dip\"\n\tandroid:layout_marginTop=\"24.0dip\"\n\tapp:alphaEnable=\"true\"\n\tapp:lineColor=\"@color/gray\"\n\tapp:lineMaxHeight=\"40dp\"\n\tapp:lineMidHeight=\"30dp\"\n\tapp:lineMinHeight=\"20dp\"\n\tapp:lineSpaceWidth=\"10dp\"\n\tapp:lineWidth=\"2dip\"\n\tapp:textColor=\"@color/black\"\n\tapp:minValue=\"80.0\"\n\tapp:maxValue=\"250.0\"\n\tapp:perValue=\"1\"\n\tapp:selectorValue=\"165.0\"\n\t/\u003e\n```\n######2.3 在activity中只需调用一个方法和一个数值的回调\n```\n ruler_height=(RulerView)findViewById(R.id.ruler_height);\n ruler_weight.setOnValueChangeListener(new RulerView.OnValueChangeListener() {\n            @Override\n            public void onValueChange(float value) {\n                tv_register_info_weight_value.setText(value+\"\");\n            }\n        });\n\n/**\n     * \n     * @param selectorValue 未选择时 默认的值 滑动后表示当前中间指针正在指着的值\n     * @param minValue   最大数值\n     * @param maxValue   最小的数值\n     * @param per   最小单位  如 1:表示 每2条刻度差为1.   0.1:表示 每2条刻度差为0.1 在demo中 身高mPerValue为1  体重mPerValue 为0.1\n     */\nruler_weight.setValue(165, 80, 250, 1); \n```\n\n***\n##### 3、实现讲解\n   \n   博客地址：\n [http://www.jianshu.com/p/5d1fa50298b3](http://www.jianshu.com/p/5d1fa50298b3)\n\n\n","funding_links":[],"categories":["其他"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FcStor-cDeep%2FRuleView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FcStor-cDeep%2FRuleView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FcStor-cDeep%2FRuleView/lists"}