{"id":13427840,"url":"https://github.com/mikepenz/Android-Iconics","last_synced_at":"2025-03-16T00:32:32.744Z","repository":{"id":22716930,"uuid":"26061231","full_name":"mikepenz/Android-Iconics","owner":"mikepenz","description":"Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.","archived":false,"fork":false,"pushed_at":"2024-08-22T20:43:31.000Z","size":16330,"stargazers_count":5187,"open_issues_count":7,"forks_count":615,"subscribers_count":159,"default_branch":"develop","last_synced_at":"2024-10-16T12:21:20.255Z","etag":null,"topics":["android","android-compose","android-development","android-icon","android-library","compose","fontawesome","foundation-icons","google-material","google-material-icons","icon-font","java","material","material-components","material-design","material-icons","material-ui","meteocons","mikepenz","weather-icons"],"latest_commit_sha":null,"homepage":"https://mikepenz.dev","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"vuejs/awesome-vue","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikepenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["mikepenz"]}},"created_at":"2014-11-01T19:43:56.000Z","updated_at":"2024-10-15T15:05:24.000Z","dependencies_parsed_at":"2024-05-30T09:27:58.166Z","dependency_job_id":"55e6d403-72d4-4033-a84e-76a211e5d2be","html_url":"https://github.com/mikepenz/Android-Iconics","commit_stats":null,"previous_names":[],"tags_count":123,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2FAndroid-Iconics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2FAndroid-Iconics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2FAndroid-Iconics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikepenz%2FAndroid-Iconics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikepenz","download_url":"https://codeload.github.com/mikepenz/Android-Iconics/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221631817,"owners_count":16855013,"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-compose","android-development","android-icon","android-library","compose","fontawesome","foundation-icons","google-material","google-material-icons","icon-font","java","material","material-components","material-design","material-icons","material-ui","meteocons","mikepenz","weather-icons"],"created_at":"2024-07-31T01:00:41.157Z","updated_at":"2024-10-27T05:30:30.401Z","avatar_url":"https://github.com/mikepenz.png","language":"Kotlin","readme":"# Android-Iconics\n\n... allows to include any icon font with all its vector icons in your project. No limits. **Scale with no limit**, use **any color** at any time, provide a **contour**, and many additional customizations...\n\n-------\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#whats-included-\"\u003eWhat's included 🚀\u003c/a\u003e \u0026bull;\n    \u003ca href=\"#setup\"\u003eSetup 🛠️\u003c/a\u003e \u0026bull;\n    \u003ca href=\"MIGRATION.md\"\u003eMigration Guide 🧬\u003c/a\u003e \u0026bull;\n    \u003ca href=\"FAQ.md\"\u003eWIKI / FAQ 📖\u003c/a\u003e \u0026bull;\n    \u003ca href=\"#create-custom-fonts\"\u003eCustom Font 🖍️\u003c/a\u003e \u0026bull;\n    \u003ca href=\"https://play.google.com/store/apps/details?id=com.mikepenz.iconics.sample\"\u003eSample App\u003c/a\u003e\n\u003c/p\u003e\n\n-------\n\n### What's included 🚀\n- No customization limitations (size, color, contour, background, padding, positioning, ...)\n- Shadow support\n- Use as XML Drawable starting API 24\n- One icon source (no more mdpi, hdpi, ...)\n- Flexibility\n  - Size\n  - Colors\n  - Contour\n  - Shadow\n  - Auto mirroring for RTL (opt-in)\n- If it takes a Drawable, it will also work with the IconicsDrawable!\n- Save in APK size\n- Compose support\n\n**Already available fonts**\n- [Google Material Design Icons](https://github.com/google/material-design-icons)\n- [Material Design Iconic Font](http://zavoloklom.github.io/material-design-iconic-font)\n- [Fontawesome](https://fontawesome.com/)\n- [Meteocons](http://www.alessioatzeni.com/meteocons/)\n- [Octicons](https://github.com/github/octicons)\n- [Community Material](http://materialdesignicons.com/)\n- [Weather Icons](https://erikflowers.github.io/weather-icons/)\n- [Typeicons](http://typicons.com/)\n- [Entypo](http://www.entypo.com/)\n- [Devicon](http://devicon.fr/)\n- [Foundation Icons](http://zurb.com/playground/foundation-icon-fonts-3)\n- [Ionicons](http://ionicons.com/)\n- [Material Design DX](https://jossef.github.io/material-design-icons-iconfont/)\n- [Pixeden 7 Stroke](https://themes-pixeden.com/font-demos/7-stroke/)\n- [Phosphor](https://phosphoricons.com/)\n- [Simple Icons](https://simpleicons.org/)\n- Or create your own font with any icon needed.\n\n# Setup\n\n## Latest releases 🛠\n\n- Kotlin | [v5.4.0](https://github.com/mikepenz/Android-Iconics/tree/v5.4.0)\n- Pre-Release | [v5.5.0-b01](https://github.com/mikepenz/Android-Iconics/tree/v5.5.0-b01)\n\n## 1. Provide the gradle dependency\n```gradle\ndependencies {\n    //the core iconics library (without any widgets)\n    implementation \"com.mikepenz:iconics-core:${latestAndroidIconicsRelease}\"\n    implementation \"androidx.appcompat:appcompat:${versions.appCompat}\"\n}\n```\n\n## 1b. (optional) Add the view's dependency\n```gradle\n//this adds all ui view widgets (IconicsButton, IconicsImageView, ...)\nimplementation \"com.mikepenz:iconics-views:${latestAndroidIconicsRelease}\"\n```\n\n## 2. Choose your desired fonts\n\n\u003e [!NOTE]\n\u003e Fonts ending with `-kotlin` require at least v4.x of Android-Iconics\n\u003e v5.1.x or newer requires the latest font versions\n\n```gradle\nimplementation 'com.mikepenz:google-material-typeface:4.0.0.3-kotlin@aar'\nimplementation 'com.mikepenz:google-material-typeface-{outlined|rounded|sharp}:4.0.0.2-kotlin@aar'\nimplementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.9-kotlin@aar'\nimplementation 'com.mikepenz:fontawesome-typeface:5.9.0.3-kotlin@aar'\nimplementation 'com.mikepenz:octicons-typeface:11.1.0.1-kotlin@aar'\nimplementation 'com.mikepenz:meteocons-typeface:1.1.0.8-kotlin@aar'\nimplementation 'com.mikepenz:community-material-typeface:7.0.96.1-kotlin@aar' // note 5.3.45.1 and newer alphabetically sorts, and merges in 3 sections\nimplementation 'com.mikepenz:weather-icons-typeface:2.0.10.8-kotlin@aar'\nimplementation 'com.mikepenz:typeicons-typeface:2.0.7.8-kotlin@aar'\nimplementation 'com.mikepenz:entypo-typeface:1.0.0.8-kotlin@aar'\nimplementation 'com.mikepenz:devicon-typeface:2.0.0.8-kotlin@aar'\nimplementation 'com.mikepenz:foundation-icons-typeface:3.0.0.8-kotlin@aar'\nimplementation 'com.mikepenz:ionicons-typeface:2.0.1.8-kotlin@aar'\nimplementation 'com.mikepenz:pixeden-7-stroke-typeface:1.2.0.6-kotlin@aar'\nimplementation 'com.mikepenz:material-design-icons-dx-typeface:5.0.1.3-kotlin@aar'\nimplementation 'com.mikepenz:phosphor-typeface:1.0.0.1-kotlin@aar'\nimplementation 'com.mikepenz:simple-icons-typeface:17.0.0.3@aar'\n```\n\n\u003e [!NOTE]\n\u003e For users of the version catalog, it is not possible to add the type, however you can do so via\n\u003e the implementation definition.\n\u003e `implementation(libs.material.typeface) { artifact { type = \"aar\" } }`\n\n\u003e [!WARNING]  \n\u003e The fonts use the `jetpack startup` library to automatically register themselves.\n\u003e If `jetpack startup` is disabled,\n\u003e it is required to manually register the fonts. Please find additional details in\n\u003e the [Register fonts](#register-fonts).\n\n\n# Usage\n\n\u003e [!NOTE]  \n\u003e It might be required to call `Iconics.init(applicationContext)` if no context based APIs are used\n\u003e from the library otherwise.\n\n## Use as drawable\n\n```kotlin\nIconicsDrawable(this, FontAwesome.Icon.faw_android).apply {\n    colorInt = Color.RED\n    sizeDp = 24\n}\n```\n\n## Use via XML\n\nIf you use the Iconics library via XML provide the icon you want to use in the following syntax: `gmd-favorite` --\u003e `fontId`-`iconName`. A list of the\navailable fonts and their `fontId` can be found [here](#available-fonts).\nAll icon names from the default fonts can be found via the [DEMO](https://play.google.com/store/apps/details?id=com.mikepenz.iconics.sample) application.\n\n#### Notation within text\nUse the `{` icon-definer `}` syntax\n```gson\nSome great text with a {faw-android} font awesome icon and {met-wind} meteocons icons.\n```\n\n### Drawable XML (API 24+)\n\nSpecify the drawable in your `drawable` folder.\n\n```xml\n\u003ccom.mikepenz.iconics.IconicsDrawable\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    app:ico_icon=\"gmd_favorite\"\n    app:ico_color=\"#0000FF\"\n    app:ico_contour_width=\"1dp\"\n    app:ico_contour_color=\"#00FFFF\"\n    app:ico_size=\"24dp\" /\u003e\n    // all custom theming attributes supported\n```\n\nUse like any normal drawable in your application.\nThis feature was suggested and initially provided by @dzamlo\n\n### Custom Views\n#### As IconicsImageView\n```xml\n\u003ccom.mikepenz.iconics.view.IconicsImageView\n    android:layout_width=\"72dp\"\n    android:layout_height=\"72dp\"\n    app:iiv_color=\"@android:color/holo_red_dark\"\n    app:iiv_icon=\"gmd-favorite\" /\u003e  // or @string/gmd_favorite with our generator\n    //app:iiv_size=\"12dp\"\n    //app:iiv_padding=\"2dp\"\n    //app:iiv_contour_color=\"#FF0000\"\n    //app:iiv_contour_width=\"2dp\"\n    //app:iiv_background_color=\"#FFFF00\"\n    //app:iiv_corner_radius=\"2dp\"\n    //app:iiv_background_contour_color=\"#FF0000\"\n    //app:iiv_background_contour_width=\"1dp\"\n    //app:iiv_shadow_radius=\"4dp\"\n    //app:iiv_shadow_dx=\"1dp\"\n    //app:iiv_shadow_dy=\"1dp\"\n    //app:iiv_animations=\"spin|blink_alpha|blink_scale\"\n```\n\n#### As IconicsTextView\n```xml\n\u003ccom.mikepenz.iconics.view.IconicsTextView\n    android:text=\"abc{hif-test}defgh{faw-adjust}ijk{fon-test1}lmnopqrstuv{fon-test2}wxyz\"\n    android:textColor=\"@android:color/black\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"56dp\"\n    android:textSize=\"16sp\"/\u003e\n```\n\n#### As IconicsButton\n```xml\n\u003ccom.mikepenz.iconics.view.IconicsButton\n    android:text=\"{faw-adjust} Button\"\n    android:layout_width=\"120dp\"\n    android:layout_height=\"60dp\"/\u003e\n```\n\n## Compose\n\nTo include the experimental compose support in your project add the following dependency to your project (since v5.2.0)\n\n```gradle\nimplementation \"com.mikepenz:iconics-compose:${latestAndroidIconicsRelease}\"\n```\n\nUse the provided `Image` wrapper and set the icon.\n\n```kotlin\nImage(\n    GoogleMaterial.Icon.gmd_access_alarm,\n    colorFilter = ColorFilter.tint(MaterialTheme.colors.primary),\n)\n```\n\n# Screenshots\n\n![Image](https://raw.githubusercontent.com/mikepenz/Android-Iconics/develop/DEV/github/screenshots1.jpg)\n\n# Available fonts\n\n| Link                                                                                                              | Prefix          | Dependency                                                                            |\n|-------------------------------------------------------------------------------------------------------------------|-----------------|---------------------------------------------------------------------------------------|\n| [Google Material Design Icons](https://github.com/google/material-design-icons) **ORIGINAL by\nGoogle**            | gmd,gmo,gmr,gms | implementation 'com.mikepenz:google-material-typeface{-outlined,rounded,sharp}:+@aar' |\n| [Material Design Iconic Font](http://zavoloklom.github.io/material-design-iconic-font) **Google Material\nIconic** | gmi             | implementation 'com.mikepenz:material-design-iconic-typeface:+@aar'                   |\n| [Fontawesome](https://fontawesome.com/)                                                                           | faw             | implementation 'com.mikepenz:fontawesome-typeface:+@aar'                              |\n| [FontawesomeBrand](https://fontawesome.com/)                                                                      | fab             | implementation 'com.mikepenz:fontawesome-typeface:+@aar'                              |\n| [FontawesomeRegular](https://fontawesome.com/)                                                                    | far             | implementation 'com.mikepenz:fontawesome-typeface:+@aar'                              |\n| [Meteocons](http://www.alessioatzeni.com/meteocons/)                                                              | met             | implementation 'com.mikepenz:meteocons-typeface:+@aar'                                |\n| [Octicons](https://github.com/github/octicons)                                                                    | oct             | implementation 'com.mikepenz:octicons-typeface:+@aar'                                 |\n| [Community Material](http://materialdesignicons.com/)                                                             | cmd             | implementation 'com.mikepenz:community-material-typeface:+@aar'                       |\n| [Weather Icons](https://erikflowers.github.io/weather-icons/)                                                     | wic             | implementation 'com.mikepenz:weather-icons-typeface:+@aar'                            |\n| [Typeicons](http://typicons.com/)                                                                                 | typ             | implementation 'com.mikepenz:typeicons-typeface:+@aar'                                |\n| [Entypo](http://www.entypo.com/)                                                                                  | ent             | implementation 'com.mikepenz:entypo-typeface:+@aar'                                   |\n| [Devicon](http://devicon.fr/)                                                                                     | dev             | implementation 'com.mikepenz:devicon-typeface:+@aar'                                  |\n| [Foundation Icons](https://github.com/zurb/foundation-icon-fonts)                                                 | fou             | implementation 'com.mikepenz:foundation-icons-typeface:+@aar'                         |\n| [Ionicons](http://ionicons.com/)                                                                                  | ion             | implementation 'com.mikepenz:ionicons-typeface:+@aar'                                 |\n| [Pixden7Stroke](http://themes-pixeden.com/font-demos/7-stroke/)                                                   | pe7             | implementation 'com.mikepenz:pixeden-7-stroke-typeface:+@aar'                         |\n| [Material Design DX](https://jossef.github.io/material-design-icons-iconfont/)                                    | cmf             | implementation 'com.mikepenz:material-design-icons-dx-typeface:+@aar'                 |\n| [Phosphor Icons](https://phosphoricons.com/)                                                                      | pho             | implementation 'com.mikepenz:phosphor-typeface:+@aar'                                 |\n| [Simple Icons](https://simpleicons.org/)                                                                          | sim             | implementation 'com.mikepenz:simple-icons-typeface:+@aar'                             |\n\nLicenses for all included fonts are linked inside the class or can be found on the coresponding repositories.\n\n# Compatibility Note\n\n### appcompat:1.4.x\n\nAppcompat v1.4.x introduces default enabled emoji support into all `AppCompat*` views, which prevents the `IconicsView*` views (iconics-views module) from properly applying the spannable style.\nTo fix this problem, emoji support has to be disabled by doing:\n\n```xml\napp:emojiCompatEnabled=\"false\"\n```\n\nMore information on the appcompat emoji support: https://developer.android.com/jetpack/androidx/releases/appcompat#1.4.0-alpha01\n\n# Advanced Usage\n\n### Register fonts\n\nIf you want to add your own custom font, or a GenericFont you have to register this font (before using it). The best place to do this is the `Application`.\n\nAnd initialize Iconics as you wish\n```kotlin\nclass CustomApplication : Application() {\n    override fun onCreate() {\n        super.onCreate()\n\n        //register custom fonts like this (or also provide a font definition file)\n        Iconics.registerFont(CustomFont())\n    }\n}\n```\n\n### Advanced IconicsBuilder\nEverything is easy and simple. Right? But now you got a single icon within your textview and you need additional styling?\nJust define the style for all icons or only a specific one. You can find this in the PlaygroundActivity of the sample too.\n```kotlin\nIconics.Builder()\n    .style(ForegroundColorSpan(Color.WHITE), BackgroundColorSpan(Color.BLACK), RelativeSizeSpan(2f))\n    .styleFor(FontAwesome.Icon.faw_adjust, BackgroundColorSpan(Color.RED))\n    .on(tv1)\n    .build()\n```\n\n### String icon-key or typeface enum\nSometimes you won't like to use the icon-key (\"faw-adjust\") like this, but use the enum provided by a specific font. Both is valid:\n```kotlin\nIconicsDrawable(this, \"faw-adjust\").actionBar()\n```\n```kotlin\nIconicsDrawable(this, FontAwesome.Icon.faw_adjust).apply {\n    sizeDp = 24\n    paddingDp = 1\n}\n```\n\n## Create custom fonts\nThis is possible with only the *.ttf and *.css mapping file. And will take you 2 minutes.\n\nYou can get these two files by downloading a web icon font, or if you want to create your\nown custom icon font from *.svg files then you can use following tools:\n* [Fontello](http://fontello.com)\n* [IcoMoon](http://icomoon.io) \n* [Fontastic](http://app.fontastic.me)\n* let me know if you find other tools.\n\nAfter you got those two files, head over to the icon addon creation tool [android-iconics.mikepenz.com](https://android-iconics.mikepenz.com).\nEnter all the information. Add the *.ttf and *.css and click the button. It will generate and download the icon font addon as\nzip. (this tool is local only, no files are sent to a server, you can safely use it with any icons)\n\n## String fields for icons\nFor generating string field for each of icons of your font, you can use this simple generator:\n[Android-Iconics String Generator](https://github.com/zTrap/Android-Iconics-String-Generator)\n\n## Android module generator\n\nA awesome gradle plugin which can automatically fetch a font from Fontastic, and generate the Android Module for your project.\n[Iconics-Font-Generator](https://github.com/ligol/IconicsFontGenerator)\n\n# ProGuard / R8\n\nProGuard / R8 rules are bundled internally with each font.\n\n# Special Contributor\n- [Baptiste Lagache](https://github.com/ligol) Thanks for the gradle font module generator\n- Also thanks for all the other contributors.\n\n# Credits\n- [Joan Zapata](https://github.com/JoanZapata) He is the creator of [Android-Iconify](https://github.com/JoanZapata/android-iconify) which gave me the idea of this project. Some core concepts and ideas were reused, but everything is written from scratch.\n- [Christopher Jenkins](https://github.com/chrisjenx/) Thanks for the great usage of a custom `ContextWrapper` inside [Calligraphy](https://github.com/chrisjenx/Calligraphy/)\n- [Stephan Schober](https://github.com/tehfonsi)\n\n# Developed By\n\n- Mike Penz\n  - [mikepenz.dev](https://mikepenz.dev) - [blog.mikepenz.dev](https://blog.mikepenz.dev) - \u003cmikepenz@gmail.com\u003e\n  - [paypal.me/mikepenz](http://paypal.me/mikepenz)\n  - [Automatic changelog generation action](https://github.com/marketplace/actions/release-changelog-builder)\n\n- Peter Gulko\n  - [github.com/zTrap](https://github.com/zTrap)\n\n# License\n\n    Copyright 2021 Mike Penz\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","funding_links":["https://github.com/sponsors/mikepenz","http://paypal.me/mikepenz"],"categories":["Java","Libraries","Kotlin","图标","Libs"],"sub_categories":["\u003cA NAME=\"Icons\"\u003e\u003c/A\u003eIcons"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikepenz%2FAndroid-Iconics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikepenz%2FAndroid-Iconics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikepenz%2FAndroid-Iconics/lists"}