mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-28 18:35: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
|
||||
public final String keyValue;
|
||||
@NonNull
|
||||
private final StringSetting behaviorSetting;
|
||||
public final StringSetting behaviorSetting;
|
||||
@NonNull
|
||||
private final StringSetting colorSetting;
|
||||
|
||||
|
@ -31,14 +31,18 @@ public class SegmentCategoryListPreference extends ListPreference {
|
||||
super(context);
|
||||
final boolean isHighlightCategory = category == SegmentCategory.HIGHLIGHT;
|
||||
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
|
||||
? CategoryBehaviour.getBehaviorDescriptionsWithoutSkipOnce()
|
||||
: CategoryBehaviour.getBehaviorDescriptions());
|
||||
setEntryValues(isHighlightCategory
|
||||
? CategoryBehaviour.getBehaviorKeyValuesWithoutSkipOnce()
|
||||
: CategoryBehaviour.getBehaviorKeyValues());
|
||||
|
||||
setSummary(category.description.toString());
|
||||
updateTitle();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user