Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback for adaptive icon overwrites adaptive icon #690

Closed
3 tasks done
dominic-simplan opened this issue Mar 14, 2019 · 1 comment
Closed
3 tasks done

Fallback for adaptive icon overwrites adaptive icon #690

dominic-simplan opened this issue Mar 14, 2019 · 1 comment
Milestone

Comments

@dominic-simplan
Copy link

Bug Report

Problem

What is expected to happen?

The documentation says:

Note: In this example, the foreground image will also be used as the fallback icon for Android devices that do not support the adaptive icons. The fallback icon can be overridden by setting the src attribute.

Therefore, I have specified my icons with a fallback as follow:

<platform name="android">
        <resource-file src="res/icons/android/colors.xml" target="/app/src/main/res/values/colors.xml" />
        <icon density="ldpi" src="res/icons/android/ldpi-legacy.png" />
        <icon density="mdpi" background="@color/background" foreground="res/icons/android/mdpi-foreground.png" src="res/icons/android/mdpi-legacy.png" />
        <icon density="hdpi" background="@color/background" foreground="res/icons/android/hdpi-foreground.png" src="res/icons/android/hdpi-legacy.png" />
        <icon density="xhdpi" background="@color/background" foreground="res/icons/android/xhdpi-foreground.png" src="res/icons/android/xhdpi-legacy.png" />
...
</platform>

I would expect that the *-legacy.png Icons are only used on devices which do not support adaptive icons (Android < 8).

What does actually happen?

The legacy icons are displayed even on devices which support adaptive icons (Android 8.1.0 device)

Information

The documentation also says:

To use the adaptive icons the background and foreground attributes must be defined in place of the src attribute. The src attribute is not used for adaptive icons.

Which is somewhat contrary to the other statement. So I am not really sure how it is actually supposed to behave.

Btw., the latest documentation with the description for the adaptive icon does not seem to be released yet (At least it says it is under development). Are you aware of that?

Environment, Platform, Device

BQ Aquaris Pro (Android 8.1.0)

Version information

Cordova CLI 8.1.2
Cordova Android 8.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@dpogue
Copy link
Member

dpogue commented Mar 14, 2019

This is due to an issue with how different versions of cordova-common are used, and should be fixed when the cordova@9 CLI is published to npm.

Beyond that though, I'm hoping to address this issue from another angle in a patch release so that adaptive icons will work even with older versions of the CLI.

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

No branches or pull requests

3 participants