mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-03 01:02:55 +01:00
fix(youtube/theme): fix toast shown on fresh app install (#381)
This commit is contained in:
parent
513d4e4542
commit
2dc431f1bf
@ -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) {
|
||||
@ -24,7 +23,7 @@ public final class ThemePatch {
|
||||
return Color.parseColor(SettingsEnum.SEEKBAR_COLOR.getString());
|
||||
} catch (IllegalArgumentException exception) {
|
||||
resetSeekbarColor();
|
||||
return DEFAULT_SEEKBAR_COLOR;
|
||||
return getSeekbarColorValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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"),
|
||||
|
Loading…
Reference in New Issue
Block a user