Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
KnollFrank committed Dec 3, 2024
1 parent fe46a2c commit 36126bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
private int statusBarColor = -1;
private boolean nightMode;
private boolean wasDrawerDisabled;
// FK-TODO: remove configureSettingsSearch?
private boolean configureSettingsSearch = false;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import net.osmand.plus.plugins.PluginsHelper;
import net.osmand.plus.settings.fragments.SettingsScreenType;

import java.util.stream.Stream;

import javax.annotation.Nullable;

import de.KnollFrank.lib.settingssearch.db.preference.pojo.SearchablePreferencePOJO;
Expand All @@ -20,11 +22,16 @@ public boolean includePreferenceInSearchResults(final SearchablePreferencePOJO p

private static boolean isPreferenceConnectedToAnyInactivePlugin(final SearchablePreferencePOJO preference,
final Class<? extends PreferenceFragmentCompat> hostOfPreference) {
return IncludePreferenceInSearchResultsPredicate
.getInactivePlugins()
.anyMatch(inactivePlugin -> isPreferenceConnectedToPlugin(preference, hostOfPreference, inactivePlugin));
}

private static Stream<OsmandPlugin> getInactivePlugins() {
return PluginsHelper
.getAvailablePlugins()
.stream()
.filter(plugin -> !plugin.isActive())
.anyMatch(inactivePlugin -> isPreferenceConnectedToPlugin(preference, hostOfPreference, inactivePlugin));
.filter(plugin -> !plugin.isActive());
}

private static boolean isPreferenceConnectedToPlugin(final SearchablePreferencePOJO preference,
Expand Down

0 comments on commit 36126bc

Please sign in to comment.