本文整理汇总了Java中android.preference.EditTextPreference.setDialogTitle方法的典型用法代码示例。如果您正苦于以下问题:Java EditTextPreference.setDialogTitle方法的具体用法?Java EditTextPreference.setDialogTitle怎么用?Java EditTextPreference.setDialogTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.preference.EditTextPreference
的用法示例。
在下文中一共展示了EditTextPreference.setDialogTitle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPasswordPreference
import android.preference.EditTextPreference; //导入方法依赖的package包/类
/**
* Добавить в группу параметров (на экран/в категорию) параметр задания пароля для удаления постов/файлов
* @param group группа, на которую добавляется параметр
*/
protected void addPasswordPreference(PreferenceGroup group) {
final Context context = group.getContext();
EditTextPreference passwordPref = new EditTextPreference(context) {
@Override
protected void showDialog(Bundle state) {
if (createPassword()) {
setText(getDefaultPassword());
}
super.showDialog(state);
}
};
passwordPref.setTitle(R.string.pref_password_title);
passwordPref.setDialogTitle(R.string.pref_password_title);
passwordPref.setSummary(R.string.pref_password_summary);
passwordPref.setKey(getSharedKey(PREF_KEY_PASSWORD));
passwordPref.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
passwordPref.getEditText().setSingleLine();
passwordPref.getEditText().setFilters(new InputFilter[] { new InputFilter.LengthFilter(255) });
group.addPreference(passwordPref);
}
示例2: addDomainPreferences
import android.preference.EditTextPreference; //导入方法依赖的package包/类
private void addDomainPreferences(PreferenceGroup group) {
Context context = group.getContext();
Preference.OnPreferenceChangeListener updateDomainListener = new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference.getKey().equals(getSharedKey(PREF_KEY_DOMAIN))) {
domain = (String) newValue;
if (domain.length() == 0) domain = DEFAULT_DOMAIN;
loadHanabiraCookie();
return true;
}
return false;
}
};
EditTextPreference domainPref = new EditTextPreference(context);
domainPref.setTitle(R.string.pref_domain);
domainPref.setDialogTitle(R.string.pref_domain);
domainPref.setSummary(resources.getString(R.string.pref_domain_summary, DOMAINS_HINT));
domainPref.setKey(getSharedKey(PREF_KEY_DOMAIN));
domainPref.getEditText().setHint(DEFAULT_DOMAIN);
domainPref.getEditText().setSingleLine();
domainPref.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
domainPref.setOnPreferenceChangeListener(updateDomainListener);
group.addPreference(domainPref);
}
示例3: addKompturcodePreference
import android.preference.EditTextPreference; //导入方法依赖的package包/类
public void addKompturcodePreference(PreferenceGroup preferenceGroup) {
Context context = preferenceGroup.getContext();
EditTextPreference kompturcodePreference = new EditTextPreference(context);
kompturcodePreference.setTitle(R.string.kraut_prefs_kompturcode);
kompturcodePreference.setDialogTitle(R.string.kraut_prefs_kompturcode);
kompturcodePreference.setSummary(R.string.kraut_prefs_kompturcode_summary);
kompturcodePreference.setKey(getSharedKey(PREF_KEY_KOMPTURCODE_COOKIE));
kompturcodePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
setKompturcodeCookie((String) newValue);
return true;
}
});
preferenceGroup.addPreference(kompturcodePreference);
}
示例4: addPreferencesOnScreen
import android.preference.EditTextPreference; //导入方法依赖的package包/类
@Override
public void addPreferencesOnScreen(PreferenceGroup preferenceGroup) {
Context context = preferenceGroup.getContext();
addPasswordPreference(preferenceGroup);
CheckBoxPreference onionPref = new LazyPreferences.CheckBoxPreference(context);
onionPref.setTitle(R.string.pref_use_onion);
onionPref.setSummary(R.string.pref_use_onion_summary);
onionPref.setKey(getSharedKey(PREF_KEY_USE_ONION));
onionPref.setDefaultValue(false);
onionPref.setDisableDependentsState(true);
preferenceGroup.addPreference(onionPref);
EditTextPreference domainPref = new EditTextPreference(context);
domainPref.setTitle(R.string.pref_domain);
domainPref.setDialogTitle(R.string.pref_domain);
domainPref.setSummary(resources.getString(R.string.pref_domain_summary, DOMAINS_HINT));
domainPref.setKey(getSharedKey(PREF_KEY_DOMAIN));
domainPref.getEditText().setHint(DEFAULT_DOMAIN);
domainPref.getEditText().setSingleLine();
domainPref.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
preferenceGroup.addPreference(domainPref);
domainPref.setDependency(getSharedKey(PREF_KEY_USE_ONION));
addProxyPreferences(preferenceGroup);
}
示例5: addProxyPreferences
import android.preference.EditTextPreference; //导入方法依赖的package包/类
/**
* Добавить в группу параметров (на экран/в категорию) новую категорию настроек прокси-сервера
* @param group группа, на которую добавляются параметры
*/
protected void addProxyPreferences(PreferenceGroup group) {
final Context context = group.getContext();
PreferenceCategory proxyCat = new PreferenceCategory(context); //категория настроек прокси
proxyCat.setTitle(R.string.pref_cat_proxy);
group.addPreference(proxyCat);
CheckBoxPreference useProxyPref = new LazyPreferences.CheckBoxPreference(context); //чекбокс "использовать ли прокси вообще"
useProxyPref.setTitle(R.string.pref_use_proxy);
useProxyPref.setSummary(R.string.pref_use_proxy_summary);
useProxyPref.setKey(getSharedKey(PREF_KEY_USE_PROXY));
useProxyPref.setDefaultValue(false);
useProxyPref.setOnPreferenceChangeListener(updateHttpListener);
proxyCat.addPreference(useProxyPref);
EditTextPreference proxyHostPref = new LazyPreferences.EditTextPreference(context); //поле ввода адреса прокси-сервера
proxyHostPref.setTitle(R.string.pref_proxy_host);
proxyHostPref.setDialogTitle(R.string.pref_proxy_host);
proxyHostPref.setSummary(R.string.pref_proxy_host_summary);
proxyHostPref.setKey(getSharedKey(PREF_KEY_PROXY_HOST));
proxyHostPref.setDefaultValue(DEFAULT_PROXY_HOST);
proxyHostPref.getEditText().setSingleLine();
proxyHostPref.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
proxyHostPref.setOnPreferenceChangeListener(updateHttpListener);
proxyCat.addPreference(proxyHostPref);
proxyHostPref.setDependency(getSharedKey(PREF_KEY_USE_PROXY));
EditTextPreference proxyHostPort = new LazyPreferences.EditTextPreference(context); //поле ввода порта прокси-сервера
proxyHostPort.setTitle(R.string.pref_proxy_port);
proxyHostPort.setDialogTitle(R.string.pref_proxy_port);
proxyHostPort.setSummary(R.string.pref_proxy_port_summary);
proxyHostPort.setKey(getSharedKey(PREF_KEY_PROXY_PORT));
proxyHostPort.setDefaultValue(DEFAULT_PROXY_PORT);
proxyHostPort.getEditText().setSingleLine();
proxyHostPort.getEditText().setInputType(InputType.TYPE_CLASS_NUMBER);
proxyHostPort.setOnPreferenceChangeListener(updateHttpListener);
proxyCat.addPreference(proxyHostPort);
proxyHostPort.setDependency(getSharedKey(PREF_KEY_USE_PROXY));
}
示例6: addPreferencesOnScreen
import android.preference.EditTextPreference; //导入方法依赖的package包/类
@Override
public void addPreferencesOnScreen(PreferenceGroup preferenceGroup) {
final Context context = preferenceGroup.getContext();
EditTextPreference passwordPref = new EditTextPreference(context);
passwordPref.setTitle(R.string.iichan_prefs_report_thread);
passwordPref.setDialogTitle(R.string.iichan_prefs_report_thread);
passwordPref.setSummary(R.string.iichan_prefs_report_thread_summary);
passwordPref.setKey(getSharedKey(PREF_KEY_REPORT_THREAD));
passwordPref.getEditText().setInputType(InputType.TYPE_CLASS_NUMBER);
passwordPref.getEditText().setSingleLine();
passwordPref.getEditText().setFilters(new InputFilter[] { new InputFilter.LengthFilter(255) });
preferenceGroup.addPreference(passwordPref);
super.addPreferencesOnScreen(preferenceGroup);
}
示例7: addDomainPreference
import android.preference.EditTextPreference; //导入方法依赖的package包/类
private void addDomainPreference(PreferenceGroup group) {
Context context = group.getContext();
EditTextPreference domainPref = new EditTextPreference(context);
domainPref.setTitle(R.string.pref_domain);
domainPref.setSummary(resources.getString(R.string.pref_domain_summary, DOMAINS_HINT));
domainPref.setDialogTitle(R.string.pref_domain);
domainPref.setKey(getSharedKey(PREF_KEY_DOMAIN));
domainPref.getEditText().setHint(DEFAULT_DOMAIN);
domainPref.getEditText().setSingleLine();
domainPref.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
group.addPreference(domainPref);
}
示例8: addDomainPreferences
import android.preference.EditTextPreference; //导入方法依赖的package包/类
/** Добавить категорию настроек домена (в т.ч. https) */
private void addDomainPreferences(PreferenceGroup group) {
Context context = group.getContext();
Preference.OnPreferenceChangeListener updateDomainListener = new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference.getKey().equals(getSharedKey(PREF_KEY_DOMAIN))) {
updateDomain((String) newValue, preferences.getBoolean(getSharedKey(PREF_KEY_USE_HTTPS_MAKABA), true));
return true;
} else if (preference.getKey().equals(getSharedKey(PREF_KEY_USE_HTTPS_MAKABA))) {
updateDomain(preferences.getString(getSharedKey(PREF_KEY_DOMAIN), DEFAULT_DOMAIN), (boolean)newValue);
return true;
}
return false;
}
};
PreferenceCategory domainCat = new PreferenceCategory(context);
domainCat.setTitle(R.string.makaba_prefs_domain_category);
group.addPreference(domainCat);
EditTextPreference domainPref = new EditTextPreference(context); //поле ввода домена
domainPref.setTitle(R.string.pref_domain);
domainPref.setDialogTitle(R.string.pref_domain);
domainPref.setSummary(resources.getString(R.string.pref_domain_summary, DOMAINS_HINT));
domainPref.setKey(getSharedKey(PREF_KEY_DOMAIN));
domainPref.getEditText().setHint(DEFAULT_DOMAIN);
domainPref.getEditText().setSingleLine();
domainPref.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
domainPref.setOnPreferenceChangeListener(updateDomainListener);
domainCat.addPreference(domainPref);
CheckBoxPreference httpsPref = new LazyPreferences.CheckBoxPreference(context); //чекбокс "использовать https"
httpsPref.setTitle(R.string.pref_use_https);
httpsPref.setSummary(R.string.pref_use_https_summary);
httpsPref.setKey(getSharedKey(PREF_KEY_USE_HTTPS_MAKABA));
httpsPref.setDefaultValue(true);
httpsPref.setOnPreferenceChangeListener(updateDomainListener);
domainCat.addPreference(httpsPref);
}
示例9: onCreate
import android.preference.EditTextPreference; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActivity().setTitle(getString(R.string.str_security));
//Without this android creates default xml file
getPreferenceManager().setSharedPreferencesName(PreferenceService.DEF_NAME_SHARED_PREFERENCE);
addPreferencesFromResource(R.xml.preference_security);
pincodeET = (EditTextPreference)findPreference(getString(R.string.key_pref_pincode_val_et));
pincodeET.setDialogTitle(getString(R.string.sum_pincode_val));
pincodeEnableCB = (CheckBoxPreference)findPreference(getString(R.string.key_pref_pincode_cb));
((EditTextPreference)findPreference(getString(R.string.key_pref_pincode_time_et)))
.setDialogTitle(getString(R.string.str_minutes));
}