mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-17 23:37:32 +01:00
fix(youtube/theme): fix app crash if user clears seekbar color (#390)
This commit is contained in:
parent
2882ec1c9c
commit
e2f52905dc
@ -13,6 +13,9 @@ public final class ThemePatch {
|
|||||||
SettingsEnum.SEEKBAR_COLOR.saveValue(SettingsEnum.SEEKBAR_COLOR.defaultValue);
|
SettingsEnum.SEEKBAR_COLOR.saveValue(SettingsEnum.SEEKBAR_COLOR.defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injection point.
|
||||||
|
*/
|
||||||
public static int getSeekbarClickedColorValue(final int colorValue) {
|
public static int getSeekbarClickedColorValue(final int colorValue) {
|
||||||
// YouTube uses a specific color when the seekbar is clicked. Override in that case.
|
// YouTube uses a specific color when the seekbar is clicked. Override in that case.
|
||||||
return colorValue == ORIGINAL_SEEKBAR_CLICKED_COLOR ? getSeekbarColorValue() : colorValue;
|
return colorValue == ORIGINAL_SEEKBAR_CLICKED_COLOR ? getSeekbarColorValue() : colorValue;
|
||||||
@ -21,7 +24,7 @@ public final class ThemePatch {
|
|||||||
public static int getSeekbarColorValue() {
|
public static int getSeekbarColorValue() {
|
||||||
try {
|
try {
|
||||||
return Color.parseColor(SettingsEnum.SEEKBAR_COLOR.getString());
|
return Color.parseColor(SettingsEnum.SEEKBAR_COLOR.getString());
|
||||||
} catch (IllegalArgumentException exception) {
|
} catch (Exception exception) {
|
||||||
resetSeekbarColor();
|
resetSeekbarColor();
|
||||||
return getSeekbarColorValue();
|
return getSeekbarColorValue();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user