[Material Next] Support "Learn more" for help link

Allow CaptionManager, Magnification, Color correction, Color inversion,
Time to take action, and Autoclick.

Bug: 187671696
Test: make RunSettingsRoboTests -j52 ROBOTEST_FILTER=AccessibilityFooterPreferenceTest
Change-Id: I9d753243d4f61b6b3d58b50425b7a75a812a481d
This commit is contained in:
menghanli
2021-05-10 16:15:29 +08:00
parent 8a7f55246f
commit 7979d9337a
9 changed files with 88 additions and 3 deletions

View File

@@ -303,6 +303,11 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
return SettingsEnums.ACCESSIBILITY_SERVICE;
}
@Override
public int getHelpResource() {
return 0;
}
@Override
public void onDestroyView() {
super.onDestroyView();
@@ -508,7 +513,13 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
new AccessibilityFooterPreference(screen.getContext());
htmlFooterPreference.setKey(KEY_HTML_DESCRIPTION_PREFERENCE);
htmlFooterPreference.setSummary(htmlDescription);
htmlFooterPreference.setLinkEnabled(false);
// Only framework tools support help link
if (getHelpResource() != 0) {
htmlFooterPreference.appendHelpLink(getHelpResource());
htmlFooterPreference.setLinkEnabled(true);
} else {
htmlFooterPreference.setLinkEnabled(false);
}
htmlFooterPreference.setIconContentDescription(iconContentDescription);
screen.addPreference(htmlFooterPreference);
}
@@ -542,6 +553,10 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
new AccessibilityFooterPreference(screen.getContext());
footerPreference.setSummary(summary);
footerPreference.setIconContentDescription(iconContentDescription);
if (getHelpResource() != 0) {
footerPreference.appendHelpLink(getHelpResource());
footerPreference.setLinkEnabled(true);
}
screen.addPreference(footerPreference);
}