wip: music

This commit is contained in:
drobotk 2026-03-13 13:05:04 +01:00
parent 7fe7ce437c
commit b435564fd4
No known key found for this signature in database
GPG key ID: D53DB3B14C514056
4 changed files with 20 additions and 4 deletions

View file

@ -1,5 +1,7 @@
package app.revanced.extension.music.patches; package app.revanced.extension.music.patches;
import java.util.Objects;
import app.revanced.extension.shared.Logger; import app.revanced.extension.shared.Logger;
import app.revanced.extension.shared.ResourceType; import app.revanced.extension.shared.ResourceType;
import app.revanced.extension.shared.Utils; import app.revanced.extension.shared.Utils;
@ -34,4 +36,15 @@ public class ChangeHeaderPatch {
return id; return id;
} }
} }
/**
* Injection point.
*/
@SuppressWarnings("unused")
public static int getHeaderDrawableId(int original) {
return Objects.requireNonNullElse(
Settings.HEADER_LOGO.get().getDrawableId(),
original
);
}
} }

View file

@ -31,7 +31,7 @@ public class Settings extends YouTubeAndMusicSettings {
public static final BooleanSetting HIDE_NAVIGATION_BAR_UPGRADE_BUTTON = new BooleanSetting("revanced_music_hide_navigation_bar_upgrade_button", TRUE, true); public static final BooleanSetting HIDE_NAVIGATION_BAR_UPGRADE_BUTTON = new BooleanSetting("revanced_music_hide_navigation_bar_upgrade_button", TRUE, true);
public static final BooleanSetting HIDE_NAVIGATION_BAR = new BooleanSetting("revanced_music_hide_navigation_bar", FALSE, true); public static final BooleanSetting HIDE_NAVIGATION_BAR = new BooleanSetting("revanced_music_hide_navigation_bar", FALSE, true);
public static final BooleanSetting HIDE_NAVIGATION_BAR_LABEL = new BooleanSetting("revanced_music_hide_navigation_bar_labels", FALSE, true); public static final BooleanSetting HIDE_NAVIGATION_BAR_LABEL = new BooleanSetting("revanced_music_hide_navigation_bar_labels", FALSE, true);
public static final EnumSetting<HeaderLogo> HEADER_LOGO = new EnumSetting<>("revnaced_header_logo", HeaderLogo.DEFAULT, true); public static final EnumSetting<HeaderLogo> HEADER_LOGO = new EnumSetting<>("revanced_header_logo", HeaderLogo.DEFAULT, true);
// Player // Player
public static final BooleanSetting CHANGE_MINIPLAYER_COLOR = new BooleanSetting("revanced_music_change_miniplayer_color", FALSE, true); public static final BooleanSetting CHANGE_MINIPLAYER_COLOR = new BooleanSetting("revanced_music_change_miniplayer_color", FALSE, true);

View file

@ -4,7 +4,6 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.getInstruction
import app.revanced.patcher.extensions.wideLiteral import app.revanced.patcher.extensions.wideLiteral
import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.all.misc.resources.addResources
import app.revanced.patches.music.misc.settings.PreferenceScreen import app.revanced.patches.music.misc.settings.PreferenceScreen
import app.revanced.patches.shared.layout.branding.header.changeHeaderPatch import app.revanced.patches.shared.layout.branding.header.changeHeaderPatch
import app.revanced.patches.shared.misc.mapping.ResourceType import app.revanced.patches.shared.misc.mapping.ResourceType
@ -20,7 +19,11 @@ private val targetResourceDirectoryNames = mapOf(
) )
private val variants = arrayOf("dark") private val variants = arrayOf("dark")
private val logoResourceNames = arrayOf("revanced_header_dark")
private val logoResourceNames = arrayOf(
"revanced_header_minimal",
"revanced_header_rounded",
)
private val headerDrawableNames = arrayOf( private val headerDrawableNames = arrayOf(
"action_bar_logo_ringo2", "action_bar_logo_ringo2",

View file

@ -48,7 +48,7 @@ val changeMiniplayerColorPatch = bytecodePatch(
) )
apply { apply {
addResources("music", "layout.miniplayercolor.changeMiniplayerColor") addResources("music", "layout.miniplayer.changeMiniplayerColor")
PreferenceScreen.PLAYER.addPreferences( PreferenceScreen.PLAYER.addPreferences(
SwitchPreference("revanced_music_change_miniplayer_color"), SwitchPreference("revanced_music_change_miniplayer_color"),