1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-26 04:52:29 +01:00

Removed breadcrumbs customization

This commit is contained in:
litetex 2022-01-09 16:49:16 +01:00
parent e2f449f0c8
commit 03bb2123f2
3 changed files with 2 additions and 13 deletions

View File

@ -171,7 +171,6 @@ public class SettingsActivity extends AppCompatActivity implements
@Override @Override
public boolean onPreferenceStartFragment(final PreferenceFragmentCompat caller, public boolean onPreferenceStartFragment(final PreferenceFragmentCompat caller,
final Preference preference) { final Preference preference) {
preference.getExtras()
showSettingsFragment(instantiateFragment(preference.getFragment())); showSettingsFragment(instantiateFragment(preference.getFragment()));
return true; return true;
} }

View File

@ -15,6 +15,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* Parses the corresponding preference-file(s). * Parses the corresponding preference-file(s).
@ -82,7 +83,7 @@ public class PreferenceParser {
private String joinBreadcrumbs(final List<String> breadcrumbs) { private String joinBreadcrumbs(final List<String> breadcrumbs) {
return breadcrumbs.stream() return breadcrumbs.stream()
.filter(crumb -> !TextUtils.isEmpty(crumb)) .filter(crumb -> !TextUtils.isEmpty(crumb))
.reduce("", searchConfiguration.getBreadcrumbConcat()); .collect(Collectors.joining(" > "));
} }
private String getAttribute( private String getAttribute(

View File

@ -12,9 +12,6 @@ import java.util.function.BinaryOperator;
import java.util.stream.Stream; import java.util.stream.Stream;
public class PreferenceSearchConfiguration { public class PreferenceSearchConfiguration {
private BinaryOperator<String> breadcrumbConcat =
(s1, s2) -> TextUtils.isEmpty(s1) ? s2 : (s1 + " > " + s2);
private PreferenceSearchFunction searcher = new PreferenceFuzzySearchFunction(); private PreferenceSearchFunction searcher = new PreferenceFuzzySearchFunction();
private final List<String> parserIgnoreElements = Arrays.asList( private final List<String> parserIgnoreElements = Arrays.asList(
@ -24,18 +21,10 @@ public class PreferenceSearchConfiguration {
PreferenceScreen.class.getSimpleName()); PreferenceScreen.class.getSimpleName());
public void setBreadcrumbConcat(final BinaryOperator<String> breadcrumbConcat) {
this.breadcrumbConcat = Objects.requireNonNull(breadcrumbConcat);
}
public void setSearcher(final PreferenceSearchFunction searcher) { public void setSearcher(final PreferenceSearchFunction searcher) {
this.searcher = Objects.requireNonNull(searcher); this.searcher = Objects.requireNonNull(searcher);
} }
public BinaryOperator<String> getBreadcrumbConcat() {
return breadcrumbConcat;
}
public PreferenceSearchFunction getSearcher() { public PreferenceSearchFunction getSearcher() {
return searcher; return searcher;
} }