use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class BugReportHandlerPicker method addStaticPreferences.
@Override
protected void addStaticPreferences(PreferenceScreen screen) {
if (mFooter == null) {
mFooter = new FooterPreference(screen.getContext());
mFooter.setIcon(R.drawable.ic_info_outline_24dp);
mFooter.setSingleLineTitle(false);
mFooter.setTitle(R.string.bug_report_handler_picker_footer_text);
mFooter.setSelectable(false);
}
screen.addPreference(mFooter);
}
use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class PremiumSmsAccess method updatePrefs.
private void updatePrefs(ArrayList<AppEntry> apps) {
if (apps == null)
return;
setEmptyText(R.string.premium_sms_none);
setLoading(false, true);
final PreferenceScreen screen = getPreferenceScreen();
screen.removeAll();
screen.setOrderingAsAdded(true);
for (int i = 0; i < apps.size(); i++) {
final PremiumSmsPreference smsPreference = new PremiumSmsPreference(apps.get(i), getPrefContext());
smsPreference.setOnPreferenceChangeListener(this);
screen.addPreference(smsPreference);
}
if (apps.size() != 0) {
FooterPreference footer = new FooterPreference(getPrefContext());
footer.setTitle(R.string.premium_sms_warning);
screen.addPreference(footer);
}
}
use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class WirelessDebuggingFragment method addPreferences.
private void addPreferences() {
mDeviceNamePreference = (Preference) findPreference(PREF_KEY_ADB_DEVICE_NAME);
mIpAddrPreference = (Preference) findPreference(PREF_KEY_ADB_IP_ADDR);
mPairingMethodsCategory = (PreferenceCategory) findPreference(PREF_KEY_PAIRING_METHODS_CATEGORY);
mCodePairingPreference = (Preference) findPreference(PREF_KEY_ADB_CODE_PAIRING);
mCodePairingPreference.setOnPreferenceClickListener(preference -> {
showDialog(AdbWirelessDialogUiBase.MODE_PAIRING);
return true;
});
mPairedDevicesCategory = (PreferenceCategory) findPreference(PREF_KEY_PAIRED_DEVICES_CATEGORY);
mFooterCategory = (PreferenceCategory) findPreference(PREF_KEY_FOOTER_CATEGORY);
mOffMessagePreference = new FooterPreference(mFooterCategory.getContext());
final CharSequence title = getText(R.string.adb_wireless_list_empty_off);
mOffMessagePreference.setTitle(title);
mFooterCategory.addPreference(mOffMessagePreference);
}
use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class EnterpriseDisclosurePreferenceController method updateFooterPreference.
void updateFooterPreference(PreferenceScreen screen, CharSequence disclosure) {
final FooterPreference footerPreference = screen.findPreference(getPreferenceKey());
footerPreference.setTitle(disclosure);
footerPreference.setLearnMoreAction(view -> {
mContext.startActivity(new Intent(Settings.ACTION_ENTERPRISE_PRIVACY_SETTINGS));
});
final String learnMoreContentDescription = mContext.getString(R.string.footer_learn_more_content_description, getLabelName());
footerPreference.setLearnMoreContentDescription(learnMoreContentDescription);
}
use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class ScreenTimeoutSettings method setupDisabledFooterPreference.
@VisibleForTesting
void setupDisabledFooterPreference() {
final String textDisabledByAdmin = getResources().getString(R.string.admin_disabled_other_options);
final String textMoreDetails = getResources().getString(R.string.admin_more_details);
final SpannableString spannableString = new SpannableString(textDisabledByAdmin + System.lineSeparator() + System.lineSeparator() + textMoreDetails);
final ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(@NonNull View widget) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(getContext(), mAdmin);
}
};
if (textDisabledByAdmin != null && textMoreDetails != null) {
spannableString.setSpan(clickableSpan, textDisabledByAdmin.length() + 1, textDisabledByAdmin.length() + textMoreDetails.length() + 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
mDisableOptionsPreference = new FooterPreference(getContext());
mDisableOptionsPreference.setLayoutResource(R.layout.preference_footer);
mDisableOptionsPreference.setTitle(spannableString);
mDisableOptionsPreference.setSelectable(false);
mDisableOptionsPreference.setIcon(R.drawable.ic_info_outline_24dp);
// The 'disabled by admin' preference should always be at the end of the setting page.
mDisableOptionsPreference.setOrder(DEFAULT_ORDER_OF_LOWEST_PREFERENCE);
mPrivacyPreference.setOrder(DEFAULT_ORDER_OF_LOWEST_PREFERENCE - 1);
}
Aggregations