{"id":22096054,"url":"https://github.com/ztiany/android-drawable-view","last_synced_at":"2026-04-28T21:02:11.469Z","repository":{"id":62826302,"uuid":"561722168","full_name":"Ztiany/android-drawable-view","owner":"Ztiany","description":"An android library for developers to avoid writing drawable XML files.","archived":false,"fork":false,"pushed_at":"2025-01-02T08:52:04.000Z","size":18252,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:55:26.275Z","etag":null,"topics":["android","drawable","material-design"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/Ztiany.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2022-11-04T10:44:14.000Z","updated_at":"2025-01-02T08:52:08.000Z","dependencies_parsed_at":"2024-04-28T07:47:49.929Z","dependency_job_id":"dae088f7-6d41-4dd0-9db1-b1154e59ce2f","html_url":"https://github.com/Ztiany/android-drawable-view","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"f839786a90d7d27887cf7a34d6cc990da4d8394c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Ztiany/android-drawable-view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ztiany%2Fandroid-drawable-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ztiany%2Fandroid-drawable-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ztiany%2Fandroid-drawable-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ztiany%2Fandroid-drawable-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ztiany","download_url":"https://codeload.github.com/Ztiany/android-drawable-view/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ztiany%2Fandroid-drawable-view/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32399012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","drawable","material-design"],"created_at":"2024-12-01T04:09:32.741Z","updated_at":"2026-04-28T21:02:11.447Z","avatar_url":"https://github.com/Ztiany.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lib Shape/Drawable View\n\nAn android library for developers to avoid writing drawable XML files.\n\nThat would be very convenient if we can define various drawables by view's attributes. And that is\nwhat this library can do.\n\n## 1 Lib ShapeView\n\nThe Lib-ShapeView harnesses the ability\nof [MaterialShapeDrawable](https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable)\n\nWe can use views in Lib-ShapeView to define their background directly by attributes like the picture\nbelow shown.\n\n![](resource/shape-view.jpg)\n\ncode snippet:\n\n```xml\n\u003ccom.android.base.ui.shape.ShapeableTextView\n    style=\"@style/StyleShapeView\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"70dp\"\n    android:layout_margin=\"10dp\"\n    android:clickable=\"true\"\n    android:gravity=\"center\"\n    android:padding=\"2dp\"\n    android:text=\"Click me!\"\n    android:textColor=\"@color/color_state_test1\"\n    android:textStyle=\"bold\"\n    app:msd_backgroundColor=\"@color/color_state_test2\"\n    app:msd_strokeColor=\"@color/color_state_test1\"\n    app:msd_strokeWidth=\"4dp\"\n    app:shapeAppearance=\"@style/ShapeAppearance.Hexagon\" /\u003e\n```\n\n## 2 Lib DrawableView\n\nBut if we need a gradient drawable as a view's background. We then need views in The\nLib-DrawableView.\n\n![](resource/drawable-view.jpg)\n\ncode snippet:\n\n```xml\n\u003ccom.android.base.ui.drawable.DTextView\n    android:layout_width=\"150dp\"\n    android:layout_height=\"150dp\"\n    android:layout_margin=\"5dp\"\n    android:gravity=\"center\"\n    android:text=\"Ztiany\"\n    android:textColor=\"@color/white\"\n    android:textStyle=\"bold\"\n    app:cdv_drawable_type=\"gradient\"\n    app:cgd_shape=\"rectangle\"\n    app:cgd_shape_corner_style=\"@style/CornerAppearance.Rounded10\"\n    app:cgd_shape_solid=\"@color/colorPrimary\" /\u003e\n\n\u003ccom.android.base.ui.drawable.DTextView\n    android:layout_width=\"150dp\"\n    android:layout_height=\"150dp\"\n    android:layout_margin=\"5dp\"\n    android:gravity=\"center\"\n    android:text=\"Ztiany\"\n    android:textColor=\"@color/white\"\n    android:textStyle=\"bold\"\n    app:cdv_drawable_type=\"gradient\"\n    app:cgd_shape=\"rectangle\"\n    app:cgd_shape_corner_style=\"@style/StyleGradientDrawableView_Round_TL20\"\n    app:cgd_shape_solid=\"@color/colorPrimary\" /\u003e\n```\n\nAcknowledgment: The core code of Lib DrawableView is copied from [又一个减少冗余 Drawable 资源的解决方案](https://mp.weixin.qq.com/s/qxMoI7UTw3WtiRR6oIDGKA)。\n\n## 3  Installation\n\n```groovy\nimplementation \"io.github.ztiany:android-drawable-view:1.2.6\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fztiany%2Fandroid-drawable-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fztiany%2Fandroid-drawable-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fztiany%2Fandroid-drawable-view/lists"}