Skip to content

Commit

Permalink
fix(youtube/theme): fix toast shown on fresh app install (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed May 3, 2023
1 parent 513d4e4 commit 2dc431f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
@@ -1,17 +1,16 @@
package app.revanced.integrations.patches.theme;

import android.graphics.Color;

import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.ReVancedUtils;

public final class ThemePatch {
public static final int DEFAULT_SEEKBAR_COLOR = 0xffff0000;

public static final int ORIGINAL_SEEKBAR_CLICKED_COLOR = -65536;
private static final int ORIGINAL_SEEKBAR_CLICKED_COLOR = -65536;

private static void resetSeekbarColor() {
ReVancedUtils.showToastShort("Invalid seekbar color value. Using default value.");
SettingsEnum.SEEKBAR_COLOR.saveValue("#" + Integer.toHexString(DEFAULT_SEEKBAR_COLOR));
SettingsEnum.SEEKBAR_COLOR.saveValue(SettingsEnum.SEEKBAR_COLOR.defaultValue);
}

public static int getSeekbarClickedColorValue(final int colorValue) {
Expand All @@ -24,7 +23,7 @@ public static int getSeekbarColorValue() {
return Color.parseColor(SettingsEnum.SEEKBAR_COLOR.getString());
} catch (IllegalArgumentException exception) {
resetSeekbarColor();
return DEFAULT_SEEKBAR_COLOR;
return getSeekbarColorValue();
}
}
}
Expand Up @@ -106,7 +106,7 @@ public enum SettingsEnum {
SPOOF_APP_VERSION_TARGET("revanced_spoof_app_version_target", STRING, "17.30.35", true, parents(SPOOF_APP_VERSION)),
USE_TABLET_MINIPLAYER("revanced_tablet_miniplayer", BOOLEAN, FALSE, true),
WIDE_SEARCHBAR("revanced_wide_searchbar", BOOLEAN, FALSE, true),
SEEKBAR_COLOR("revanced_seekbar_color", STRING, Integer.toHexString(ThemePatch.DEFAULT_SEEKBAR_COLOR), true),
SEEKBAR_COLOR("revanced_seekbar_color", STRING, "#FF0000", true),

// Misc. Settings
SIGNATURE_SPOOFING("revanced_spoof_signature_verification", BOOLEAN, TRUE, "revanced_spoof_signature_verification_user_dialog_message"),
Expand Down

0 comments on commit 2dc431f

Please sign in to comment.