Closed erisu closed 5 years ago
I also want to point out that this PR will be required.
https://github.com/apache/cordova-common/pull/26
This PR contains the updates to the ConfigParser to include foreground
and background
when getting static resources.
You can ignore the node 4 Appveyor failure due to let
/const
, we're in the process of dropping support for node 4.
@dpogue I have also noticed this.
There is the CI improvement PR, https://github.com/apache/cordova-android/pull/442, which deprecates node 4, adds node 10 support, and other changes.
When I tested my PR with the CI improvement PR, other issues appeared. https://ci.appveyor.com/project/erisu/cordova-android/build/1.0.14
If we just remove node 4 and add node 10, with no additional changes, then my PR passed. https://ci.appveyor.com/project/erisu/cordova-android/build/1.0.17
Merging #448 into master will decrease coverage by
19.06%
. The diff coverage is66.92%
.
@@ Coverage Diff @@
## master #448 +/- ##
===========================================
- Coverage 62.9% 43.84% -19.07%
===========================================
Files 15 18 +3
Lines 1650 2023 +373
Branches 308 383 +75
===========================================
- Hits 1038 887 -151
- Misses 612 1136 +524
Impacted Files | Coverage Δ | |
---|---|---|
bin/templates/cordova/lib/AndroidManifest.js | 35.44% <40%> (-64.56%) |
:arrow_down: |
bin/templates/cordova/lib/prepare.js | 41.66% <68%> (ø) |
|
bin/templates/cordova/lib/retry.js | 15.38% <0%> (-84.62%) |
:arrow_down: |
bin/templates/cordova/lib/device.js | 22.44% <0%> (-77.56%) |
:arrow_down: |
bin/templates/cordova/lib/run.js | 26.98% <0%> (-73.02%) |
:arrow_down: |
bin/templates/cordova/lib/Adb.js | 34.14% <0%> (-65.86%) |
:arrow_down: |
bin/templates/cordova/lib/builders/builders.js | 37.5% <0%> (-62.5%) |
:arrow_down: |
bin/templates/cordova/lib/emulator.js | 48.64% <0%> (-40.97%) |
:arrow_down: |
...n/templates/cordova/lib/builders/ProjectBuilder.js | ||
... and 6 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ebbd91f...821038e. Read the comment docs.
@raphinesse I rebased with the latest master now that the #442 PR has been merged. Do you think this is ready to merge?
Sorry, I know very little about the Android build, so I can't really review this. Maybe @dpogue or @infiloop.
@raphinesse Thank you for pointing out improvements to my test spec. I have updated the test and reduced the line count. I also removed the done()
calls as you pointed out because they were not needed.
This PR looks good to me. I need adaptive icons for one of my own apps, so I'm eager to see this get merged soon. Without support for this, icons for apps using cordova-android@7
(targeting API 26+) look a bit rubbish on newer devices.
I noticed the main cordova-android maintainer, Joe, has announced on the mailing list that he is stepping down. So, I expect that getting this thoroughly reviewed is now more difficult. If there is anything I can do to get this over the line, please let me know.
I will make sure this gets merged into the next major
@raphinesse Could you have a look again and redo your review please?
@janpio Unfortunately I am on a very tight schedule right now. The only thing I had reviewed were the specs. I glanced over them again and they do look much better. I still saw a few things that could be improved, but I don't have time to tackle that right now.
Since it's "only the specs", I would not want to block this PR because of this. However, I can neither give my approval for the rest of this PR since I know too little of the subject at hand.
Thanks @raphinesse! Same for me... hope someone with actual Android experience turns up.
@janpio I rebased with the latest master. I also did the same for cordova-common
's PR that is associated with this PR.
The downside, both cordova-common
and cordova-android
have jasmine@^3.1.0
as the dep. Both will update to 3.2.0
, and It seems the cordova-common
tests already failed for what I believe is the same side-effect of the latest Jasmine's release.
https://github.com/apache/cordova-common/pull/26
I am expecting these tests may show similar side-effects. We might need to update both repo's with the temp fix...
The changes in this PR look fine to me. I had held off on merging due to some of the questions on the cordova-common side about where the Android-specific handling code should live, especially with @erisu's proposed refactoring.
Do I need to install anything on top of cordova to get this to work? I'm currently getting a Unquoted attribute value error
Are you using cordova-android master
in your app? This hasn't really been released yet.
Oops thanks I'll again with the master branch
Though the PR is merged into master, the package.json
still references cordova-common@^2.2.0
. There is a cordova-common
PR that is also necessary for this change to work. The cordova-common
PR has also been merged into master which will be released on cordova-common@3.0.0
.
Using cordova-android@master
alone will not work unless you link cordova-common@master
. Or wait for release.
How would one go about switching from standered npm cordova to this master branch?
What does slandered npm cordova
mean?
If I where to go in my command line and download cordova using node js I would type npm install -g cordova would this give me a version of cordova that would let me use adaptive icons ?
No.
No. npm i -g cordova@nightly
and npm i cordova-android@nightly
in your project
so does adding @nightly switch it to this branch ? allowing me to create adaptive icons with cordova ?
No. It uses the latest nightly build. Should be easier to setup than using master. Try an earlier nightly build if npm throws errors at you during installation. A full list of available versions can be found via npm.
Has this been released yet? If not, when will it be?
It is not released yet, it will be included in the next major version. We can't/won't commit to any particular timeline for that next major, but we are working on it.
Platforms affected
Android
What does this PR do?
This PR adds support for Adaptive Icon.
Changes to Default Template Project
Added JavaScript Unit Testing.
config.xml for Adaptive Icons with Images
In this case, the foreground image will automatically be applied to the src attribute value. This is to support non-adaptive icon supported Android devices. If the user supplies their own src value, foreground will not be copied over.
config.xml for Adaptive Icons with Vectors
In this example, the adaptive icon supports vectors and colors for the foreground and background. If the foreground is a vector or color, the src attribute must also be defined with a PNG for Android devices that does not support adaptive icon.
config.xml for Adaptive Icons with Colors for Background First: create colors.xml file with content
Second: update config.xml with…
The naming convention for the two new attributes,
background
andforeground
, was decided to match the element names that is used in theic_launcher.xml
for consistency. https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive#creating_adaptive_icons_in_xmlError Example: Foreground contains vector and missing src attribute.
What testing has been done on this change?
Checklist