{"id":15641892,"url":"https://github.com/pnc/iconbutton","last_synced_at":"2025-04-14T21:46:23.937Z","repository":{"id":6198149,"uuid":"7428815","full_name":"pnc/IconButton","owner":"pnc","description":"A Button subclass for Android that provides better control over drawable positioning","archived":false,"fork":false,"pushed_at":"2015-09-08T13:57:01.000Z","size":768,"stargazers_count":135,"open_issues_count":1,"forks_count":43,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T09:51:31.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ConsenSys/ether-crawler","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pnc.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}},"created_at":"2013-01-03T19:26:15.000Z","updated_at":"2024-11-06T10:01:36.000Z","dependencies_parsed_at":"2022-09-10T01:32:04.526Z","dependency_job_id":null,"html_url":"https://github.com/pnc/IconButton","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/pnc%2FIconButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnc%2FIconButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnc%2FIconButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnc%2FIconButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pnc","download_url":"https://codeload.github.com/pnc/IconButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248967053,"owners_count":21190890,"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-10-03T11:53:00.971Z","updated_at":"2025-04-14T21:46:23.919Z","avatar_url":"https://github.com/pnc.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IconButton for Android\n\nIconButton is an Android button widget that allows you to center both the button's text and an icon.\n\nAndroid's stock `Button` class allows you to assign a `Drawable` to the left, right, top, or bottom of a button, but it looks bad if you need to have the button fill the screen:\n\n![Default Android Button Behavior](images/default_behavior.png \"Default Android Button Behavior\")\n\n## Installation\n\n### For Gradle / Android Studio\n\nMake sure you declare the JCenter repository in your project's `build.gradle`:\n\n``` groovy\nrepositories {\n    jcenter()\n}\n```\n\nThen add a compile-time dependency on this library, adding the `dependencies` section to `build.gradle` if it doesn't already exist:\n\n``` groovy\ndependencies {\n    compile 'com.githang:com-phillipcalvin-iconbutton:1.0.1@aar'\n}\n```\n\n### For Old Version\n\nIf you're using ADT, clone this repository and import it into your workspace using File - Import. Then add it to your project by right-clicking your project, selecting Properties, then Android, and adding IconButton in the references list at the bottom of the Properties window.\n\nIf you're not using ADT, I recommend using this library as a submodule:\n\n``` bash\ngit submodule add git@github.com:pnc/IconButton.git\n```\n\nGenerate a `local.properties` for IconButton:\n\n``` bash\nandroid update project -n IconButton --path IconButton/IconButton\n```\n\nThen reference the library from your own `project.properties`:\n\n``` properties\nandroid.library.reference.1=IconButton/IconButton\n```\n\nIf you already have library references, change the `1` to the appropriate number.\n\n## Usage\n\n### In your layout\n\n``` xml\n\u003cLinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res/your.project.package\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n\n\u003c!-- ... --\u003e\n\n  \u003ccom.phillipcalvin.iconbutton.IconButton\n      android:id=\"@+id/search\"\n      android:drawableLeft=\"@drawable/action_search\"\n      android:text=\"@string/search\"\n      app:iconPadding=\"10dp\" /\u003e\n```\n\nThe use of `app:iconPadding` is optional. It allows you to add padding between the drawable and your text.\n\nChange the text `your.project.package` to your own project's package. You don't have to use `LinearLayout`, but you do need to make sure to define the namespace definition (`xmlns:app=\"http://schemas.android.com/apk/res/your.project.package\"`) appears in the root element.\n\nYou can assign either a `drawableLeft` or a `drawableRight` to the IconButton.\n\n![Preview of icon button in several different configurations](images/demo.png \"Preview of icon button in several different configurations\")\n\n### Caveats\n\nIconButton only supports one drawable on the left or right. I'll absolutely accept patches that improve its handling of multiple drawables.\n\n## Contributors\n\nSpecial thanks to:\n\n* [@msdx](https://github.com/msdx) for significant contributions around Android Studio and Gradle support.\n* [@kaushikgopal](https://twitter.com/kaushikgopal) for adding left and right drawable support\n\n## License\nCopyright (c) 2012-2015 [Phil Calvin](http://philcalvin.com) and contributors.\n\nLicensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\nContains modified source from [ParcelHelper](https://github.com/commonsguy/cwac-parcel), also under the Apache License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnc%2Ficonbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpnc%2Ficonbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnc%2Ficonbutton/lists"}