Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
KnollFrank committed Dec 15, 2024
1 parent 44c8441 commit 4bec58f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
import org.apache.commons.logging.Log;

import java.io.Serializable;
import java.util.Optional;
import java.util.Set;

public abstract class BaseSettingsFragment extends PreferenceFragmentCompat implements OnPreferenceChangeListener,
Expand Down Expand Up @@ -335,10 +334,10 @@ public final boolean onConfirmPreferenceChange(String prefId, Object newValue, A
@Override
public boolean onPreferenceClick(final Preference preference) {
if (this instanceof final PreferenceFragmentHandlerProvider preferenceFragmentHandlerProvider) {
final Optional<PreferenceFragmentHandler> preferenceFragmentHandler = preferenceFragmentHandlerProvider.getPreferenceFragmentHandler(preference);
if (preferenceFragmentHandler.isPresent()) {
return showPreferenceFragment(preferenceFragmentHandler.get());
}
return preferenceFragmentHandlerProvider
.getPreferenceFragmentHandler(preference)
.map(this::showPreferenceFragment)
.orElse(false);
}
return false;
}
Expand Down

0 comments on commit 4bec58f

Please sign in to comment.