{"id":16558067,"url":"https://github.com/shiburagi/stylish-widget-for-android","last_synced_at":"2025-03-21T10:32:33.163Z","repository":{"id":133450259,"uuid":"59943718","full_name":"shiburagi/Stylish-Widget-for-Android","owner":"shiburagi","description":"StylishWidget is a library for an Android Application project to make the UI more beautiful and allow to use third party font. This library also contain few view that created by me.","archived":false,"fork":false,"pushed_at":"2019-11-26T11:24:00.000Z","size":7412,"stargazers_count":40,"open_issues_count":1,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T05:41:18.250Z","etag":null,"topics":["android","android-application","material-design","messagebox","meters","textview","ui","ui-components","widget"],"latest_commit_sha":null,"homepage":"https://shiburagi.github.io/Stylish-Widget-for-Android/","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/shiburagi.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":"2016-05-29T13:12:32.000Z","updated_at":"2024-07-08T01:55:35.000Z","dependencies_parsed_at":"2023-04-03T15:19:10.348Z","dependency_job_id":null,"html_url":"https://github.com/shiburagi/Stylish-Widget-for-Android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiburagi%2FStylish-Widget-for-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiburagi%2FStylish-Widget-for-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiburagi%2FStylish-Widget-for-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiburagi%2FStylish-Widget-for-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiburagi","download_url":"https://codeload.github.com/shiburagi/Stylish-Widget-for-Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244135894,"owners_count":20403797,"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-application","material-design","messagebox","meters","textview","ui","ui-components","widget"],"created_at":"2024-10-11T20:09:30.892Z","updated_at":"2025-03-21T10:32:33.145Z","avatar_url":"https://github.com/shiburagi.png","language":"Java","funding_links":["https://ko-fi.com/A0A0FB3V'","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=D9JKYQL8452AL"],"categories":[],"sub_categories":[],"readme":"# StylishWidget\n\n[ ![Download](https://api.bintray.com/packages/infideap2/Stylish-Widget/Stylish-Widget/images/download.svg) ](https://bintray.com/infideap2/Stylish-Widget/Stylish-Widget/_latestVersion)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Stylish%20Widget-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6338)\n\n**StylishWidget** is a library for an **Android Application project** to make the **UI more beautiful** and allow to use **third party font**.\nThis library also contain few view that created by me and,\nI use it in my previous and current android project and may got an issue and error. \nI will keep improve this library until it stable and useful.\n\n## New update\n * Bootstrap 4 color scheme\n * Add Field for Custom Bold Italic Font\n * Meter added\n * custom declare-styleable prefix added\n * Show picker dialog for date/time input type\n\n## Features\n * set custom font for almost all view.\n * Message Box\n * Progress Bar\n\nAndroid 7.0+ support\n\n![Alt Text](https://raw.githubusercontent.com/shiburagi/Stylish-Widget-for-Android/master/preview_2.gif)\n\n## Download\n * **JAR** : (https://github.com/shiburagi/Stylish-Widget-for-Android/tree/master/stylishwidget/jar)\n * **APK** : (https://drive.google.com/file/d/0Bw_drx3o3plaZVptWWNxWUdfSmM/view?usp=sharing) \n\n---\n\n\u003ca href='https://ko-fi.com/A0A0FB3V' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=D9JKYQL8452AL)\n\n## Including In Your Project\nThis library is presented as a `.jar` file which you can include in the `libs/`\nfolder of your application. You can download the latest version from the\n[github repo](https://github.com/shiburagi/Stylish-Widget-for-Android/tree/master/stylishwidget/jar).\n\nIf you are a Maven user you can easily include the library by specifying it as\na dependency:\n\n### Latest Version (1.5.1)\n#### Maven\n``` xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.app.infideap.stylishwidget\u003c/groupId\u003e\n  \u003cartifactId\u003estylish-widget\u003c/artifactId\u003e\n  \u003cversion\u003e1.5.1\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n#### Gradle\n```groovy\ndependencies {\n   implementation 'com.app.infideap.stylishwidget:stylish-widget:1.4.2-alpha'\n}\n```\n\u003chr/\u003e\n\n### Stable Version (1.5.1)\n#### Maven\n``` xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.app.infideap.stylishwidget\u003c/groupId\u003e\n  \u003cartifactId\u003estylish-widget\u003c/artifactId\u003e\n  \u003cversion\u003e1.5,1\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n#### Gradle\n```groovy\ndependencies {\n   implementation 'com.app.infideap.stylishwidget:stylish-widget:1.3.9'\n}\n```\n\n**or**,\nyou can include it by **download this project** and **import /stylishwidget** as **module**.\n\n## Usage\n\n**NOTE:** If you want to use **third-party font**, must **initialize** this line of code at the **top of onCreate() in main activity**, or at the **onCreate() of Custom** Application.\n\n``` java\n// parameter : Normal Font, Bold Font and Italic Font\nString fontFolder = \"Exo_2/Exo2-\";\nStylish.getInstance().set(\n                fontFolder.concat(\"Regular.ttf\"),\n                fontFolder.concat(\"Bold.ttf\"),\n                fontFolder.concat(\"Italic.ttf\"));\n```\n**or**\n``` java\n// parameter : Normal Font, Bold Font, Italic Font and Bold Italic Font\nString fontFolder = \"Exo_2/Exo2-\";\nStylish.getInstance().set(\n                fontFolder.concat(\"Regular.ttf\"),\n                fontFolder.concat(\"Bold.ttf\"),\n                fontFolder.concat(\"Italic.ttf\"),\n                fontFolder.concat(\"BoldItalic.ttf\"));\n```\n**or**\n``` java\nString fontFolder = \"Exo_2/Exo2-\";\n// parameter : Normal Font\nStylish.getInstance().setFontRegular(\n                fontFolder.concat(\"Regular.ttf\")\n);\n// parameter : Bold Font\nStylish.getInstance().setFontBold(\n                fontFolder.concat(\"Bold.ttf\")\n);\n// parameter : Italic Font\nStylish.getInstance().setFontItalic(\n                fontFolder.concat(\"Italic.ttf\"))\n);\n// parameter : Bold Italic Font\nStylish.getInstance().setFontBoldItalic(\n                fontFolder.concat(\"BoldItalic.ttf\"))\n);\n```\n\n\n\n## Widget\n\n\u003cimg src=\"https://raw.githubusercontent.com/shiburagi/Stylish-Widget-for-Android/master/Screenshot_1502705147.png\" width=\"300px\"\u003e\n\nto **use the widget**, is **same** like using **android widget**\n\n**EditText**\n``` xml\n\u003ccom.app.infideap.stylishwidget.view.AEditText\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:hint=\"@string/editextexample\" /\u003e\n```\n#### Latest Version (1.4.2-alpha or above)\nEditText will **Date/Time input type** will display **Picker Dialog** on click.\n\n``` xml\n\u003ccom.app.infideap.stylishwidget.view.AEditText\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:inputType=\"datetime\"\nandroid:hint=\"@string/editextexample\" /\u003e\n```\n\n\n**TextView**\n``` xml\n\u003ccom.app.infideap.stylishwidget.view.ATextView\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:paddingLeft=\"5dp\"\nandroid:paddingRight=\"5dp\"\nandroid:text=\"@string/textviewexamplebold\"\nandroid:textAppearance=\"@style/TextAppearance.AppCompat.Medium\"\nandroid:textStyle=\"bold\" /\u003e\n```\n\n**CheckBox**\n``` xml\n\u003ccom.app.infideap.stylishwidget.view.ACheckBox\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\nandroid:text=\"@string/checkboxexample\"/\u003e\n```\n\n**RadioButton**\n``` xml\n\u003ccom.app.infideap.stylishwidget.view.ARadioButton\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\nandroid:text=\"@string/radiobuttonexample\"/\u003e\n```\n\n\n\n## Button\n\n\u003cimg src=\"https://raw.githubusercontent.com/shiburagi/Stylish-Widget-for-Android/master/Screenshot_1502704613.png\" align=\"left\"  width=\"300px\" \u003e\n\u003ca href=\"url\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/shiburagi/Stylish-Widget-for-Android/master/Screenshot_1502704667.png\"  width=\"300px\" \u003e\u003c/a\u003e\n\n``` xml\n\u003ccom.app.infideap.stylishwidget.view.AButton\nstyle=\"@style/Button.Default\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:text=\"Default\" /\u003e\n```\n\n\n\n## Message Box\n\n\u003cimg src=\"https://raw.githubusercontent.com/shiburagi/Stylish-Widget-for-Android/master/Screenshot_1502705154.png\" width=\"300px\" \u003e\n\n``` xml\n\u003ccom.app.infideap.stylishwidget.view.MessageBox\nandroid:id=\"@+id/message_info\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"wrap_content\"\napp:sw_boxBackground=\"@color/colorSuccess\"\napp:sw_message=\"@string/helloworld\" /\u003e\n```\n\nfor the **MessageBox**, there are several **new declare-styleable** need to **highlight**,\n* app:sw_boxBackground - to set background color, only color allow.\n* app:sw_message - to set display text.\n* app:sw_textStyle - to set textView style, (normal, bold, italic).\n* app:sw_innerPadding - to set inner padding of message box.\n* app:sw_innerLeftPadding - to set inner left padding of message box.\n* app:sw_innerTopPadding - to set inner top padding of message box.\n* app:sw_innerRightPadding - to set inner right padding of message box.\n* app:sw_innerBottomPadding - to set inner bottom padding of message box.\n* app:sw_drawable - to set textView drawable.\n* app:sw_drawablePadding - to set padding of textView drawable.\n\nand for **MessageBox** there are **two kind** of **listener or action mode**,\n\n1) CloseButton, display as close icon\n``` java\ninfoMessageBox.setCloseButton(new View.OnClickListener() {\n  @Override\n  public void onClick(View v) {\n      AlertDialog dialog = new AlertDialog.Builder(MainActivity.this)\n              .setMessage(\"Close Button Click!\").create();\n      dialog.show();\n\n      infoMessageBox.setVisibility(View.GONE);\n  }\n});\n```\n\n2) ActionButton, display as outline button with a text\n``` java\nwarningMessageBox.setActionButton(R.string.learnmore, new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        AlertDialog dialog = new AlertDialog.Builder(MainActivity.this)\n                .setMessage(\"Warning Action Click!\").create();\n        dialog.show();\n    }\n});\n```\n\nhowever, only **one action** can be use for **a MessageBox**\n\n\n\n## Progress Bar\n\n\u003cimg src=\"https://raw.githubusercontent.com/shiburagi/Stylish-Widget-for-Android/master/Screenshot_1502705158.png\"  width=\"300px\" \u003e\n\n**Sample code (XML):**\n``` xml\n \u003ccom.app.infideap.stylishwidget.view.AProgressBar\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"30dp\"\n            app:sw_maxValue=\"100\"\n            app:sw_progressBackground=\"#ccc\"\n            app:sw_progressColor=\"@color/colorAccent\"\n            app:sw_progressText=\"30%\"\n            app:sw_progressTextStyle=\"bold\"\n            app:sw_progressValue=\"30\"\n            app:sw_radius=\"7dp\"\n            app:sw_withAnimation=\"true\" /\u003e\n```\n\nHere the **list** of available attributes for progress bar,\n``` xml\n\u003cattr name=\"sw_maxValue\" format=\"float\" /\u003e\n\u003cattr name=\"sw_progressValue\" format=\"float\" /\u003e\n\u003cattr name=\"sw_radius\" format=\"dimension\" /\u003e\n\u003cattr name=\"sw_progressColor\" format=\"color\" /\u003e\n\u003cattr name=\"sw_progressText\" format=\"string\" /\u003e\n\u003cattr name=\"sw_progressTextSize\" format=\"dimension\" /\u003e\n\u003cattr name=\"sw_progressTextStyle\" format=\"enum\"\u003e\n  \u003cenum name=\"normal\" value=\"0\" /\u003e\n  \u003cenum name=\"bold\" value=\"1\" /\u003e\n  \u003cenum name=\"italic\" value=\"2\" /\u003e\n\u003c/attr\u003e\n\u003cattr name=\"sw_progressPadding\" format=\"dimension\" /\u003e\n\u003cattr name=\"sw_progressIconPadding\" format=\"dimension\" /\u003e\n\u003cattr name=\"sw_withAnimation\" format=\"boolean\" /\u003e\n\u003cattr name=\"sw_duration\" format=\"integer\"/\u003e\n\u003cattr name=\"sw_progressTextAppearance\" format=\"reference\"/\u003e\n\u003cattr name=\"sw_progressBackground\" format=\"color\"/\u003e\n\u003cattr name=\"sw_progressIcon\" format=\"reference\"/\u003e\n```\nand, here the list of all declare function in AProgressBar class,\n``` java\nsetProgressBackground(int color) \ngetProgressValue()\ngetProgressValue(int index)\nsetPadding(int padding)\nsetMaxValue(float value)\nsetProgressValue(float value)\nsetProgressValue(int index, float value)\nsetProgressValues(float ...values)\naddProgressValue(float value)\naddProgressValue(float value, int color)\nremoveProgressValue(int index)\nsetProgressColor(int color)\nsetProgressColor(int index, int color)\nsetProgressColors(int ...colors)\nsetProgressValueWithColor(int index, float value, int color)\nsetProgressText(int resId)\nsetProgressText(String text)\nsetProgressText(int index, int resId)\nsetProgressText(int index, String text)\nsetProgressTexts(int ...resId)\nsetProgressTexts(String ...texts)\nsetProgressValueAndText(int index, float value, int resId)\nsetProgressValueAndText(int index, float value, String text)\nsetProgressIcon(int resId)\nsetProgressIcon(Drawable icon)\nsetProgressIcon(int index, int resId)\nsetProgressIcon(int index, Drawable icon)\nsetProgressIcons(int ...resId)\nsetProgressIcons(Drawable ...icons)\nsetGravity(int gravity)\nwithAnimation(long duration)\nsetProgressTextStyle(int textStyle)\nsetProgressTextAppearance(int resId)\nsetProgressIconPadding(int padding)\n```\n\n### Example for multiple progress bar,\n``` java\nAProgressBar iconMultiProgressBar =\n        (AProgressBar) view.findViewById(R.id.progressBar_multi_icon);\niconMultiProgressBar.setProgressValues(\n        30,\n        150,\n        90,\n        70);\n\niconMultiProgressBar.setProgressColors(\n        Color.parseColor(\"#039BE5\"),\n        Color.parseColor(\"#8BC34A\"),\n        Color.parseColor(\"#FBC02D\"),\n        Color.parseColor(\"#f44336\"));\n\niconMultiProgressBar.setProgressTexts(\n        \"30%\",\n        \"150%\",\n        \"90%\",\n        \"70%\"\n);\niconMultiProgressBar.setProgressIcons(\n    R.drawable.ic_directions_run_white_24dp,\n    R.drawable.ic_directions_bike_white_24dp,\n    R.drawable.ic_directions_boat_white_24dp,\n    R.drawable.ic_directions_subway_white_24dp\n);\n\niconMultiProgressBar.setMaxValue(100);\niconMultiProgressBar.withAnimation(1000);\n```\nFor more **progress bar example**, please refer on the link below :\n\nhttps://github.com/shiburagi/Stylish-Widget-for-Android/blob/master/app/src/main/java/com/app/infideap/mystylishexample/ProgressBarFragment.java\n\n## Meter\n\n\u003cimg src=\"https://raw.githubusercontent.com/shiburagi/Stylish-Widget-for-Android/master/Screenshot_1502705141.png\"  width=\"300px\" \u003e\n\n**Sample code (XML):**\n``` xml\n \u003ccom.app.infideap.stylishwidget.view.AMeter\n            android:id=\"@+id/meter\"\n            android:background=\"@color/colorPrimary\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\"\n            app:sw_maxValue=\"10\"\n            app:sw_meterColor=\"@color/colorWhite\"\n            app:sw_showText=\"true\"\n            app:sw_value=\"8\" /\u003e\n```\nhere the list of all declare function in IndicatorTabLayout.IndicatorTab class,\n``` java\nsetValue(float) : void\nsetMaxValue(float) : void\nsetMeterColor(int) : void\nsetTextStyle(int) : void\nsetTextSize(float) : void\nsetShowText(boolean) : void\ngetValue(int) : float\ngetMaxValue() : float\ngetMeterColor() : int\nisShowText() : int\n```\n\n### Example for Meter,\n``` java\nAMeter meter = (AMeter) view.findViewById(R.id.meter);\nmeter.setMaxValue(100);\n```\nFor more **Meter**, please refer on the link below :\n\nhttps://github.com/shiburagi/Stylish-Widget-for-Android/blob/master/app/src/main/java/com/app/infideap/mystylishexample/MeterFragment.java\n\n## Contact\nFor any enquiries, please send an email to tr32010@gmail.com. \n\n## License\n\n    Copyright 2016-2017 Shiburagi\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiburagi%2Fstylish-widget-for-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiburagi%2Fstylish-widget-for-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiburagi%2Fstylish-widget-for-android/lists"}