Skip to content

Add support for adaptive and themed icons on android #14223

Merged
lucasfernog merged 9 commits intotauri-apps:devfrom
kandrelczyk:feat/adaptive-icons
Oct 1, 2025
Merged

Add support for adaptive and themed icons on android #14223
lucasfernog merged 9 commits intotauri-apps:devfrom
kandrelczyk:feat/adaptive-icons

Conversation

@kandrelczyk
Copy link
Copy Markdown
Contributor

As discussed here:
#13860

It's backwards compatible when passing single file as input.
When passing manifest file:

  • when manifest only contains default image result is the same as passing file argument
  • when bg_color is passed it will override ios-color param
  • android_fg, android_bg and android_monochrome can be passed optionally to be used for android

@kandrelczyk kandrelczyk requested a review from a team as a code owner September 27, 2025 12:08
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 27, 2025
Comment thread crates/tauri-cli/src/icon.rs Outdated
@FabianLars
Copy link
Copy Markdown
Member

Any idea how to integrate multiple input icons (multiple sizes for the same icon type) into this manifest - doesn't have to be implemented now but we have to keep that requirement in mind for the config design here.

Co-authored-by: Fabian-Lars <github@fabianlars.de>
@kandrelczyk
Copy link
Copy Markdown
Contributor Author

I would suggest simply allowing each entry to be a directory. So for example
{ "default": "default_icon", "android_bg": "bg_icon"}. We can check if the values point to a file (current behavior) or a directory. If it's directory we would expect it to contain files like 32.png, 128.png and so on. I think that's the most convenient way and current implementation can be easily expanded this way without changing the manifest schema

@lucasfernog
Copy link
Copy Markdown
Member

I would suggest simply allowing each entry to be a directory. So for example { "default": "default_icon", "android_bg": "bg_icon"}. We can check if the values point to a file (current behavior) or a directory. If it's directory we would expect it to contain files like 32.png, 128.png and so on. I think that's the most convenient way and current implementation can be easily expanded this way without changing the manifest schema

yes either that or an object like { "default": { "32": "./d/32.png", "128": "128.png" } }
i like how the object is more explicit, easier to spot typos etc

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 1, 2025

Package Changes Through 7fba12b

There are 9 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-macros with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.8.0 2.9.0
tauri-utils 2.7.0 2.8.0
tauri-bundler 2.6.1 2.7.0
tauri-runtime 2.8.0 2.9.0
tauri-runtime-wry 2.8.1 2.9.0
tauri-codegen 2.4.0 2.4.1
tauri-macros 2.4.0 2.4.1
tauri-plugin 2.4.0 2.4.1
tauri-build 2.4.1 2.4.2
tauri 2.8.5 2.9.0
@tauri-apps/cli 2.8.4 2.9.0
tauri-cli 2.8.4 2.9.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Copy link
Copy Markdown
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i made some changes to be explicit about the input path being the manifest file, actually overlap the bg and fg icons (like Android Studio does) and round the generated icons (again similar to how Android Studio work), i think it's working well

Copy link
Copy Markdown
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(untested)

@lucasfernog lucasfernog merged commit 94cbd40 into tauri-apps:dev Oct 1, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap Oct 1, 2025
}

#[derive(Deserialize)]
struct Manifest {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note that we might want to generate a schema file and put it into https://schema.tauri.app/ (also some documentations would be nice)

@kandrelczyk
Copy link
Copy Markdown
Contributor Author

I checked everything again on Android and Linux and looks like it's working fine.
Regarding documentation, is updating https://v2.tauri.app/develop/icons/ enough? Is there anything else?

@Legend-Master
Copy link
Copy Markdown
Contributor

Regarding documentation, is updating https://v2.tauri.app/develop/icons/ enough? Is there anything else?

This could be a good start, if we want an even better experience, we could add a json schema like our config files so you get autocompletes in IDEs

#14223 (comment)

https://github.com/tauri-apps/create-tauri-app/blob/8d15234e7b473afe68c8601e88f11d1646157404/templates/_base_/src-tauri/%25(v2)%25tauri.conf.json.lte#L2

@kandrelczyk
Copy link
Copy Markdown
Contributor Author

Ok, I will try to do this but I'm traveling during the next two weeks so probably will do it when I'm back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

4 participants