[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

@@ -46,6 +46,14 @@ public abstract class AccessibilityFooterPreferenceController extends BasePrefer
updateFooterPreferences(footerPreference);
}
/**
* Override this if showing a help item in the footer bar, by returning the resource id.
*
* @return the resource id for the help url
*/
protected int getHelpResource() {
return 0;
}
/** Returns the accessibility feature name. */
protected abstract String getLabelName();
@@ -54,5 +62,10 @@ public abstract class AccessibilityFooterPreferenceController extends BasePrefer
final String iconContentDescription = mContext.getString(
R.string.accessibility_introduction_title, getLabelName());
footerPreference.setIconContentDescription(iconContentDescription);
if (getHelpResource() != 0) {
footerPreference.appendHelpLink(getHelpResource());
footerPreference.setLinkEnabled(true);
}
}
}