@@ -19,22 +19,22 @@ val customBrandingPatch = baseCustomBrandingPatch(
1919 " YouTube" to " YouTube" ,
2020 ),
2121 resourceFolder = " custom-branding/youtube" ,
22- iconResourceFileNames = arrayOf(
22+ adaptiveAnydpiFileNames = arrayOf(
23+ " $ADAPTIVE_BACKGROUND_RESOURCE_NAME .xml" ,
24+ " $ADAPTIVE_FOREGROUND_RESOURCE_NAME .xml" ,
25+ ),
26+ mipmapIconFileNames = arrayOf(
2327 " $ADAPTIVE_BACKGROUND_RESOURCE_NAME .png" ,
2428 " $ADAPTIVE_FOREGROUND_RESOURCE_NAME .png" ,
2529 ),
30+ legacyMipmapIconFileNames = arrayOf(
31+ " ic_launcher.png" ,
32+ // "ic_launcher_round" exists in 19.34, but was removed in later targets.
33+ ),
2634 monochromeIconFileNames = arrayOf(
2735 " adaptive_monochrome_ic_youtube_launcher.xml" ,
2836 " ringo2_adaptive_monochrome_ic_youtube_launcher.xml"
2937 ),
30- adaptiveIconFileNames = arrayOf(
31- " $ADAPTIVE_BACKGROUND_RESOURCE_NAME .xml" ,
32- " $ADAPTIVE_FOREGROUND_RESOURCE_NAME .xml" ,
33- ),
34- legacyIconResourceFileNames = arrayOf(
35- " ic_launcher.png" ,
36- // "ic_launcher_round" exists in 19.34, but was removed in later targets.
37- ),
3838
3939 block = {
4040 compatibleWith(
@@ -45,38 +45,37 @@ val customBrandingPatch = baseCustomBrandingPatch(
4545 " 20.14.43" ,
4646 )
4747 )
48- },
48+ }
49+
50+ ) {
51+ val resourceDirectory = get(" res" )
52+
53+ // Copy adaptive icon to secondary adaptive file.
54+ arrayOf(
55+ ADAPTIVE_BACKGROUND_RESOURCE_NAME to " adaptiveproduct_youtube_2024_q4_background_color_108" ,
56+ ADAPTIVE_FOREGROUND_RESOURCE_NAME to " adaptiveproduct_youtube_2024_q4_foreground_color_108" ,
57+ ).forEach { (old, new) ->
58+ var resourceType = " mipmap-anydpi"
59+ val oldFile = resourceDirectory.resolve(" $resourceType /$old .xml" )
60+ if (oldFile.exists()) {
61+ val newFile = resourceDirectory.resolve(" $resourceType /$new .xml" )
62+ Files .write(newFile.toPath(), oldFile.readBytes())
63+ }
64+ }
4965
50- executeBlock = {
51- val resourceDirectory = get(" res" )
66+ // Copy mipmaps to secondary files.
67+ mipmapDirectories.forEach { directory ->
68+ val targetDirectory = resourceDirectory.resolve(directory)
5269
53- // Copy adaptive icon to secondary adaptive file.
5470 arrayOf(
5571 ADAPTIVE_BACKGROUND_RESOURCE_NAME to " adaptiveproduct_youtube_2024_q4_background_color_108" ,
5672 ADAPTIVE_FOREGROUND_RESOURCE_NAME to " adaptiveproduct_youtube_2024_q4_foreground_color_108" ,
5773 ).forEach { (old, new) ->
58- var resourceType = " mipmap-anydpi"
59- val oldFile = resourceDirectory.resolve(" $resourceType /$old .xml" )
74+ val oldFile = targetDirectory.resolve(" $old .png" )
6075 if (oldFile.exists()) {
61- val newFile = resourceDirectory .resolve(" $resourceType / $ new .xml " )
76+ val newFile = targetDirectory .resolve(" $new .png " )
6277 Files .write(newFile.toPath(), oldFile.readBytes())
6378 }
6479 }
65-
66- // Copy mipmaps to secondary files.
67- mipmapDirectories.forEach { directory ->
68- val targetDirectory = resourceDirectory.resolve(directory)
69-
70- arrayOf(
71- ADAPTIVE_BACKGROUND_RESOURCE_NAME to " adaptiveproduct_youtube_2024_q4_background_color_108" ,
72- ADAPTIVE_FOREGROUND_RESOURCE_NAME to " adaptiveproduct_youtube_2024_q4_foreground_color_108" ,
73- ).forEach { (old, new) ->
74- val oldFile = targetDirectory.resolve(" $old .png" )
75- if (oldFile.exists()) {
76- val newFile = targetDirectory.resolve(" $new .png" )
77- Files .write(newFile.toPath(), oldFile.readBytes())
78- }
79- }
80- }
8180 }
82- )
81+ }
0 commit comments