mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-28 18:05:49 +01:00
fix(YouTube - SponsorBlock): Show correct segment behavior in settings UI after importing
This commit is contained in:
parent
c7d9ccd13c
commit
e3f25a03cd
@ -136,7 +136,7 @@ public enum SegmentCategory {
|
|||||||
@NonNull
|
@NonNull
|
||||||
public final String keyValue;
|
public final String keyValue;
|
||||||
@NonNull
|
@NonNull
|
||||||
private final StringSetting behaviorSetting;
|
public final StringSetting behaviorSetting;
|
||||||
@NonNull
|
@NonNull
|
||||||
private final StringSetting colorSetting;
|
private final StringSetting colorSetting;
|
||||||
|
|
||||||
|
@ -31,14 +31,18 @@ public class SegmentCategoryListPreference extends ListPreference {
|
|||||||
super(context);
|
super(context);
|
||||||
final boolean isHighlightCategory = category == SegmentCategory.HIGHLIGHT;
|
final boolean isHighlightCategory = category == SegmentCategory.HIGHLIGHT;
|
||||||
this.category = Objects.requireNonNull(category);
|
this.category = Objects.requireNonNull(category);
|
||||||
setKey(category.keyValue);
|
|
||||||
setDefaultValue(category.behaviour.reVancedKeyValue);
|
// Edit: Using preferences to sync together multiple pieces
|
||||||
|
// of code together is messy and should be rethought.
|
||||||
|
setKey(category.behaviorSetting.key);
|
||||||
|
setDefaultValue(category.behaviorSetting.defaultValue);
|
||||||
setEntries(isHighlightCategory
|
setEntries(isHighlightCategory
|
||||||
? CategoryBehaviour.getBehaviorDescriptionsWithoutSkipOnce()
|
? CategoryBehaviour.getBehaviorDescriptionsWithoutSkipOnce()
|
||||||
: CategoryBehaviour.getBehaviorDescriptions());
|
: CategoryBehaviour.getBehaviorDescriptions());
|
||||||
setEntryValues(isHighlightCategory
|
setEntryValues(isHighlightCategory
|
||||||
? CategoryBehaviour.getBehaviorKeyValuesWithoutSkipOnce()
|
? CategoryBehaviour.getBehaviorKeyValuesWithoutSkipOnce()
|
||||||
: CategoryBehaviour.getBehaviorKeyValues());
|
: CategoryBehaviour.getBehaviorKeyValues());
|
||||||
|
|
||||||
setSummary(category.description.toString());
|
setSummary(category.description.toString());
|
||||||
updateTitle();
|
updateTitle();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user