Skip to content

Commit

Permalink
fix: add size 48px for custom-branding patch
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 15, 2022
1 parent 0a8725e commit f81872b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.branding.annotations
package app.revanced.patches.youtube.layout.branding.icon.annotations

import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.branding.patch
package app.revanced.patches.youtube.layout.branding.icon.patch

import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
Expand All @@ -10,7 +10,7 @@ import app.revanced.patcher.patch.implementation.ResourcePatch
import app.revanced.patcher.patch.implementation.misc.PatchResult
import app.revanced.patcher.patch.implementation.misc.PatchResultError
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
import app.revanced.patches.youtube.layout.branding.annotations.CustomBrandingCompatibility
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import java.nio.file.Files

Expand All @@ -35,18 +35,18 @@ class CustomBrandingPatch : ResourcePatch() {
)

mapOf(
"mipmap-xxxhdpi" to 192,
"mipmap-xxhdpi" to 144,
"mipmap-xhdpi" to 96,
"mipmap-hdpi" to 72,
"mipmap-mdpi" to 48
"xxxhdpi" to 192,
"xxhdpi" to 144,
"xhdpi" to 96,
"hdpi" to 72,
"mdpi" to 48
).forEach { (iconDirectory, size) ->
iconNames.forEach iconLoop@{ iconName ->
val iconFile = this.javaClass.classLoader.getResourceAsStream("branding/$size/$iconName.png")
?: return PatchResultError("The icon $iconName can not be found.")

Files.write(
resDirectory.resolve(iconDirectory).resolve("$iconName.png").toPath(), iconFile.readAllBytes()
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(), iconFile.readAllBytes()
)
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/branding/48/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f81872b

Please sign in to comment.