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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user