use of org.odk.collect.android.preferences.ServerPreferencesAdder in project collect by opendatakit.
the class ServerPreferencesFragment method addServerPreferences.
public void addServerPreferences() {
if (!new ServerPreferencesAdder(this).add()) {
return;
}
EditTextPreference serverUrlPreference = findPreference(ProjectKeys.KEY_SERVER_URL);
EditTextPreference usernamePreference = findPreference(ProjectKeys.KEY_USERNAME);
passwordPreference = findPreference(ProjectKeys.KEY_PASSWORD);
serverUrlPreference.setOnPreferenceChangeListener(createChangeListener());
serverUrlPreference.setSummary(serverUrlPreference.getText());
usernamePreference.setOnPreferenceChangeListener(createChangeListener());
usernamePreference.setSummary(usernamePreference.getText());
usernamePreference.setOnBindEditTextListener(editText -> {
editText.setFilters(new InputFilter[] { new ControlCharacterFilter() });
});
passwordPreference.setOnPreferenceChangeListener(createChangeListener());
maskPasswordSummary(passwordPreference.getText());
passwordPreference.setOnBindEditTextListener(editText -> {
editText.setFilters(new InputFilter[] { new ControlCharacterFilter() });
});
}
Aggregations