Skip to content

Commit 406d91a

Browse files
committed
Search: include all pref group children in case group itself matches
1 parent 7c7cd4b commit 406d91a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/com/ceco/oreo/gravitybox/GravityBoxSettings.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,18 +2005,16 @@ private int filterPreferencesInternal(PreferenceGroup prefGroup, PreferenceGroup
20052005
for (int i = count-1; i >= 0; i--) {
20062006
Preference p = prefGroup.getPreference(i);
20072007
p.setDependency(null);
2008-
if (p instanceof PreferenceGroup && p.getIntent() == null) {
2008+
String title = (p.getTitle() == null ? "" :
2009+
p.getTitle().toString()).toLowerCase(Locale.getDefault());
2010+
String summary = (p.getSummary() == null ? "" :
2011+
p.getSummary().toString()).toLowerCase(Locale.getDefault());
2012+
if (p.isEnabled() && (title.contains(mSearchQuery) || summary.contains(mSearchQuery))) {
2013+
matchCount++;
2014+
} else if (p instanceof PreferenceGroup && p.getIntent() == null) {
20092015
matchCount += filterPreferencesInternal((PreferenceGroup)p, prefGroup);
20102016
} else {
2011-
String title = (p.getTitle() == null ? "null" :
2012-
p.getTitle().toString()).toLowerCase(Locale.getDefault());
2013-
String summary = (p.getSummary() == null ? "null" :
2014-
p.getSummary().toString()).toLowerCase(Locale.getDefault());
2015-
if (p.isEnabled() && (title.contains(mSearchQuery) || summary.contains(mSearchQuery))) {
2016-
matchCount++;
2017-
} else {
2018-
prefGroup.removePreference(p);
2019-
}
2017+
prefGroup.removePreference(p);
20202018
}
20212019
}
20222020
if (parentGroup != null && matchCount == 0 && prefGroup.getIntent() == null) {

0 commit comments

Comments
 (0)