sPFApp/src/main/java/it/polimi/spf/app/fragments/profile/ProfileFieldViewFactory.java
@SuppressWarnings("unchecked")
	private <E> View createTagView(TagProfileField field, String[] currentValue, FieldValueListener<E> listener, ViewGroup container, boolean editable) {
		View result = mInflater.inflate(editable ? R.layout.profileedit_field_tag : R.layout.profileview_tag_field, container, false);

		String friendlyName = mHelper.getFriendlyNameOfField(field);
		((TextView) result.findViewById(R.id.profileedit_field_identifier)).setText(friendlyName);

		TagsPicker picker = (TagsPicker) result.findViewById(R.id.profileedit_tags_picker);
		picker.setEditable(editable);

		if (currentValue != null) {
			picker.setInitialTags(Arrays.asList(currentValue));
		}
		if (editable) {
			picker.setChangeListener(new OnChangeListenerAdapter(field, (FieldValueListener<String[]>) listener));
		}

		setUpCircleView(result, (ProfileField<E>) field, listener);

		return result;
	}
@SuppressWarnings("unchecked")
	private <E> View createTagView(TagProfileField field, String[] currentValue, FieldValueListener<E> listener, ViewGroup container, boolean editable) {
		View result = mInflater.inflate(editable ? R.layout.profileedit_field_tag : R.layout.profileview_tag_field, container, false);

		String friendlyName = mHelper.getFriendlyNameOfField(field);
		((TextView) result.findViewById(R.id.profileedit_field_identifier)).setText(friendlyName);

		TagsPicker picker = (TagsPicker) result.findViewById(R.id.profileedit_tags_picker);
		picker.setEditable(editable);

		if (currentValue != null) {
			picker.setInitialTags(Arrays.asList(currentValue));
		}
		if (editable) {
			picker.setChangeListener(new OnChangeListenerAdapter(field, (FieldValueListener<String[]>) listener));
		}

		setUpCircleView(result, (ProfileField<E>) field, listener);

		return result;
	}
@ SuppressWarnings ( "unchecked" ) private < E > View createTagView ( TagProfileField field , String [ ] currentValue , FieldValueListener < E > listener , ViewGroup container , boolean editable ) { View result = mInflater . inflate ( editable ? R . layout . profileedit_field_tag : R . layout . profileview_tag_field , container , false ) ; String friendlyName = mHelper . getFriendlyNameOfField ( field ) ; ( ( TextView ) result . findViewById ( R . id . profileedit_field_identifier ) ) . setText ( friendlyName ) ; TagsPicker picker = ( TagsPicker ) result . findViewById ( R . id . profileedit_tags_picker ) ; picker . setEditable ( editable ) ; if ( currentValue != null ) { picker . setInitialTags ( Arrays . asList ( currentValue ) ) ; } if ( editable ) { picker . setChangeListener ( new OnChangeListenerAdapter ( field , ( FieldValueListener < String [ ] > ) listener ) ) ; } setUpCircleView ( result , ( ProfileField < E > ) field , listener ) ; return result ; }
Edit and display view for tags
Edit and display view for tags