Provides TC ID for accessibility framework feature for "about" and "learn more" part

Goal: Improve readability which is a bit difficult because of string concatenation for accurate translation.
Root cause: In some locales, framework features name would be a word rather than a product name. Hence it need to be in the different position in a sentence.
Solution: Use whole sentence to translate instead of concatenating the string could solve this issue.

Bug: 185478543
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityFooterPreferenceControllerTest
Change-Id: Id198805329be9c773df87f38a074ae956e4d0cdb
This commit is contained in:
menghanli
2021-07-09 13:29:26 +08:00
parent 7cbff10736
commit bae720ffc3
12 changed files with 303 additions and 81 deletions

View File

@@ -92,12 +92,20 @@ public final class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePrefe
updateSwitchBarToggleSwitch();
}
};
return super.onCreateView(inflater, container, savedInstanceState);
final View view = super.onCreateView(inflater, container, savedInstanceState);
updateFooterPreference();
return view;
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
private void updateFooterPreference() {
final String title = getPrefContext()
.getString(R.string.accessibility_daltonizer_about_title);
final String learnMoreContentDescription = getPrefContext()
.getString(R.string.accessibility_daltonizer_footer_learn_more_content_description);
mFooterPreferenceController.setIntroductionTitle(title);
mFooterPreferenceController.setupHelpLink(getHelpResource(), learnMoreContentDescription);
mFooterPreferenceController.displayPreference(getPreferenceScreen());
}
/** Customizes the order by preference key. */