{"id":18425670,"url":"https://github.com/zhanghai/appiconloader","last_synced_at":"2025-04-09T17:24:37.329Z","repository":{"id":52495223,"uuid":"250720824","full_name":"zhanghai/AppIconLoader","owner":"zhanghai","description":"Android app icon loader from AOSP iconloaderlib","archived":false,"fork":false,"pushed_at":"2022-09-03T23:33:29.000Z","size":753,"stargazers_count":168,"open_issues_count":3,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T10:43:59.387Z","etag":null,"topics":["android","android-icon","android-library","image-loader","imageloader"],"latest_commit_sha":null,"homepage":"https://play.google.com/store/apps/details?id=me.zhanghai.android.appiconloader.sample","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/zhanghai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-28T05:22:39.000Z","updated_at":"2025-03-25T16:09:08.000Z","dependencies_parsed_at":"2022-08-13T02:00:56.117Z","dependency_job_id":null,"html_url":"https://github.com/zhanghai/AppIconLoader","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FAppIconLoader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FAppIconLoader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FAppIconLoader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghai%2FAppIconLoader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhanghai","download_url":"https://codeload.github.com/zhanghai/AppIconLoader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248075628,"owners_count":21043626,"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-icon","android-library","image-loader","imageloader"],"created_at":"2024-11-06T05:04:48.765Z","updated_at":"2025-04-09T17:24:37.300Z","avatar_url":"https://github.com/zhanghai.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AppIconLoader\n\n[![Android CI status](https://github.com/zhanghai/AppIconLoader/workflows/Android%20CI/badge.svg)](https://github.com/zhanghai/AppIconLoader/actions) [![GitHub release](https://img.shields.io/github/v/release/zhanghai/AppIconLoader)](https://github.com/zhanghai/AppIconLoader/releases) [![License](https://img.shields.io/github/license/zhanghai/AppIconLoader?color=blue)](LICENSE)\n\nAndroid app icon loader from AOSP [iconloaderlib](https://android.googlesource.com/platform/frameworks/libs/systemui/+/refs/heads/master/iconloaderlib/), with optional Glide and Coil integration.\n\nThis is not an officially supported Google product.\n\n## Why AppIconLoader?\n\nBecause [`PackageManager.getApplicationIcon()`](https://developer.android.com/reference/android/content/pm/PackageManager#getApplicationIcon(android.content.pm.ApplicationInfo)) (or [`PackageItemInfo.loadIcon()`](https://developer.android.com/reference/android/content/pm/PackageItemInfo#loadIcon(android.content.pm.PackageManager))) just doesn't work well with [adaptive icons](https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive). Non-adaptive icons usually have some shadow baked in (it's the recommended behavior), however adaptive icons never contain a shadow themselves, so we'll need to manually add the shadow or icons with a white background will just blend into our app's own background.\n\nThis library packaged the AOSP iconloaderlib for loading app icons, which has proper shadow and badging logic, and added easy integration with Glide and Coil.\n\nMeanwhile, by passing `true` for the `shrinkNonAdaptiveIcons` parameter, this library can also synthesize adaptive icons for apps that don't have it.\n\n## Preview\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=me.zhanghai.android.appiconloader.sample\" target=\"_blank\"\u003e\u003cimg alt=\"Google Play\" height=\"90\" src=\"https://play.google.com/intl/en_US/badges/images/generic/en_badge_web_generic.png\"/\u003e\u003c/a\u003e\n\n[Sample APK](https://github.com/zhanghai/AppIconLoader/releases/latest/download/sample-release.apk)\n\n\u003cimg src=\"fastlane/metadata/android/en-US/images/phoneScreenshots/2.png\" width=\"49%\" /\u003e\n\n## Integration\n\nGradle:\n\n```gradle\n// For using with Glide.\nimplementation 'me.zhanghai.android.appiconloader:appiconloader-glide:1.5.0'\n// For using with Coil.\nimplementation 'me.zhanghai.android.appiconloader:appiconloader-coil:1.5.0'\n// For using AppIconLoader directly.\nimplementation 'me.zhanghai.android.appiconloader:appiconloader:1.5.0'\n// For using iconloaderlib directly.\nimplementation 'me.zhanghai.android.appiconloader:appiconloader-iconloaderlib:1.5.0'\n```\n\n## Usage\n\n### Glide integration\n\nSee [Glide's documentation on registering a `ModuleLoader`](https://bumptech.github.io/glide/tut/custom-modelloader.html#registering-our-modelloader-with-glide).\n\nInside your implementation of `AppGlideModule.registerComponents()`, you can have something like the following code fragment:\n\n```java\nint iconSize = context.getResources().getDimensionPixelSize(R.dimen.app_icon_size);\nregistry.prepend(PackageInfo.class, Bitmap.class, new AppIconModelLoader.Factory(iconSize,\n        false, context));\n```\n\nSee also the sample app's [`AppGlideModule` implementation](sample/src/main/java/me/zhanghai/android/appiconloader/sample/AppGlideModule.java).\n\nAfter the setup above, Glide will support loading app icons with the app's `PackageInfo`.\n\n```java\nGlideApp.with(imageView)\n        .load(packageInfo)\n        .into(imageView);\n```\n\n### Coil integration\n\n```kotlin\nval iconSize = context.resources.getDimensionPixelSize(R.dimen.app_icon_size)\nCoil.setImageLoader(\n    ImageLoader.Builder(context)\n        .components {\n            add(AppIconKeyer())\n            add(AppIconFetcher.Factory(iconSize, false, context))\n        }\n        .build()\n)\n```\n\nAfter the setup above, Coil will support loading app icons with the app's `PackageInfo`.\n\n```kotlin\nimageView.loadAny(packageInfo)\n```\n\n### AppIconLoader\n\n[`AppIconLoader`](appiconloader/src/main/java/me/zhanghai/android/appiconloader/AppIconLoader.java) is the API exposed by this library, and you can simply call `AppIconLoader.loadIcon()` to load an app icon. You can also use `AppIconLoader.getIconKey()` to generate a cache key for your loaded icon.\n\n### iconloaderlib\n\nPlease refer to [its source code](https://android.googlesource.com/platform/frameworks/libs/systemui/+/refs/heads/master/iconloaderlib/).\n\n## License\n\n    Copyright 2020 Google LLC\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%2Fzhanghai%2Fappiconloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhanghai%2Fappiconloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghai%2Fappiconloader/lists"}