https://github.com/joshtynjala/openfl-android-adaptive-icon-sample
A sample OpenFL project that adds an adaptive icon for Android
https://github.com/joshtynjala/openfl-android-adaptive-icon-sample
android haxe openfl openfl-samples openfl-target-android
Last synced: 10 months ago
JSON representation
A sample OpenFL project that adds an adaptive icon for Android
- Host: GitHub
- URL: https://github.com/joshtynjala/openfl-android-adaptive-icon-sample
- Owner: joshtynjala
- Created: 2025-01-07T21:38:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-07T21:45:27.000Z (over 1 year ago)
- Last Synced: 2025-09-02T05:59:17.438Z (10 months ago)
- Topics: android, haxe, openfl, openfl-samples, openfl-target-android
- Language: Haxe
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# OpenFL Android adaptive icon
The [OpenFL](https://openfl.org) library for Haxe contains a number of template files that are used when building a project. You can find them in the [_assets/templates_](https://github.com/openfl/openfl/tree/develop/assets/templates) directory. Using the `` element in _project.xml_, it's possible to provide additional template files to copy to the output directory, on a per-project basis, and without forking OpenFL.
This sample project contains a directory named [_custom-templates_](https://github.com/joshtynjala/openfl-android-adaptive-icon-sample/tree/main/custom-templates). It is configured in [_project.xml_](https://github.com/joshtynjala/openfl-android-adaptive-icon-sample/tree/main/project.xml) like this:
```xml
```
Inside [_custom-templates_](https://github.com/joshtynjala/openfl-android-adaptive-icon-sample/tree/main/custom-templates), there's a file at [_android/template/app/src/main/res/mipmap-anydpi-v26/ic\_launcher.xml_](https://github.com/joshtynjala/openfl-android-adaptive-icon-sample/tree/main/custom-templates/android/template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml). This is an Android resource that defines how the icon looks.
To add an adaptive icon to the generated _AndroidManifest.xml_ file, configure it in [_project.xml_](https://github.com/joshtynjala/openfl-android-adaptive-icon-sample/tree/main/project.xml) like this:
```xml
```
To build and launch the project, run the following command:
```sh
openfl test android
```
Sample created by [Josh Tynjala](https://github.com/sponsors/joshtynjala), the author of [Feathers UI](https://feathersui.com/) and core contributor to [OpenFL](https://openfl.org/).