{"id":18982478,"url":"https://github.com/niniloveyou/drawabletextview","last_synced_at":"2025-04-15T17:41:39.031Z","repository":{"id":201339016,"uuid":"79520047","full_name":"niniloveyou/DrawableTextView","owner":"niniloveyou","description":"自定义控件 ：drawable 跟随TextView居中 The drawable follows the text centered","archived":false,"fork":false,"pushed_at":"2017-07-05T07:17:56.000Z","size":127,"stargazers_count":139,"open_issues_count":2,"forks_count":46,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T23:11:15.558Z","etag":null,"topics":["drawable","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/niniloveyou.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}},"created_at":"2017-01-20T03:08:12.000Z","updated_at":"2024-04-27T13:57:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"8416338c-aeef-4081-bb79-9ade1b7e587c","html_url":"https://github.com/niniloveyou/DrawableTextView","commit_stats":null,"previous_names":["niniloveyou/drawabletextview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niniloveyou%2FDrawableTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niniloveyou%2FDrawableTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niniloveyou%2FDrawableTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niniloveyou%2FDrawableTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niniloveyou","download_url":"https://codeload.github.com/niniloveyou/DrawableTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249121403,"owners_count":21216113,"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":["drawable","textview"],"created_at":"2024-11-08T16:13:40.739Z","updated_at":"2025-04-15T17:41:39.013Z","avatar_url":"https://github.com/niniloveyou.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DrawableTextView\n自定义控件 ：drawable 跟随TextView居中  \nThe drawable follows the text centered\n\n截图：\n----------\n\n![DrawableTextView](https://github.com/niniloveyou/DrawableTextView/blob/master/drawableTextView.jpeg)\n\n###Manually\n\n你只需要这添加这两个文件就可以使用了！\n   + deadline/DrawableTextView.java\n   + res/values/attrs.xml\n\n###代码中这样设置即可\n```\ndrawable = ContextCompat.getDrawable(getContext(), R.mipmap.xxx);\nsetDrawable(DrawableTextView.LEFT, drawable, width, height);\n```\n\nCustomizable attributes\n\n### xml中定义了以下属性\n-  Define `xmlns:app=\"http://schemas.android.com/apk/res-auto\"` on root of your xml file\n\n```xml\n\u003cdeadline.DrawableTextView\n            android:layout_width=\"100dp\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            \n            android:drawablePadding=\"5dp\"\n            \n            app:bottomDrawable=\"@mipmap/camera\"\n            app:bottomDrawableHeight=\"20dp\"\n            app:bottomDrawableWidth=\"20dp\"\n            \n            app:leftDrawable=\"@mipmap/camera\"\n            app:leftDrawableHeight=\"20dp\"\n            app:leftDrawableWidth=\"20dp\"\n            \n            app:rightDrawable=\"@mipmap/camera\"\n            app:rightDrawableHeight=\"20dp\"\n            app:rightDrawableWidth=\"20dp\"\n            \n            app:topDrawable=\"@mipmap/camera\"\n            app:topDrawableHeight=\"20dp\"\n            app:topDrawableWidth=\"20dp\"/\u003e\n```\n\n\n\nDeveloped By\n-------\ndeadline\n\nBlog :   http://www.jianshu.com/users/25e80ace21b8/latest_articles\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniniloveyou%2Fdrawabletextview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniniloveyou%2Fdrawabletextview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniniloveyou%2Fdrawabletextview/lists"}