{"id":13644454,"url":"https://github.com/AAkira/CompoundIconTextView","last_synced_at":"2025-04-21T07:31:28.574Z","repository":{"id":71686087,"uuid":"93323151","full_name":"AAkira/CompoundIconTextView","owner":"AAkira","description":"An android library that is able to set a vector drawable at text view pre-Lollipop.","archived":false,"fork":false,"pushed_at":"2017-11-14T04:30:14.000Z","size":216,"stargazers_count":247,"open_issues_count":2,"forks_count":31,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T14:36:47.396Z","etag":null,"topics":["android","android-library","textview","vector-drawable"],"latest_commit_sha":null,"homepage":null,"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/AAkira.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}},"created_at":"2017-06-04T15:36:34.000Z","updated_at":"2025-03-24T15:11:54.000Z","dependencies_parsed_at":"2023-02-23T13:30:31.905Z","dependency_job_id":null,"html_url":"https://github.com/AAkira/CompoundIconTextView","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAkira%2FCompoundIconTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAkira%2FCompoundIconTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAkira%2FCompoundIconTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AAkira%2FCompoundIconTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AAkira","download_url":"https://codeload.github.com/AAkira/CompoundIconTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250014641,"owners_count":21360987,"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","android-library","textview","vector-drawable"],"created_at":"2024-08-02T01:02:05.325Z","updated_at":"2025-04-21T07:31:23.562Z","avatar_url":"https://github.com/AAkira.png","language":"Java","readme":"# CompoundIconTextView\n\nAn android library that is able to set a vector drawable at text view pre-Lollipop.\n\n[![Platform](http://img.shields.io/badge/platform-android-brightgreen.svg?style=flat)](http://developer.android.com/index.html)\n[![Language](http://img.shields.io/badge/language-java-orange.svg?style=flat)](http://www.oracle.com/technetwork/java/javase/downloads/index.html)\n[![License](http://img.shields.io/badge/license-apache2.0-lightgrey.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Download CompoundIconTextView](https://api.bintray.com/packages/aakira/maven/compound-icon-textview/images/download.svg)](https://bintray.com/aakira/maven/compound-icon-textview/_latestVersion)\n\n## Preview\n\n![PREVIEW][preview]\n\n## Features\n\n* Set a vector drawable at text view pre-Lollipop\n\n## Usage\n\n### Gradle\n\nYou should set this line in your gradle file if you set colors to vector drawable pre-Lollipop.\n\n```gradle\nandroid {\n    defaultConfig {\n        vectorDrawables.useSupportLibrary = true\n    }\n}\n```\n\n### Code\n\n```Java\n\nCompoundIconTextView tv = (CompoundIconTextView) findViewById(R.id.compoundIconTextView);\n\n// set icon drawable\ntv.setVectorDrawableTop(R.drawable.ic_android_black_24dp);\ntv.setVectorDrawableLeft(R.drawable.ic_android_black_24dp);\n\n// set icon color\ntv.setIconColorResource(R.color.colorPrimary);\n\n// set icon size\ntv.setIconSizeResource(R.dimen.icon_size, R.dimen.icon_size);\ntv.setIconSize(32, 32);\n\n// clear icon\ntv.setVectorDrawableRight(CompoundIconTextView.UNDEFINED_RESOURCE);\n\n```\n\n### Xml\n\n```xml\n\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ccom.github.aakira.compoundicontextview.CompoundIconTextView\n     android:id=\"@+id/compoundIconTextView\"\n     android:layout_width=\"wrap_content\"\n     android:layout_height=\"wrap_content\"\n     android:drawablePadding=\"4dp\"\n     android:gravity=\"center\"\n     android:text=\"Hello World!\"\n     android:textColor=\"#3F51B5\"\n     android:textSize=\"16sp\"\n     app:cit_drawableLeft=\"@drawable/ic_android_black_24dp\"\n     app:cit_iconColor=\"#000\"\n     app:cit_iconHeight=\"16dp\"\n     app:cit_iconWidth=\"16dp\" /\u003e\n```\n\n### Attributes\n\n|attribute name|description|\n|:-:|:-:|\n|cit_drawableLeft|Sets a drawable or vector drawable to left of TextView|\n|cit_drawableTop|Sets a drawable or vector drawable to top of TextView|\n|cit_drawableBottom|Sets a drawable or vector drawable to bottom of TextView|\n|cit_drawableRight|Sets a drawable or vector drawable to right of TextView|\n|cit_drawableStart|Sets a drawable or vector drawable to start of TextView (for RTL)|\n|cit_drawableEnd|Sets a drawable or vector drawable to end of TextView (for RTL)|\n|cit_iconWidth|Sets a width of icon|\n|cit_iconHeight|Sets a width of icon|\n|cit_iconColor|Sets a icon color|\n\n## Setup\n\n### Gradle\n\nAdd the dependency in your `build.gradle`\n\n```groovy\nbuildscript {\n\trepositories {\n\t\tjcenter()\n\t}\n}\n\ndependencies {\n\tcompile 'com.github.aakira:compound-icon-textview:1.2.1@aar'\n}\n```\n## Using libraries\n\n* [Material icons](https://material.io/icons/#ic_cloud_download)\n\n## Author\n\n### Akira Aratani\n\n* Twitter\n - [@_a_akira](https://twitter.com/_a_akira)\n* Mail\n - developer.a.akira@gmail.com\n\n## License\n\n```\nCopyright (C) 2017 A.Akira\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\nhttp://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```\n\n[preview]: /arts/preview.jpg\n","funding_links":[],"categories":["TextView"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAAkira%2FCompoundIconTextView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAAkira%2FCompoundIconTextView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAAkira%2FCompoundIconTextView/lists"}