diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java b/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java index 8ba62bdd8..3a21ade3b 100644 --- a/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java +++ b/src/main/java/eu/siacs/conversations/ui/forms/FormFieldWrapper.java @@ -45,10 +45,14 @@ public abstract class FormFieldWrapper { abstract List<String> getValues(); + protected abstract void setValues(List<String> values); + abstract boolean validates(); abstract protected int getLayoutResource(); + abstract void setReadOnly(boolean readOnly); + protected SpannableString createSpannableLabelString(String label, boolean required) { SpannableString spannableString = new SpannableString(label + (required ? " *" : "")); if (required) { @@ -61,11 +65,8 @@ public abstract class FormFieldWrapper { } protected void invokeOnFormFieldValuesEdited() { - Log.d(Config.LOGTAG, "invoke on form field values edited"); if (this.onFormFieldValuesEditedListener != null) { this.onFormFieldValuesEditedListener.onFormFieldValuesEdited(); - } else { - Log.d(Config.LOGTAG,"listener is null"); } } @@ -79,7 +80,9 @@ public abstract class FormFieldWrapper { protected static <F extends FormFieldWrapper> FormFieldWrapper createFromField(Class<F> c, Context context, Field field) { try { - return c.getDeclaredConstructor(Context.class, Field.class).newInstance(context,field); + F fieldWrapper = c.getDeclaredConstructor(Context.class, Field.class).newInstance(context,field); + fieldWrapper.setValues(field.getValues()); + return fieldWrapper; } catch (Exception e) { e.printStackTrace(); return null; |