fix(IconPatch): adaptive old discord icon
This commit is contained in:
parent
3d282507ca
commit
04aa258f9b
2 changed files with 17 additions and 2 deletions
|
|
@ -177,13 +177,19 @@ class PatchIconsStep(private val options: PatchOptions) : Step(), KoinComponent
|
|||
container.log("Writing other patched files back to apk")
|
||||
ZipWriter(apk, /* append = */ true).use {
|
||||
if (isMonochromeIconsAvailable) {
|
||||
val monochromeIconId = if (options.iconReplacement is IconReplacement.OldDiscord) {
|
||||
R.drawable.ic_discord_monochrome
|
||||
} else {
|
||||
R.drawable.ic_discord_old_monochrome
|
||||
}
|
||||
|
||||
container.log("Writing monochrome icon AXML to apk")
|
||||
it.writeEntry("res/ic_aliucord_monochrome.xml", context.getResBytes(R.drawable.ic_discord_monochrome))
|
||||
it.writeEntry("res/ic_aliucord_monochrome.xml", context.getResBytes(monochromeIconId))
|
||||
}
|
||||
|
||||
if (options.iconReplacement is IconReplacement.OldDiscord) {
|
||||
container.log("Writing custom icon foreground to apk")
|
||||
it.writeEntry("res/ic_foreground_replacement.xml", context.getResBytes(R.drawable.ic_discord_old))
|
||||
it.writeEntry("res/ic_foreground_replacement.xml", context.getResBytes(R.drawable.ic_discord_old_monochrome))
|
||||
} else if (options.iconReplacement is IconReplacement.CustomImage) {
|
||||
container.log("Writing custom icon foreground to apk")
|
||||
it.writeEntry("res/ic_foreground_replacement.png", options.iconReplacement.imageBytes)
|
||||
|
|
|
|||
9
app/src/main/res/drawable/ic_discord_old_monochrome.xml
Normal file
9
app/src/main/res/drawable/ic_discord_old_monochrome.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M70.9,41.5c-5.5,-4.1 -10.8,-4 -10.8,-4l-0.5,0.6c6.5,2 9.6,4.9 9.6,4.9c-9.4,-5.2 -21.3,-5.1 -31,0c0,0 3.2,-3 10.1,-5l-0.4,-0.5c0,0 -5.2,-0.1 -10.8,4c0,0 -5.6,10 -5.6,22.3c0,0 3.2,5.5 11.7,5.8c0,0 1.4,-1.7 2.6,-3.2c-4.9,-1.5 -6.7,-4.5 -6.7,-4.5c3.1,1.9 6.2,3.1 10.1,3.9c6.3,1.3 14.1,0 20,-3.9c0,0 -1.9,3.1 -7,4.5c1.2,1.4 2.5,3.1 2.5,3.1c8.5,-0.3 11.8,-5.8 11.8,-5.8C76.5,51.4 70.9,41.5 70.9,41.5zM46.8,60.1c-2.2,0 -3.9,-1.9 -3.9,-4.2c0.2,-5.6 7.7,-5.6 7.9,0C50.7,58.3 49,60.1 46.8,60.1zM60.9,60.1c-2.2,0 -3.9,-1.9 -3.9,-4.2c0.2,-5.6 7.7,-5.6 7.9,0C64.8,58.3 63.1,60.1 60.9,60.1z" />
|
||||
</vector>
|
||||
Loading…
Add table
Reference in a new issue