liyamahendra commented on PR #1550:
URL: https://github.com/apache/cordova-android/pull/1550#issuecomment-1403419873

   @breautek need your inputs please.
   
   I'm updating the `updateIcons` function for working with custom icons 
provided in the project. The `cordovaProject.projectConfig` contains the 
`monochrome` attribute - see below:
   
   ```
   cordovaProject.projectConfig:  {
       "path": "/Users/mahendraliya/Documents/dev/HelloWorld/config.xml",
       "doc": {
           "_root": {
               "_id": 0,
               "tag": "widget",
               "attrib": {
                   "id": "io.cordova.hellocordova",
                   "version": "1.0.0",
                   "xmlns": "http://www.w3.org/ns/widgets";,
                   "xmlns:cdv": "http://cordova.apache.org/ns/1.0";
               },
               "text": "\n    ",
               "tail": null,
               "_children": [
                   {
                       "_id": 1,
                       "tag": "name",
                       "attrib": {},
                       "text": "HelloCordova",
                       "tail": "\n    ",
                       "_children": []
                   },
                   {
                       "_id": 2,
                       "tag": "description",
                       "attrib": {},
                       "text": "Sample Apache Cordova App",
                       "tail": "\n    ",
                       "_children": []
                   },
                   {
                       "_id": 3,
                       "tag": "author",
                       "attrib": {
                           "email": "[email protected]",
                           "href": "https://cordova.apache.org";
                       },
                       "text": "\n        Apache Cordova Team\n    ",
                       "tail": "\n    ",
                       "_children": []
                   },
                   {
                       "_id": 4,
                       "tag": "content",
                       "attrib": {
                           "src": "index.html"
                       },
                       "text": "",
                       "tail": "\n    ",
                       "_children": []
                   },
                   {
                       "_id": 5,
                       "tag": "allow-intent",
                       "attrib": {
                           "href": "http://*/*";
                       },
                       "text": "",
                       "tail": "\n    ",
                       "_children": []
                   },
                   {
                       "_id": 6,
                       "tag": "allow-intent",
                       "attrib": {
                           "href": "https://*/*";
                       },
                       "text": "",
                       "tail": "\n    ",
                       "_children": []
                   },
                   {
                       "_id": 7,
                       "tag": "platform",
                       "attrib": {
                           "name": "android"
                       },
                       "text": "\n        ",
                       "tail": "\n",
                       "_children": [
                           {
                               "_id": 8,
                               "tag": "icon",
                               "attrib": {
                                   "background": 
"resources/android/icon/ldpi-background.png",
                                   "density": "ldpi",
                                   "foreground": 
"resources/android/icon/ldpi-foreground.png",
                                   "monochrome": 
"resources/android/icon/ldpi-monochrome.png",
                                   "src": "resources/android/icon/ldpi.png"
                               },
                               "text": "",
                               "tail": "\n        ",
                               "_children": []
                           },
                           {
                               "_id": 9,
                               "tag": "icon",
                               "attrib": {
                                   "background": 
"resources/android/icon/mdpi-background.png",
                                   "density": "mdpi",
                                   "foreground": 
"resources/android/icon/mdpi-foreground.png",
                                   "monochrome": 
"resources/android/icon/mdpi-monochrome.png",
                                   "src": "resources/android/icon/mdpi.png"
                               },
                               "text": "",
                               "tail": "\n        ",
                               "_children": []
                           },
                           {
                               "_id": 10,
                               "tag": "icon",
                               "attrib": {
                                   "background": 
"resources/android/icon/hdpi-background.png",
                                   "density": "hdpi",
                                   "foreground": 
"resources/android/icon/hdpi-foreground.png",
                                   "monochrome": 
"resources/android/icon/hdpi-monochrome.png",
                                   "src": "resources/android/icon/hdpi.png"
                               },
                               "text": "",
                               "tail": "\n        ",
                               "_children": []
                           },
                           {
                               "_id": 11,
                               "tag": "icon",
                               "attrib": {
                                   "background": 
"resources/android/icon/xhdpi-background.png",
                                   "density": "xhdpi",
                                   "foreground": 
"resources/android/icon/xhdpi-foreground.png",
                                   "monochrome": 
"resources/android/icon/xhdpi-monochrome.png",
                                   "src": "resources/android/icon/xhdpi.png"
                               },
                               "text": "",
                               "tail": "\n        ",
                               "_children": []
                           },
                           {
                               "_id": 12,
                               "tag": "icon",
                               "attrib": {
                                   "background": 
"resources/android/icon/xxhdpi-background.png",
                                   "density": "xxhdpi",
                                   "foreground": 
"resources/android/icon/xxhdpi-foreground.png",
                                   "monochrome": 
"resources/android/icon/xxhdpi-monochrome.png",
                                   "src": "resources/android/icon/xxhdpi.png"
                               },
                               "text": "",
                               "tail": "\n        ",
                               "_children": []
                           },
                           {
                               "_id": 13,
                               "tag": "icon",
                               "attrib": {
                                   "background": 
"resources/android/icon/xxxhdpi-background.png",
                                   "density": "xxxhdpi",
                                   "foreground": 
"resources/android/icon/xxxhdpi-foreground.png",
                                   "monochrome": 
"resources/android/icon/xxxhdpi-monochrome.png",
                                   "src": "resources/android/icon/xxxhdpi.png"
                               },
                               "text": "",
                               "tail": "\n    ",
                               "_children": []
                           }
                       ]
                   }
               ]
           }
       },
       "cdvNamespacePrefix": "cdv"
   }
   ```
   
   but it isn't present in the icons returned from 
`cordovaProject.projectConfig.getIcons` function call - see below:
   ```
   [
       {
           "platform": "android",
           "src": "resources/android/icon/ldpi.png",
           "density": "ldpi",
           "background": "resources/android/icon/ldpi-background.png",
           "foreground": "resources/android/icon/ldpi-foreground.png"
       },
       {
           "platform": "android",
           "src": "resources/android/icon/mdpi.png",
           "density": "mdpi",
           "background": "resources/android/icon/mdpi-background.png",
           "foreground": "resources/android/icon/mdpi-foreground.png"
       },
       {
           "platform": "android",
           "src": "resources/android/icon/hdpi.png",
           "density": "hdpi",
           "background": "resources/android/icon/hdpi-background.png",
           "foreground": "resources/android/icon/hdpi-foreground.png"
       },
       {
           "platform": "android",
           "src": "resources/android/icon/xhdpi.png",
           "density": "xhdpi",
           "background": "resources/android/icon/xhdpi-background.png",
           "foreground": "resources/android/icon/xhdpi-foreground.png"
       },
       {
           "platform": "android",
           "src": "resources/android/icon/xxhdpi.png",
           "density": "xxhdpi",
           "background": "resources/android/icon/xxhdpi-background.png",
           "foreground": "resources/android/icon/xxhdpi-foreground.png"
       },
       {
           "platform": "android",
           "src": "resources/android/icon/xxxhdpi.png",
           "density": "xxxhdpi",
           "background": "resources/android/icon/xxxhdpi-background.png",
           "foreground": "resources/android/icon/xxxhdpi-foreground.png"
       }
   ]
   ```
   
   I tried to do grep search to see the definition of `getIcons` function but 
couldn't find it anywhere in the `cordova-android` project. 
   
   Would you advise where can I find the `getIcons` function please?


-- 
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