Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
Miniplayer: Add rounded corners setting if patching 19.36+
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Oct 15, 2024
1 parent 849dbe4 commit 55ec5d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public boolean isModern() {
private static final boolean HIDE_REWIND_FORWARD_ENABLED =
CURRENT_TYPE == MODERN_1 && Settings.MINIPLAYER_HIDE_REWIND_FORWARD.get();

private static final boolean MINIPLAYER_ROUNDED_CORNERS_ENABLED =
CURRENT_TYPE.isModern() && Settings.MINIPLAYER_ROUNDED_CORNERS.get();

/**
* Remove a broken and always present subtitle text that is only
* present with {@link MiniplayerType#MODERN_2}. Bug was fixed in 19.21.
Expand Down Expand Up @@ -247,8 +250,8 @@ public static int setMiniplayerDefaultSize(int original) {
* Injection point.
*/
public static float setMovementBoundFactor(float original) {
// Not clear if this is useful to customize or not.
// So for now just log this and keep whatever is the original value.
// Not clear if customizing this is useful or not.
// So for now just log this and use the original value.
if (original != 1.0) Logger.printDebug(() -> "setMovementBoundFactor original: " + original);

return original;
Expand All @@ -266,10 +269,10 @@ public static boolean setDropShadow(boolean original) {
/**
* Injection point.
*/
public static boolean setUseBackgroundViewOutlineProvider(boolean original) {
if (original) Logger.printDebug(() -> "setUseBackgroundViewOutlineProvider original: " + true);
public static boolean setRoundedCorners(boolean original) {
if (original) Logger.printDebug(() -> "setRoundedCorners original: " + true);

return original;
return MINIPLAYER_ROUNDED_CORNERS_ENABLED;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting MINIPLAYER_HIDE_EXPAND_CLOSE = new BooleanSetting("revanced_miniplayer_hide_expand_close", FALSE, true, new MiniplayerHideExpandCloseAvailability());
public static final BooleanSetting MINIPLAYER_HIDE_SUBTEXT = new BooleanSetting("revanced_miniplayer_hide_subtext", FALSE, true, MINIPLAYER_TYPE.availability(MODERN_1, MODERN_3));
public static final BooleanSetting MINIPLAYER_HIDE_REWIND_FORWARD = new BooleanSetting("revanced_miniplayer_hide_rewind_forward", FALSE, true, MINIPLAYER_TYPE.availability(MODERN_1));
public static final BooleanSetting MINIPLAYER_ROUNDED_CORNERS = new BooleanSetting("revanced_miniplayer_rounded_corners", TRUE, true, MINIPLAYER_ANY_MODERN);
public static final IntegerSetting MINIPLAYER_WIDTH_DIP = new IntegerSetting("revanced_miniplayer_width_dip", 192, true, MINIPLAYER_ANY_MODERN);
public static final IntegerSetting MINIPLAYER_OPACITY = new IntegerSetting("revanced_miniplayer_opacity", 100, true, MINIPLAYER_TYPE.availability(MODERN_1));

Expand Down

0 comments on commit 55ec5d1

Please sign in to comment.