Skip to content

Commit

Permalink
updating SearchPreference dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
KnollFrank committed May 29, 2024
1 parent 9f62684 commit eda1532
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion OsmAnd/build-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ dependencies {
implementation "androidx.car.app:app-projected:1.2.0"

implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.github.KnollFrank:SearchPreference:ce6f01bad4'
implementation 'com.github.KnollFrank:SearchPreference:0bb034822d'
implementation 'com.google.guava:guava:33.2.0-android'

//implementation "androidx.tracing:tracing:1.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.Preference.OnPreferenceClickListener;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceGroupAdapter;
import androidx.preference.PreferenceManager;
Expand All @@ -49,7 +48,6 @@

import com.bytehamster.lib.preferencesearch.BaseSearchPreferenceFragment;
import com.bytehamster.lib.preferencesearch.PreferenceFragments;
import com.bytehamster.lib.preferencesearch.PreferenceScreensProvider;
import com.bytehamster.lib.preferencesearch.SearchConfiguration;
import com.bytehamster.lib.preferencesearch.SearchPreference;
import com.google.android.material.appbar.AppBarLayout;
Expand Down Expand Up @@ -88,7 +86,6 @@

import java.io.Serializable;
import java.util.Set;
import java.util.stream.Collectors;

public abstract class BaseSettingsFragment extends BaseSearchPreferenceFragment implements OnPreferenceChangeListener,
OnPreferenceClickListener, AppModeChangedListener, OnConfirmPreferenceChange, OnPreferenceChanged {
Expand Down Expand Up @@ -398,19 +395,11 @@ private void setupSearchablePreferences() {
final SearchConfiguration config = searchPreference.getSearchConfiguration();
config.setActivity(getMapActivity());
config.setFragmentContainerViewId(FRAGMENT_CONTAINER_VIEW);
config.setPreferenceFragmentsSupplier(() -> getPreferenceFragments(new MainSettingsFragment()));
config.setPreferenceFragmentsSupplier(() -> PreferenceFragments.getPreferenceFragments(new MainSettingsFragment(), getActivity(), FRAGMENT_CONTAINER_VIEW));
config.setFuzzySearchEnabled(false);
}
}

private Set<Class<? extends PreferenceFragmentCompat>> getPreferenceFragments(final PreferenceFragmentCompat root) {
return new PreferenceScreensProvider(new PreferenceFragments(getActivity(), FRAGMENT_CONTAINER_VIEW))
.getPreferenceScreens(root)
.stream()
.map(preferenceScreenWithHost -> preferenceScreenWithHost.host)
.collect(Collectors.toSet());
}

protected void onBindPreferenceViewHolder(@NonNull Preference preference, @NonNull PreferenceViewHolder holder) {
if (preference.isSelectable()) {
View selectableView = holder.itemView.findViewById(R.id.selectable_list_item);
Expand Down

0 comments on commit eda1532

Please sign in to comment.