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

fix: Add android prefix to windowSplashScreenBrandingImage #1487

Merged
merged 8 commits into from
Sep 16, 2022

Conversation

jcesarmobile
Copy link
Member

closes #1475

windowSplashScreenBrandingImage is not valid, it should be android:windowSplashScreenBrandingImage.

All other values should also include the android:, but the support library allows to use them without the android: part, but since windowSplashScreenBrandingImage is not supported by the support library apps fail to compile.

This PR adds the android: prefix to the value so it gets added to the styles file with the prefix.
Needed to patch how the cdvConfigPrefKey is generated to strip the android: part of the themeKey

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2022

Codecov Report

Merging #1487 (825a1da) into master (60e3803) will decrease coverage by 0.12%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1487      +/-   ##
==========================================
- Coverage   72.25%   72.13%   -0.13%     
==========================================
  Files          21       21              
  Lines        1748     1751       +3     
==========================================
  Hits         1263     1263              
- Misses        485      488       +3     
Impacted Files Coverage Δ
lib/prepare.js 46.28% <0.00%> (-0.35%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

lib/prepare.js Outdated Show resolved Hide resolved
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

I think we also need to add tools:targetApi="31" to the node that gets created for this one property.

I remember having issues without this.

lib/prepare.js Outdated
Comment on lines 385 to 389
let index = 0;
if (themeKey.indexOf(':') !== -1) {
index = themeKey.indexOf(':') + 1;
}
const cdvConfigPrefKey = 'Android' + themeKey.charAt(index).toUpperCase() + themeKey.slice(index + 1);
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is better performance or eaiser to read, but what about this?

const themeKeyDescoped = themeKey.replace('android:', '');
const cdvConfigPrefKey = 'Android' + themeKeyDescoped.charAt(0).toUpperCase() + themeKeyDescoped.slice(1);

Copy link
Member Author

Choose a reason for hiding this comment

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

I have removed the if as it's not really necessary, so the code is simpler now, let me know if you still prefer to use the replace.

Copy link
Member

Choose a reason for hiding this comment

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

What you have is good. Dont need to use replace.

@jcesarmobile
Copy link
Member Author

jcesarmobile commented Sep 11, 2022

Added the targetApi 31 thing, also required to add xmlns:tools="http://schemas.android.com/tools" to the resources tag.

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

Code LGTM

@jcesarmobile jcesarmobile merged commit 954d3e0 into master Sep 16, 2022
@jcesarmobile jcesarmobile deleted the fix-branding-image branch September 16, 2022 07:34
@leMaik
Copy link

leMaik commented Nov 13, 2022

It's been a while; is there any chance we can get this released? 🙏

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

Successfully merging this pull request may close these issues.

Error when adding AndroidWindowSplashScreenBrandingImage
5 participants