{"id":15471688,"url":"https://github.com/getactivity/shapeview","last_synced_at":"2025-04-14T08:17:03.117Z","repository":{"id":37413817,"uuid":"386873948","full_name":"getActivity/ShapeView","owner":"getActivity","description":"Shape 支持在布局中直接定义啦，支持设置阴影，文字渐变色，状态选择器","archived":false,"fork":false,"pushed_at":"2025-03-06T07:15:19.000Z","size":20450,"stargazers_count":943,"open_issues_count":5,"forks_count":90,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-14T08:16:56.042Z","etag":null,"topics":["android","backgroundlibrary","button","edittext","recyclerview","shadowlayout","shape","shapebutton","shapeconstraintlayout","shapeedittext","shapeframelayout","shapeimageview","shapelinearlayout","shaperelativelayout","shapetextview","shapeview","supertextview","textview"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getActivity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://raw.githubusercontent.com/getActivity/Donate/master/picture/pay_ali.png"}},"created_at":"2021-07-17T07:52:36.000Z","updated_at":"2025-04-11T06:59:16.000Z","dependencies_parsed_at":"2024-07-14T08:27:49.460Z","dependency_job_id":"28000773-60c1-4585-b4e9-781e293cfb6d","html_url":"https://github.com/getActivity/ShapeView","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getActivity%2FShapeView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getActivity%2FShapeView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getActivity%2FShapeView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getActivity%2FShapeView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getActivity","download_url":"https://codeload.github.com/getActivity/ShapeView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248843999,"owners_count":21170499,"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":["android","backgroundlibrary","button","edittext","recyclerview","shadowlayout","shape","shapebutton","shapeconstraintlayout","shapeedittext","shapeframelayout","shapeimageview","shapelinearlayout","shaperelativelayout","shapetextview","shapeview","supertextview","textview"],"created_at":"2024-10-02T02:21:17.930Z","updated_at":"2025-04-14T08:17:03.054Z","avatar_url":"https://github.com/getActivity.png","language":"Java","readme":"# ShapeView 框架\n\n* 项目地址：[Github](https://github.com/getActivity/ShapeView)\n\n* 博客介绍：[震惊，没想到 Shape 也可以这么写](https://www.jianshu.com/p/1288d8873440)\n\n* 可以扫码下载 Demo 进行演示或者测试，如果扫码下载不了的，[点击此处可直接下载](https://github.com/getActivity/ShapeView/releases/download/9.6/ShapeView.apk)\n\n![](picture/demo_code.png)\n\n![](picture/long_screenshots.jpg)\n\n#### 集成步骤\n\n* 如果你的项目 Gradle 配置是在 `7.0 以下`，需要在 `build.gradle` 文件中加入\n\n```groovy\nallprojects {\n    repositories {\n        // JitPack 远程仓库：https://jitpack.io\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n* 如果你的 Gradle 配置是 `7.0 及以上`，则需要在 `settings.gradle` 文件中加入\n\n```groovy\ndependencyResolutionManagement {\n    repositories {\n        // JitPack 远程仓库：https://jitpack.io\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n* 配置完远程仓库后，在项目 app 模块下的 `build.gradle` 文件中加入远程依赖\n\n```groovy\nandroid {\n    // 支持 JDK 1.8\n    compileOptions {\n        targetCompatibility JavaVersion.VERSION_1_8\n        sourceCompatibility JavaVersion.VERSION_1_8\n    }\n}\n\ndependencies {\n    // ShapeView：https://github.com/getActivity/ShapeView\n    implementation 'com.github.getActivity:ShapeView:9.6'\n    // ShapeDrawable：https://github.com/getActivity/ShapeDrawable\n    implementation 'com.github.getActivity:ShapeDrawable:3.3'\n}\n```\n\n#### AndroidX 兼容\n\n* 如果项目是基于 **AndroidX** 包，请在项目 `gradle.properties` 文件中加入\n\n```text\n# 表示将第三方库迁移到 AndroidX\nandroid.enableJetifier = true\n```\n\n* 如果项目是基于 **Support** 包则不需要加入此配置\n\n#### 框架文档\n\n* Java 代码设置\n\n```java\nShapeButton shapeButton = findViewById(R.id.btn_main_test);\nshapeButton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n    \n        shapeButton.getShapeDrawableBuilder()\n                .setSolidColor(0xFF000000)\n                .setStrokeColor(0xFF5A8DDF)\n                // 注意：最后需要调用一下 intoBackground 方法才能生效\n                .intoBackground();\n\n        shapeButton.getTextColorBuilder()\n                .setTextColor(0xFFFFFFFF)\n                // 注意：最后需要调用一下 intoTextColor 方法才能生效\n                .intoTextColor();\n\n        shapeButton.setText(\"颜色已经改变啦\");\n    }\n});\n```\n\n#### 布局属性大全\n\n* [不同版本的 xml 属性适配请点击这里查看](Adaptive.md)\n\n```xml\n\u003cresources\u003e\n\n    \u003c!-- Shape 形状（默认是矩形） --\u003e\n    \u003cattr name=\"shape_type\"\u003e\n        \u003c!-- 矩形 --\u003e\n        \u003cenum name=\"rectangle\" value=\"0\" /\u003e\n        \u003c!-- 椭圆形 --\u003e\n        \u003cenum name=\"oval\" value=\"1\" /\u003e\n        \u003c!-- 线条 --\u003e\n        \u003cenum name=\"line\" value=\"2\" /\u003e\n        \u003c!-- 圆环 --\u003e\n        \u003cenum name=\"ring\" value=\"3\" /\u003e\n    \u003c/attr\u003e\n    \n    \u003c!-- Shape 宽度 --\u003e\n    \u003cattr name=\"shape_width\" format=\"dimension\" /\u003e\n    \u003c!-- Shape 高度 --\u003e\n    \u003cattr name=\"shape_height\" format=\"dimension\" /\u003e\n\n    \u003c!-- 圆角大小 --\u003e\n    \u003cattr name=\"shape_radius\" format=\"dimension\" /\u003e\n    \u003c!-- 左上角的圆角大小 --\u003e\n    \u003cattr name=\"shape_radiusInTopLeft\" format=\"dimension\" /\u003e\n    \u003cattr name=\"shape_radiusInTopStart\" format=\"dimension\" /\u003e\n    \u003c!-- 右上角的圆角大小 --\u003e\n    \u003cattr name=\"shape_radiusInTopRight\" format=\"dimension\" /\u003e\n    \u003cattr name=\"shape_radiusInTopEnd\" format=\"dimension\" /\u003e\n    \u003c!-- 左下角的圆角大小 --\u003e\n    \u003cattr name=\"shape_radiusInBottomLeft\" format=\"dimension\" /\u003e\n    \u003cattr name=\"shape_radiusInBottomStart\" format=\"dimension\" /\u003e\n    \u003c!-- 右下角的圆角大小 --\u003e\n    \u003cattr name=\"shape_radiusInBottomRight\" format=\"dimension\" /\u003e\n    \u003cattr name=\"shape_radiusInBottomEnd\" format=\"dimension\" /\u003e\n\n    \u003c!-- 填充色（默认状态） --\u003e\n    \u003cattr name=\"shape_solidColor\" format=\"color\" /\u003e\n    \u003c!-- 填充色（按下状态） --\u003e\n    \u003cattr name=\"shape_solidPressedColor\" format=\"color\" /\u003e\n    \u003c!-- 填充色（选中状态） --\u003e\n    \u003cattr name=\"shape_solidCheckedColor\" format=\"color\" /\u003e\n    \u003c!-- 填充色（禁用状态） --\u003e\n    \u003cattr name=\"shape_solidDisabledColor\" format=\"color\" /\u003e\n    \u003c!-- 填充色（焦点状态） --\u003e\n    \u003cattr name=\"shape_solidFocusedColor\" format=\"color\" /\u003e\n    \u003c!-- 填充色（选择状态） --\u003e\n    \u003cattr name=\"shape_solidSelectedColor\" format=\"color\" /\u003e\n\n    \u003c!-- 填充色渐变色起始颜色 --\u003e\n    \u003cattr name=\"shape_solidGradientStartColor\" format=\"color\" /\u003e\n    \u003c!-- 填充色渐变色中间颜色（可不设置） --\u003e\n    \u003cattr name=\"shape_solidGradientCenterColor\" format=\"color\" /\u003e\n    \u003c!-- 填充色渐变色结束颜色 --\u003e\n    \u003cattr name=\"shape_solidGradientEndColor\" format=\"color\" /\u003e\n\n    \u003c!-- 填充色渐变方向（仅用于线性渐变） --\u003e\n    \u003cattr name=\"shape_solidGradientOrientation\" \u003e\n        \u003c!-- 从左到右绘制渐变（0 度） --\u003e\n        \u003cenum name=\"leftToRight\" value=\"0\" /\u003e\n        \u003cenum name=\"startToEnd\" value=\"10\" /\u003e\n\n        \u003c!-- 从右到左绘制渐变（180 度） --\u003e\n        \u003cenum name=\"rightToLeft\" value=\"180\" /\u003e\n        \u003cenum name=\"endToStart\" value=\"1800\" /\u003e\n\n        \u003c!-- 从下到上绘制渐变（90 度） --\u003e\n        \u003cenum name=\"bottomToTop\" value=\"90\" /\u003e\n        \u003c!-- 从上到下绘制渐变（270 度） --\u003e\n        \u003cenum name=\"topToBottom\" value=\"270\" /\u003e\n\n        \u003c!-- 从左上角到右下角绘制渐变（315 度） --\u003e\n        \u003cenum name=\"topLeftToBottomRight\" value=\"315\" /\u003e\n        \u003cenum name=\"topStartToBottomEnd\" value=\"3150\" /\u003e\n\n        \u003c!-- 从左下角到右上角绘制渐变（45 度） --\u003e\n        \u003cenum name=\"bottomLeftToTopRight\" value=\"45\" /\u003e\n        \u003cenum name=\"bottomStartToTopEnd\" value=\"450\" /\u003e\n\n        \u003c!-- 从右上角到左下角绘制渐变（225 度） --\u003e\n        \u003cenum name=\"topRightToBottomLeft\" value=\"225\" /\u003e\n        \u003cenum name=\"topEndToBottomStart\" value=\"2250\" /\u003e\n\n        \u003c!-- 从右下角到左上角绘制渐变（135 度） --\u003e\n        \u003cenum name=\"bottomRightToTopLeft\" value=\"135\" /\u003e\n        \u003cenum name=\"bottomEndToTopStart\" value=\"1350\" /\u003e\n    \u003c/attr\u003e\n    \u003c!-- 填充色渐变类型（默认类型是线性渐变） --\u003e\n    \u003cattr name=\"shape_solidGradientType\"\u003e\n        \u003c!-- 线性渐变 --\u003e\n        \u003cenum name=\"linear\" value=\"0\" /\u003e\n        \u003c!-- 径向渐变 --\u003e\n        \u003cenum name=\"radial\" value=\"1\" /\u003e\n        \u003c!-- 扫描渐变 --\u003e\n        \u003cenum name=\"sweep\"  value=\"2\" /\u003e\n    \u003c/attr\u003e\n    \u003c!-- 填充色渐变中心 X 点坐标的相对位置（默认值为 0.5）--\u003e\n    \u003cattr name=\"shape_solidGradientCenterX\" format=\"float|fraction\" /\u003e\n    \u003c!-- 填充色渐变中心 Y 点坐标的相对位置（默认值为 0.5）--\u003e\n    \u003cattr name=\"shape_solidGradientCenterY\" format=\"float|fraction\" /\u003e\n    \u003c!-- 填充色渐变色半径（仅用于径向渐变） --\u003e\n    \u003cattr name=\"shape_solidGradientRadius\" format=\"float|fraction|dimension\" /\u003e\n\n    \u003c!-- 边框色（默认状态） --\u003e\n    \u003cattr name=\"shape_strokeColor\" format=\"color\" /\u003e\n    \u003c!-- 边框色（按下状态） --\u003e\n    \u003cattr name=\"shape_strokePressedColor\" format=\"color\" /\u003e\n    \u003c!-- 边框色（选中状态） --\u003e\n    \u003cattr name=\"shape_strokeCheckedColor\" format=\"color\" /\u003e\n    \u003c!-- 边框色（禁用状态） --\u003e\n    \u003cattr name=\"shape_strokeDisabledColor\" format=\"color\" /\u003e\n    \u003c!-- 边框色（焦点状态） --\u003e\n    \u003cattr name=\"shape_strokeFocusedColor\" format=\"color\" /\u003e\n    \u003c!-- 边框色（选择状态） --\u003e\n    \u003cattr name=\"shape_strokeSelectedColor\" format=\"color\" /\u003e\n\n    \u003c!-- 边框色渐变色起始颜色 --\u003e\n    \u003cattr name=\"shape_strokeGradientStartColor\" format=\"color\" /\u003e\n    \u003c!-- 边框渐变色中间颜色（可不设置） --\u003e\n    \u003cattr name=\"shape_strokeGradientCenterColor\" format=\"color\" /\u003e\n    \u003c!-- 边框渐变色结束颜色 --\u003e\n    \u003cattr name=\"shape_strokeGradientEndColor\" format=\"color\" /\u003e\n\n    \u003c!-- 边框色渐变方向（仅用于线性渐变） --\u003e\n    \u003cattr name=\"shape_strokeGradientOrientation\" \u003e\n        \u003c!-- 从左到右绘制渐变（0 度） --\u003e\n        \u003cenum name=\"leftToRight\" value=\"0\" /\u003e\n        \u003cenum name=\"startToEnd\" value=\"10\" /\u003e\n\n        \u003c!-- 从右到左绘制渐变（180 度） --\u003e\n        \u003cenum name=\"rightToLeft\" value=\"180\" /\u003e\n        \u003cenum name=\"endToStart\" value=\"1800\" /\u003e\n\n        \u003c!-- 从下到上绘制渐变（90 度） --\u003e\n        \u003cenum name=\"bottomToTop\" value=\"90\" /\u003e\n        \u003c!-- 从上到下绘制渐变（270 度） --\u003e\n        \u003cenum name=\"topToBottom\" value=\"270\" /\u003e\n\n        \u003c!-- 从左上角到右下角绘制渐变（315 度） --\u003e\n        \u003cenum name=\"topLeftToBottomRight\" value=\"315\" /\u003e\n        \u003cenum name=\"topStartToBottomEnd\" value=\"3150\" /\u003e\n\n        \u003c!-- 从左下角到右上角绘制渐变（45 度） --\u003e\n        \u003cenum name=\"bottomLeftToTopRight\" value=\"45\" /\u003e\n        \u003cenum name=\"bottomStartToTopEnd\" value=\"450\" /\u003e\n\n        \u003c!-- 从右上角到左下角绘制渐变（225 度） --\u003e\n        \u003cenum name=\"topRightToBottomLeft\" value=\"225\" /\u003e\n        \u003cenum name=\"topEndToBottomStart\" value=\"2250\" /\u003e\n\n        \u003c!-- 从右下角到左上角绘制渐变（135 度） --\u003e\n        \u003cenum name=\"bottomRightToTopLeft\" value=\"135\" /\u003e\n        \u003cenum name=\"bottomEndToTopStart\" value=\"1350\" /\u003e\n    \u003c/attr\u003e\n\n    \u003c!-- 边框大小 --\u003e\n    \u003cattr name=\"shape_strokeSize\" format=\"dimension\" /\u003e\n    \u003c!-- 边框虚线大小（为 0 就是实线，大于 0 就是虚线） --\u003e\n    \u003cattr name=\"shape_strokeDashSize\" format=\"dimension\" /\u003e\n    \u003c!-- 边框虚线间隔（虚线与虚线之间的间隔） --\u003e\n    \u003cattr name=\"shape_strokeDashGap\" format=\"dimension\" /\u003e\n\n    \u003c!-- 阴影大小 --\u003e\n    \u003cattr name=\"shape_shadowSize\" format=\"dimension\" /\u003e\n    \u003c!-- 阴影颜色 --\u003e\n    \u003cattr name=\"shape_shadowColor\" format=\"color\" /\u003e\n    \u003c!-- 阴影水平偏移 --\u003e\n    \u003cattr name=\"shape_shadowOffsetX\" format=\"dimension\" /\u003e\n    \u003c!-- 阴影垂直偏移 --\u003e\n    \u003cattr name=\"shape_shadowOffsetY\" format=\"dimension\" /\u003e\n\n    \u003c!-- 内环的半径（仅在 shape=\"ring\" 生效） --\u003e\n    \u003cattr name=\"shape_ringInnerRadiusSize\" format=\"dimension\" /\u003e\n    \u003c!-- 内环的半径比率（仅在 shape=\"ring\" 生效），计算公式：整个圆环 / innerRadiusRatio = innerRadius --\u003e\n    \u003cattr name=\"shape_ringInnerRadiusRatio\" format=\"float\" /\u003e\n    \u003c!-- 外环的厚度（仅在 shape=\"ring\" 生效） --\u003e\n    \u003cattr name=\"shape_ringThicknessSize\" format=\"dimension\" /\u003e\n    \u003c!-- 外环的厚度比率（仅在 shape=\"ring\" 生效），计算公式：整个圆环 / thicknessRatio = thickness --\u003e\n    \u003cattr name=\"shape_ringThicknessRatio\" format=\"float\" /\u003e\n\n    \u003c!-- 线条重心（仅在 shape=\"line\" 生效） --\u003e\n    \u003cattr name=\"shape_lineGravity\"\u003e\n        \u003cflag name=\"top\" value=\"0x30\" /\u003e\n        \u003cflag name=\"bottom\" value=\"0x50\" /\u003e\n        \u003cflag name=\"left\" value=\"0x03\" /\u003e\n        \u003cflag name=\"right\" value=\"0x05\" /\u003e\n        \u003cflag name=\"start\" value=\"0x00800003\" /\u003e\n        \u003cflag name=\"end\" value=\"0x00800005\" /\u003e\n        \u003cflag name=\"center\" value=\"0x11\" /\u003e\n    \u003c/attr\u003e\n\n    \u003c!-- 文本色（默认状态） --\u003e\n    \u003cattr name=\"shape_textColor\" format=\"color\" /\u003e\n    \u003c!-- 文本色（按下状态） --\u003e\n    \u003cattr name=\"shape_textPressedColor\" format=\"color\" /\u003e\n    \u003c!-- 文本色（选中状态） --\u003e\n    \u003cattr name=\"shape_textCheckedColor\" format=\"color\" /\u003e\n    \u003c!-- 文本色（禁用状态） --\u003e\n    \u003cattr name=\"shape_textDisabledColor\" format=\"color\" /\u003e\n    \u003c!-- 文本色（焦点状态） --\u003e\n    \u003cattr name=\"shape_textFocusedColor\" format=\"color\" /\u003e\n    \u003c!-- 文本色（选择状态） --\u003e\n    \u003cattr name=\"shape_textSelectedColor\" format=\"color\" /\u003e\n\n    \u003c!-- 文本渐变色起始颜色 --\u003e\n    \u003cattr name=\"shape_textStartColor\" format=\"color\" /\u003e\n    \u003c!-- 文本渐变色中间颜色（可不设置） --\u003e\n    \u003cattr name=\"shape_textCenterColor\" format=\"color\" /\u003e\n    \u003c!-- 文本渐变色结束颜色 --\u003e\n    \u003cattr name=\"shape_textEndColor\" format=\"color\" /\u003e\n    \u003c!-- 文本渐变方向（默认类型是水平渐变） --\u003e\n    \u003cattr name=\"shape_textGradientOrientation\"\u003e\n        \u003c!-- 水平渐变 --\u003e\n        \u003cenum name=\"horizontal\" value=\"0\" /\u003e\n        \u003c!-- 垂直渐变 --\u003e\n        \u003cenum name=\"vertical\" value=\"1\" /\u003e\n    \u003c/attr\u003e\n\n    \u003c!-- 文本边框颜色 --\u003e\n    \u003cattr name=\"shape_textStrokeColor\" format=\"color\" /\u003e\n    \u003c!-- 文本边框大小 --\u003e\n    \u003cattr name=\"shape_textStrokeSize\" format=\"dimension\" /\u003e\n\n    \u003c!-- CheckBox 或者 RadioButton 图标（默认状态） --\u003e\n    \u003cattr name=\"shape_buttonDrawable\" format=\"reference\" /\u003e\n    \u003c!-- CheckBox 或者 RadioButton 图标（按下状态） --\u003e\n    \u003cattr name=\"shape_buttonPressedDrawable\" format=\"reference\" /\u003e\n    \u003c!-- CheckBox 或者 RadioButton 图标（选中状态） --\u003e\n    \u003cattr name=\"shape_buttonCheckedDrawable\" format=\"reference\" /\u003e\n    \u003c!-- CheckBox 或者 RadioButton 图标（禁用状态） --\u003e\n    \u003cattr name=\"shape_buttonDisabledDrawable\" format=\"reference\" /\u003e\n    \u003c!-- CheckBox 或者 RadioButton 图标（焦点状态） --\u003e\n    \u003cattr name=\"shape_buttonFocusedDrawable\" format=\"reference\" /\u003e\n    \u003c!-- CheckBox 或者 RadioButton 图标（选择状态） --\u003e\n    \u003cattr name=\"shape_buttonSelectedDrawable\" format=\"reference\" /\u003e\n\n\u003c/resources\u003e\n```\n\n* 目前支持这些属性的控件有：\n\n    * View 的子类：ShapeView、ShapeTextView、ShapeButton、ShapeImageView、ShapeRadioButton、ShapeCheckBox、ShapeEditText\n\n    * ViewGroup 的子类：ShapeLinearLayout、ShapeFrameLayout、ShapeRelativeLayout、ShapeConstraintLayout、ShapeRecyclerView、ShapeRadioGroup\n\n#### 框架混淆规则\n\n* 在混淆规则文件 `proguard-rules.pro` 中加入\n\n```text\n-keep class com.hjq.shape.** {*;}\n```\n\n### [常见疑问解答](HelpDoc.md)\n\n### [使用案例文档](UseDemo.md)\n\n#### 框架亮点\n\n* 功能强大：支持设置阴影、边框渐变色、文本渐变色\n\n* 更加便捷：无需新增 Xml 文件，直接定义控件属性即可\n\n* 即时生效：在布局中可实时预览效果，即见所得，无需运行\n\n* 无学习成本：控件属性和原生 Shape 命名保持一致，无需额外学习\n\n* 覆盖范围广：几乎涵盖所有常见的 View 控件，并且控件名称无任何记忆成本\n\n* 支持状态选择器：不仅支持设置背景色的状态选择器，还支持设置文本颜色的状态选择器\n\n#### 作者的其他开源项目\n\n* 安卓技术中台：[AndroidProject](https://github.com/getActivity/AndroidProject) ![](https://img.shields.io/github/stars/getActivity/AndroidProject.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidProject.svg)\n\n* 安卓技术中台 Kt 版：[AndroidProject-Kotlin](https://github.com/getActivity/AndroidProject-Kotlin) ![](https://img.shields.io/github/stars/getActivity/AndroidProject-Kotlin.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidProject-Kotlin.svg)\n\n* 权限框架：[XXPermissions](https://github.com/getActivity/XXPermissions) ![](https://img.shields.io/github/stars/getActivity/XXPermissions.svg) ![](https://img.shields.io/github/forks/getActivity/XXPermissions.svg)\n\n* 吐司框架：[Toaster](https://github.com/getActivity/Toaster) ![](https://img.shields.io/github/stars/getActivity/Toaster.svg) ![](https://img.shields.io/github/forks/getActivity/Toaster.svg)\n\n* 网络框架：[EasyHttp](https://github.com/getActivity/EasyHttp) ![](https://img.shields.io/github/stars/getActivity/EasyHttp.svg) ![](https://img.shields.io/github/forks/getActivity/EasyHttp.svg)\n\n* 标题栏框架：[TitleBar](https://github.com/getActivity/TitleBar) ![](https://img.shields.io/github/stars/getActivity/TitleBar.svg) ![](https://img.shields.io/github/forks/getActivity/TitleBar.svg)\n\n* 悬浮窗框架：[EasyWindow](https://github.com/getActivity/EasyWindow) ![](https://img.shields.io/github/stars/getActivity/EasyWindow.svg) ![](https://img.shields.io/github/forks/getActivity/EasyWindow.svg)\n\n* ShapeDrawable 框架：[ShapeDrawable](https://github.com/getActivity/ShapeDrawable) ![](https://img.shields.io/github/stars/getActivity/ShapeDrawable.svg) ![](https://img.shields.io/github/forks/getActivity/ShapeDrawable.svg)\n\n* 语种切换框架：[MultiLanguages](https://github.com/getActivity/MultiLanguages) ![](https://img.shields.io/github/stars/getActivity/MultiLanguages.svg) ![](https://img.shields.io/github/forks/getActivity/MultiLanguages.svg)\n\n* Gson 解析容错：[GsonFactory](https://github.com/getActivity/GsonFactory) ![](https://img.shields.io/github/stars/getActivity/GsonFactory.svg) ![](https://img.shields.io/github/forks/getActivity/GsonFactory.svg)\n\n* 日志查看框架：[Logcat](https://github.com/getActivity/Logcat) ![](https://img.shields.io/github/stars/getActivity/Logcat.svg) ![](https://img.shields.io/github/forks/getActivity/Logcat.svg)\n\n* 嵌套滚动布局框架：[NestedScrollLayout](https://github.com/getActivity/NestedScrollLayout) ![](https://img.shields.io/github/stars/getActivity/NestedScrollLayout.svg) ![](https://img.shields.io/github/forks/getActivity/NestedScrollLayout.svg)\n\n* Android 版本适配：[AndroidVersionAdapter](https://github.com/getActivity/AndroidVersionAdapter) ![](https://img.shields.io/github/stars/getActivity/AndroidVersionAdapter.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidVersionAdapter.svg)\n\n* Android 代码规范：[AndroidCodeStandard](https://github.com/getActivity/AndroidCodeStandard) ![](https://img.shields.io/github/stars/getActivity/AndroidCodeStandard.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidCodeStandard.svg)\n\n* Android 资源大汇总：[AndroidIndex](https://github.com/getActivity/AndroidIndex) ![](https://img.shields.io/github/stars/getActivity/AndroidIndex.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidIndex.svg)\n\n* Android 开源排行榜：[AndroidGithubBoss](https://github.com/getActivity/AndroidGithubBoss) ![](https://img.shields.io/github/stars/getActivity/AndroidGithubBoss.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidGithubBoss.svg)\n\n* Studio 精品插件：[StudioPlugins](https://github.com/getActivity/StudioPlugins) ![](https://img.shields.io/github/stars/getActivity/StudioPlugins.svg) ![](https://img.shields.io/github/forks/getActivity/StudioPlugins.svg)\n\n* 表情包大集合：[EmojiPackage](https://github.com/getActivity/EmojiPackage) ![](https://img.shields.io/github/stars/getActivity/EmojiPackage.svg) ![](https://img.shields.io/github/forks/getActivity/EmojiPackage.svg)\n\n* AI 资源大汇总：[AiIndex](https://github.com/getActivity/AiIndex) ![](https://img.shields.io/github/stars/getActivity/AiIndex.svg) ![](https://img.shields.io/github/forks/getActivity/AiIndex.svg)\n\n* 省市区 Json 数据：[ProvinceJson](https://github.com/getActivity/ProvinceJson) ![](https://img.shields.io/github/stars/getActivity/ProvinceJson.svg) ![](https://img.shields.io/github/forks/getActivity/ProvinceJson.svg)\n\n* Markdown 语法文档：[MarkdownDoc](https://github.com/getActivity/MarkdownDoc) ![](https://img.shields.io/github/stars/getActivity/MarkdownDoc.svg) ![](https://img.shields.io/github/forks/getActivity/MarkdownDoc.svg)\n\n#### 微信公众号：Android轮子哥\n\n![](https://raw.githubusercontent.com/getActivity/Donate/master/picture/official_ccount.png)\n\n#### Android 技术 Q 群：10047167\n\n#### 如果您觉得我的开源库帮你节省了大量的开发时间，请扫描下方的二维码随意打赏，要是能打赏个 10.24 :monkey_face:就太:thumbsup:了。您的支持将鼓励我继续创作:octocat:（[点击查看捐赠列表](https://github.com/getActivity/Donate)）\n\n![](https://raw.githubusercontent.com/getActivity/Donate/master/picture/pay_ali.png) ![](https://raw.githubusercontent.com/getActivity/Donate/master/picture/pay_wechat.png)\n\n## License\n\n```text\nCopyright 2021 Huang JinQun\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","funding_links":["https://raw.githubusercontent.com/getActivity/Donate/master/picture/pay_ali.png"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetactivity%2Fshapeview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetactivity%2Fshapeview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetactivity%2Fshapeview/lists"}