erisu commented on code in PR #1550:
URL: https://github.com/apache/cordova-android/pull/1550#discussion_r1086729957


##########
lib/prepare.js:
##########
@@ -728,17 +731,21 @@ function updateIconResourceForAdaptive (preparedIcons, 
resourceMap, platformReso
     // project's config.xml location, so we use it as base path.
     let background;
     let foreground;
+    let monochrome;
     let targetPathBackground;
     let targetPathForeground;
+    let targetPathMonochrome;
 
     for (const density in android_icons) {
         let backgroundVal = '@mipmap/ic_launcher_background';
         let foregroundVal = '@mipmap/ic_launcher_foreground';
+        let monochromeVal = '@mipmap/ic_launcher_monochrome';
 
         background = android_icons[density].background;
         foreground = android_icons[density].foreground;
+        monochrome = android_icons[density].monochrome;
 
-        if (!background || !foreground) {
+        if (!background || !foreground || !monochrome) {

Review Comment:
   ```suggestion
           const isAdaptiveIcon = background && foreground;
           const isMonochromeIcon = monochrome && isAdaptiveIcon;
           if (!isMonochromeIcon || !isAdaptiveIcon) {
   ```
   Will something like this work for readability? 
   
   Might need to test to confirm what I written.
   
   - Monochrome must also have background and foreground.
   - Monochrome setting is not required but, the background and foreground is 
required for adaptive icon minimum support.
   - If either Monochrome or minimum Adaptive Icon data is provided, it falls 
back to the standard icon.
   
   Ideally we hope all three is defined so end users can have a nice user 
experience when themed is enabled, but its possbile posible for the app 
developers to not have yet created monochrome assets and can still fallback to 
the adaptive icons they have now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to