{"id":20307796,"url":"https://github.com/rayliverified/custombutton","last_synced_at":"2025-04-11T15:12:44.194Z","repository":{"id":67048090,"uuid":"96467839","full_name":"rayliverified/CustomButton","owner":"rayliverified","description":"Custom Button provides a beautiful and minimalistic button with outline and drawable support.  This library is part of the Custom UI collection of beautiful, minimalistic, and customizable Android UI components.","archived":false,"fork":false,"pushed_at":"2020-07-04T17:26:38.000Z","size":4045,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T04:49:05.379Z","etag":null,"topics":["android","beautiful","button","customizable","elegant","ios","outline","simple","style","ui"],"latest_commit_sha":null,"homepage":"http://rayliverified.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rayliverified.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":"2017-07-06T20:07:12.000Z","updated_at":"2023-11-09T16:03:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b78f51d-0357-468e-87dd-9004a3f15242","html_url":"https://github.com/rayliverified/CustomButton","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/rayliverified%2FCustomButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayliverified%2FCustomButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayliverified%2FCustomButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayliverified%2FCustomButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayliverified","download_url":"https://codeload.github.com/rayliverified/CustomButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429118,"owners_count":21101785,"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","beautiful","button","customizable","elegant","ios","outline","simple","style","ui"],"created_at":"2024-11-14T17:19:09.561Z","updated_at":"2025-04-11T15:12:44.184Z","avatar_url":"https://github.com/rayliverified.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Screenshots](screenshots/Custom-Button-Cover_1280x.gif)\r\n\r\n# Custom Button\r\n\r\n[![GitHub release](https://img.shields.io/github/release/searchy2/CustomButton.svg?style=flat-square)](https://github.com/searchy2/CustomButton/releases) [![GitHub Release Date](https://img.shields.io/github/release-date/searchy2/CustomButton.svg?style=flat-square)](https://github.com/searchy2/CustomButton) [![Libraries.io for GitHub](https://img.shields.io/librariesio/github/searchy2/CustomButton.svg?style=flat-square)](https://github.com/searchy2/CustomButton) [![GitHub issues](https://img.shields.io/github/issues/searchy2/CustomButton.svg?style=flat-square)](https://github.com/searchy2/CustomButton) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/searchy2/CustomButton.svg?style=flat-square)](https://github.com/searchy2/CustomButton) [![API](https://img.shields.io/badge/API-15%2B-blue.svg?style=flat-square)](https://github.com/searchy2/CustomButton) [![GitHub top language](https://img.shields.io/github/languages/top/searchy2/CustomButton.svg?style=flat-square)](https://github.com/searchy2/CustomButton)\r\n\r\n\u003cimg src=\"app/src/main/res/mipmap-xxxhdpi/ic_launcher.png\" width=\"128\"\u003e\r\n\r\n\u003e ### A beautiful and minimalistic button with outline and drawable support.\r\n\r\nThis library is part of the [Custom UI](http://rayliverified.com/index.php/code/) collection of beautiful, minimalistic, and customizable Android UI components.\r\n\r\n![Screenshots](screenshots/Custom-Button-Screenshot_1280x.jpg)\r\n\r\n# Usage\r\n\r\n[![GitHub release](https://img.shields.io/github/release/searchy2/CustomButton.svg?style=flat-square)](https://github.com/searchy2/CustomButton/releases)\r\n\r\nAdd this library to `build.gradle`.\r\n\r\n```java\r\nrepositories {\r\n    maven { url 'https://jitpack.io' }\r\n}\r\nimplementation 'com.github.searchy2:CustomButton:latest-version'\r\n```\r\n\r\nUse Custom Button in your layout with the following XML.\r\n\r\n```java\r\n\u003cstream.custombutton.CustomButton\r\n    android:id=\"@+id/btn\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:text=\"Custom Button\"\r\n    android:textSize=\"18sp\"\r\n    android:singleLine=\"true\"\r\n    android:ellipsize=\"none\"\r\n    app:btn_cornerRadius=\"20dp\"\r\n    app:btn_strokeWidth=\"1dp\"\r\n    app:btn_strokeColor=\"#008af9\"\r\n    app:btn_buttonColor=\"#00FFFFFF\"\r\n    app:btn_buttonSelectColor=\"#008af9\"\r\n    app:btn_textColor=\"#008af9\"\r\n    app:btn_textSelectColor=\"#FFFFFF\"/\u003e\r\n```\r\n\r\n## About\r\n\r\nCustomButton was created as a replacement for Android's Material buttons. CustomButtons are flat, have better drawable support, and look consistent across Android versions. Here at Codelessly, we're building a Flutter website/app builder, development tools, and UI templates to increase productivity. If that sounds interesting, you'll want to subscribe to updates below 😎\r\n\r\nCustomButton is licensed under Zero-Clause BSD and released as Emailware. If you like this project or it helped you, please subscribe to updates. Although it is not required, you might miss the goodies we share!\r\n\r\n\u003ca href=\"https://codelessly.com/?utm_medium=banner\u0026utm_campaign=newsletter_subscribe\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Codelessly/ResponsiveFramework/master/packages/Email%20Newsletter%20Signup.png\"\u003e\u003c/a\u003e\r\n\r\n# Examples\r\n\r\n![Screenshots](screenshots/button_default.png)\r\n\r\n```java\r\n\u003cstream.custombutton.CustomButton\r\n    android:id=\"@+id/btn1\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:paddingTop=\"6dp\"\r\n    android:paddingBottom=\"6dp\"\r\n    android:paddingLeft=\"12dp\"\r\n    android:paddingRight=\"12dp\"\r\n    android:layout_marginTop=\"10dp\"\r\n    android:layout_marginBottom=\"10dp\"\r\n    android:layout_gravity=\"center_horizontal\"\r\n    android:gravity=\"center\"\r\n    android:text=\"Default\"\r\n    android:textSize=\"18sp\"\r\n    android:singleLine=\"true\"\r\n    android:ellipsize=\"none\"/\u003e\r\n```\r\n\r\n![Screenshots](screenshots/button_elegant.png)\r\n\r\n```java\r\n\u003cstream.custombutton.CustomButton\r\n    android:id=\"@+id/btn2\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:paddingTop=\"6dp\"\r\n    android:paddingBottom=\"6dp\"\r\n    android:paddingLeft=\"12dp\"\r\n    android:paddingRight=\"12dp\"\r\n    android:layout_marginTop=\"10dp\"\r\n    android:layout_marginBottom=\"10dp\"\r\n    android:layout_gravity=\"center_horizontal\"\r\n    android:gravity=\"center\"\r\n    android:text=\"Elegant\"\r\n    android:textSize=\"18sp\"\r\n    android:singleLine=\"true\"\r\n    android:ellipsize=\"none\"\r\n    app:btn_cornerRadius=\"20dp\"\r\n    app:btn_strokeWidth=\"1dp\"\r\n    app:btn_strokeColor=\"@color/white\"\r\n    app:btn_strokeSelectColor=\"@color/white_pressed\"\r\n    app:btn_buttonColor=\"@color/transparent\"\r\n    app:btn_textColor=\"@color/white\"\r\n    app:btn_textSelectColor=\"@color/white_pressed\"/\u003e\r\n\r\n```\r\n\r\n![Screenshots](screenshots/button_normal.png)\r\n\r\n```java\r\n\u003cstream.custombutton.CustomButton\r\n    android:id=\"@+id/btn3\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:paddingTop=\"6dp\"\r\n    android:paddingBottom=\"6dp\"\r\n    android:paddingLeft=\"12dp\"\r\n    android:paddingRight=\"12dp\"\r\n    android:layout_marginTop=\"10dp\"\r\n    android:layout_marginBottom=\"10dp\"\r\n    android:layout_gravity=\"center_horizontal\"\r\n    android:gravity=\"center\"\r\n    android:text=\"Normal\"\r\n    android:textSize=\"18sp\"\r\n    android:singleLine=\"true\"\r\n    android:ellipsize=\"none\"\r\n    app:btn_cornerRadius=\"20dp\"\r\n    app:btn_strokeWidth=\"1dp\"\r\n    app:btn_strokeColor=\"#008af9\"\r\n    app:btn_buttonColor=\"@color/transparent\"\r\n    app:btn_buttonSelectColor=\"#008af9\"\r\n    app:btn_textColor=\"#008af9\"\r\n    app:btn_textSelectColor=\"@color/white\"/\u003e\r\n\r\n```\r\n\r\n![Screenshots](screenshots/button_confirm.png)\r\n\r\n```java\r\n\u003cstream.custombutton.CustomButton\r\n    android:id=\"@+id/btn4\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:paddingTop=\"2dp\"\r\n    android:paddingBottom=\"6dp\"\r\n    android:paddingLeft=\"12dp\"\r\n    android:paddingRight=\"12dp\"\r\n    android:layout_marginTop=\"10dp\"\r\n    android:layout_marginBottom=\"10dp\"\r\n    android:layout_gravity=\"center_horizontal\"\r\n    android:gravity=\"center\"\r\n    android:text=\"Confirm\"\r\n    android:textSize=\"18sp\"\r\n    android:singleLine=\"true\"\r\n    android:ellipsize=\"none\"\r\n    app:btn_cornerRadius=\"20dp\"\r\n    app:btn_strokeWidth=\"1dp\"\r\n    app:btn_buttonColor=\"@color/green\"\r\n    app:btn_buttonSelectColor=\"@color/green_light\"\r\n    app:btn_strokeColor=\"@color/green\"\r\n    app:btn_strokeSelectColor=\"@color/green_light\"\r\n    app:btn_textColor=\"@color/white\"/\u003e\r\n\r\n```\r\n\r\n![Screenshots](screenshots/button_cancel.png)\r\n\r\n```java\r\n\u003cstream.custombutton.CustomButton\r\n    android:id=\"@+id/btn5\"\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:paddingTop=\"2dp\"\r\n    android:paddingBottom=\"6dp\"\r\n    android:paddingLeft=\"12dp\"\r\n    android:paddingRight=\"12dp\"\r\n    android:layout_marginTop=\"10dp\"\r\n    android:layout_marginBottom=\"10dp\"\r\n    android:layout_gravity=\"center_horizontal\"\r\n    android:gravity=\"center\"\r\n    android:text=\"Cancel\"\r\n    android:textSize=\"18sp\"\r\n    android:singleLine=\"true\"\r\n    android:ellipsize=\"none\"\r\n    app:btn_cornerRadius=\"20dp\"\r\n    app:btn_strokeWidth=\"1dp\"\r\n    app:btn_buttonColor=\"@color/red\"\r\n    app:btn_buttonSelectColor=\"@color/red_light\"\r\n    app:btn_strokeColor=\"@color/red\"\r\n    app:btn_strokeSelectColor=\"@color/red_light\"\r\n    app:btn_textColor=\"@color/white\"/\u003e\r\n\r\n```\r\n# Customization\r\n\r\nCustom Button can be customized via XML and programmatically. Custom Button extends AppCompatTextView so all TextView functionality is available in addition to the methods listed below. \r\n\r\n### XML Attributes\r\n\r\n|Attribute|Description| \r\n|--|--|\r\n|btn_buttonColor|default background color|\r\n|btn_buttonSelectColor|selected background color|\r\n|btn_strokeColor|default outline color|\r\n|btn_strokeSelectColor|selected outline color|\r\n|btn_textColor|default text color|\r\n|btn_textSelectColor|selected text color|\r\n|btn_strokeWidth|outline thickness (px)|\r\n|btn_cornerRadius|rounded corners radius (px)|\r\n\r\n### Programmatically\r\n\r\n|Method|Description| \r\n|--|--|\r\n|setPressStatus(boolean isPress)|set button appearance to selected/default state|\r\n|setDrawableLeft(int imgResId)|set button left drawable|\r\n|setDrawableLeft(int imgResId, int width, int height)|set button left drawable with custom width and height parameters \u003c/br\u003e `imgResId - drawable ID` \u003c/br\u003e `width - drawable width in px` \u003c/br\u003e `height - drawable height in px`|\r\n|setDrawableRight(int imgResId)|set button right drawable|\r\n|setDrawableRight(int imgResId, int width, int height)|set button right drawable with custom width and height parameters \u003c/br\u003e `imgResId - drawable ID` \u003c/br\u003e `width - drawable width in px` \u003c/br\u003e `height - drawable height in px`|\r\n|setColor(int textnormal, int textselected, int buttonnormal, int buttonselected, int strokenormal, int strokeselected)|`textnormal - text color` \u003c/br\u003e `textselected - text color when pressed` \u003c/br\u003e `buttonnormal - background color` \u003c/br\u003e `buttonselected - background color when pressed` \u003c/br\u003e `strokenormal - outline color` \u003c/br\u003e `strokeselected - outline color when pressed` |\r\n|colorBurn(int RGBValues)|Get the darkened version of each color. The value of RGB is made up of alpha (transparency), red (red), green (green), blue (blue). In Android, RGB is usually represented as a hexadecimal. For example: \"#FFAABBCC\", from the left to the right, every two letters represent alpha (transparency), red, green, blue. Each color has a value of 0 to 255. This method shifts the color values and darkens the color. |\r\n\r\nView the sample app for additional customization options.\r\n\r\n# Features Wishlist\r\n\r\nThese features would make this library even more awesome. Please contribute to this library by developing any of the features below.\r\n\r\n---\r\n\r\n\u003eElevation Shadows\r\n\r\nCurrently, Custom Button does not support elevation or shadows. A current design trend is large drop shadows on buttons. The drop shadows are also colored which creates a really nice glowing look. It would be great if Custom Button supported glowing drop shadows or any drop shadows at all. \r\n\r\n\u003eGradient Background\r\n\r\nGradient backgrounds are very trendy and all designers are using them in UI mockups. Unfortunately, gradients are very difficult to do well on Android. Custom Button provides a good starting point to create buttons with gradient backgrounds. \r\n\r\n---\r\n\r\nPull requests are most welcome!\r\n\r\nIf you've fixed a bug or have a feature you've added, just create a pull request. If you've found a bug, file an issue. If you have any questions or would like to discuss upcoming features, please get in touch. You can get in touch with me in the Contact section below. \r\n\r\n# ★ Acknowledgements ★\r\n**♥ Developer ♥**\r\n\r\n[Ray Li](https://rayliverified.com)\r\n\r\n**♥ Designer ♥**\r\n\r\n[Ray Li](https://rayliverified.com)\r\n\r\n**♥ Sponsor ♥**\r\n\r\n[Codelessly - Flutter Website and App Builder](https://codelessly.com/?utm_medium=link\u0026utm_campaign=direct)\r\n\r\n# ★ Get in Touch ★\r\n\u003ca href=\"mailto:ray@codelessly.com\"\u003e\r\n  \u003cimg alt=\"Ray Li Email\"\r\n       src=\"https://lh3.googleusercontent.com/yN_m90WN_HSCohXdgC2k91uSTk9dnYfoxTYwG_mv_l5_05dV2CzkQ1B6rEqH4uqdgjA=w96\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://rayliverified.com\"\u003e\r\n  \u003cimg alt=\"Ray Li Website\"\r\n       src=\"https://lh3.googleusercontent.com/YmMGcgeO7Km9-J9vFRByov5sb7OUKetnKs8pTi0JZMDj3GVJ61GMTcTlHB7u9uHDHag=w96\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://twitter.com/RayLiVerified\"\u003e\r\n  \u003cimg alt=\"Ray Li Twitter\"\r\n       src=\"https://lh3.ggpht.com/lSLM0xhCA1RZOwaQcjhlwmsvaIQYaP3c5qbDKCgLALhydrgExnaSKZdGa8S3YtRuVA=w96\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://linkedin.com/in/rayliverified/\"\u003e\r\n  \u003cimg alt=\"Ray Li LinkedIn\"\r\n       src=\"https://lh3.googleusercontent.com/00APBMVQh3yraN704gKCeM63KzeQ-zHUi5wK6E9TjRQ26McyqYBt-zy__4i8GXDAfeys=w90\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://www.uplabs.com/ray\"\u003e\r\n  \u003cimg alt=\"Ray Li UpLabs\"\r\n       src=\"https://lh3.googleusercontent.com/fDJB4jtIgZQF_Dj7AFAPEv2dJOJE8LaLSbaiOOFejQJl3oFbkOLLScstkp699oMDcEU=w90\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://github.com/searchy2\"\u003e\r\n  \u003cimg alt=\"Ray Li GitHub\"\r\n       src=\"https://lh3.googleusercontent.com/L15QqmKK7Vl-Ag1ZxaBqNQlXVEw58JT2BDb-ef5t2eboDh0pPSLjDgi3-aQ3Opdhhyk=w96\" /\u003e\r\n\u003c/a\u003e\r\n\r\n# Apps Using This Library\r\n\r\nAdd your app here by making a `pull request`. \r\n\r\n\u003ctable\u003e\r\n    \u003ctr\u003e\r\n\t\t\u003ctd\u003e\u003cimg src=\"https://lh3.googleusercontent.com/tYGJBG8mc7lwC0ZxQUxif2FVMFI8L8xRkPON0ytkWVPTI67ggkrgDl3JpRu9jW0W3sLJ=w64\"/\u003e\u003c/td\u003e\r\n\t\t\u003ctd\u003e\u003ca href=\"https://github.com/searchy2/Rocket-Notes\"\u003eRocket Notes\u003c/a\u003e\u003c/td\u003e\r\n\t\u003c/tr\u003e\r\n\t\u003ctr\u003e\r\n\t\t\u003ctd\u003e\u003cimg src=\"https://lh3.googleusercontent.com/R-vJInTblK1KBOqZaSDm_ac270QBHsiIcU9agHnN-rrp9K_lkN8rLzGIH8asCfkb420Q=w64\"/\u003e\u003c/td\u003e\r\n\t\t\u003ctd\u003e\u003ca href=\"https://play.google.com/store/apps/details?id=io.ideastarter\"\u003eCrowdfunding Community\u003c/a\u003e\u003c/td\u003e\r\n\t\u003c/tr\u003e\r\n    \u003ctr\u003e\r\n\t\t\u003ctd\u003e\u003cimg src=\"https://lh3.googleusercontent.com/CT1M2pKlUhGx4w5UHqarn6oSU_sa7L7XRW2-hQrfNi9oou6W81PbJnWi-9PbEfC_3g=w64\"/\u003e\u003c/td\u003e\r\n\t\t\u003ctd\u003e\u003ca href=\"https://play.google.com/store/apps/details?id=com.blankicon\"\u003eBlank Icon\u003c/a\u003e\u003c/td\u003e\r\n\t\u003c/tr\u003e\r\n\u003c/table\u003e\r\n\r\n## Search Terms\r\nandroid button, outline button, button with outline, simple, elegant, iOS button, style, UI, beautiful, customizable button\r\n\r\n## License\r\n\r\n    BSD Zero Clause License\r\n\r\n    Copyright © 2020 Ray Li\r\n\r\n    Permission to use, copy, modify, and/or distribute this software for any\r\n    purpose with or without fee is hereby granted.\r\n\r\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n    PERFORMANCE OF THIS SOFTWARE.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayliverified%2Fcustombutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayliverified%2Fcustombutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayliverified%2Fcustombutton/lists"}