summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SettingsPreferenceFragment.java
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2015-04-14 15:06:39 -0400
committerJason Monk <jmonk@google.com>2015-04-14 15:43:20 -0400
commit23acc2bb8af7da000d72a8c1d8c28a2792200348 (patch)
tree1b1995de35251f9b0e73c9b2fba5a96a9cd52839 /src/com/android/settings/SettingsPreferenceFragment.java
parent5f937152a5b851a3a2d9e03208a4b4b5f16bae94 (diff)
downloadpackages_apps_Settings-23acc2bb8af7da000d72a8c1d8c28a2792200348.zip
packages_apps_Settings-23acc2bb8af7da000d72a8c1d8c28a2792200348.tar.gz
packages_apps_Settings-23acc2bb8af7da000d72a8c1d8c28a2792200348.tar.bz2
Allow help to be defined to intent uri
Allow help uris to be either an intent uri or as uri (as they were before). Also add a default help uri, and specific helps for several screens. Bug: 15475009 Change-Id: Iff982892973f01d32ff61ea88d4844e9a7153500
Diffstat (limited to 'src/com/android/settings/SettingsPreferenceFragment.java')
-rw-r--r--src/com/android/settings/SettingsPreferenceFragment.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index bf41c80..74cb0fe 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -50,14 +50,13 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
private static final String TAG = "SettingsPreferenceFragment";
- private static final int MENU_HELP = Menu.FIRST + 100;
private static final int DELAY_HIGHLIGHT_DURATION_MILLIS = 600;
private static final String SAVE_HIGHLIGHTED_KEY = "android:preference_highlighted";
private SettingsDialogFragment mDialogFragment;
- private String mHelpUrl;
+ private String mHelpUri;
// Cache the content resolver for async callbacks
private ContentResolver mContentResolver;
@@ -93,7 +92,7 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
// Prepare help url and enable menu if necessary
int helpResource = getHelpResource();
if (helpResource != 0) {
- mHelpUrl = getResources().getString(helpResource);
+ mHelpUri = getResources().getString(helpResource);
}
}
@@ -125,7 +124,7 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- if (!TextUtils.isEmpty(mHelpUrl)) {
+ if (!TextUtils.isEmpty(mHelpUri)) {
setHasOptionsMenu(true);
}
}
@@ -273,14 +272,13 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
* @return the resource id for the help url
*/
protected int getHelpResource() {
- return 0;
+ return R.string.help_uri_default;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if (mHelpUrl != null && getActivity() != null) {
- MenuItem helpItem = menu.add(0, MENU_HELP, 0, R.string.help_label);
- HelpUtils.prepareHelpMenuItem(getActivity(), helpItem, mHelpUrl);
+ if (mHelpUri != null && getActivity() != null) {
+ HelpUtils.prepareHelpMenuItem(getActivity(), menu, mHelpUri);
}
}