Enable highlighting of Print services

- add to SettingsPreferenceFragment to know when the associated
RootAdapter is changing and thus being able to find the highlighted
Preference
- also, add the correct Search key during indexing. She should
match the one created when adding dynamically the Preference
- last, increase to 400ms the delay to do the highlight

Change-Id: I3a1a81fdf5c8ab5f3aaab29f16ea9879ab6df056
This commit is contained in:
Fabrice Di Meglio
2014-04-18 19:40:40 -07:00
parent 7476f5b904
commit c853a4282d
2 changed files with 29 additions and 3 deletions

View File

@@ -565,7 +565,13 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
final int serviceCount = services.size();
for (int i = 0; i < serviceCount; i++) {
PrintServiceInfo service = services.get(i);
ComponentName componentName = new ComponentName(
service.getResolveInfo().serviceInfo.packageName,
service.getResolveInfo().serviceInfo.name);
SearchIndexableRaw indexable = new SearchIndexableRaw(context);
indexable.key = componentName.flattenToString();
indexable.title = service.getResolveInfo().loadLabel(packageManager).toString();
indexable.summaryOn = context.getString(R.string.print_feature_state_on);
indexable.summaryOff = context.getString(R.string.print_feature_state_off);