diff --git a/android-tru-forms/src/main/java/com/trufla/androidtruforms/TruFormFragment.java b/android-tru-forms/src/main/java/com/trufla/androidtruforms/TruFormFragment.java index 1830fa4..12ddb50 100644 --- a/android-tru-forms/src/main/java/com/trufla/androidtruforms/TruFormFragment.java +++ b/android-tru-forms/src/main/java/com/trufla/androidtruforms/TruFormFragment.java @@ -55,16 +55,18 @@ * create an instance of this fragment. */ -public class TruFormFragment extends Fragment implements FormContract, CollectDataAsync.AsyncResponse { +public class TruFormFragment extends Fragment implements FormContract, CollectDataAsync.AsyncResponse +{ private static final int PICK_IMAGE_CODE = 1; private static final int CAPTURE_IMAGE_CODE = 2; private static final int PERMISSION_REQUEST_CODE = 1; - private OnFormActionsListener mListener; private static final String SCHEMA_KEY = "SCHEMA_KEY"; private static final String JSON_KEY = "JSON_VALUE"; private static final String SCHEMA_TYPE = "schema_type"; + private TruFormView truFormView; + private OnFormActionsListener mListener; TruConsumer mPickedImageListener; TruConsumer>> mDataFetchListener; ProgressDialog progressDialog; @@ -82,7 +84,6 @@ public class TruFormFragment extends Fragment implements FormContract, CollectDa private ImageCompressTask imageCompressTask; public TruFormFragment() { - } public static TruFormFragment newInstance(int schemaType, String schemaString) { @@ -356,11 +357,10 @@ public void processFinish(String output) { } } - public interface OnFormActionsListener { + public interface OnFormActionsListener + { void showDialog(); - void onFormSubmitted(String jsonReperesentation); - void onFormFailed(); } diff --git a/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java b/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java index a0c9e95..da8c55c 100644 --- a/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java +++ b/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java @@ -2,6 +2,7 @@ import android.content.Context; import android.text.Editable; +import android.text.Html; import android.text.InputType; import android.text.TextUtils; import android.text.TextWatcher; @@ -53,12 +54,10 @@ protected void buildSubview() { editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { - } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - } @Override @@ -114,9 +113,14 @@ public String getInputtedData() { } @NonNull - protected String extractData() { - return Objects.requireNonNull((textInputLayout) + protected String extractData() + { + String editTextValue = Objects.requireNonNull((textInputLayout) .getEditText()).getText().toString().trim(); + return editTextValue.replaceAll("\n","<br>"); + +// return Objects.requireNonNull((textInputLayout) +// .getEditText()).getText().toString().trim(); } @@ -204,7 +208,7 @@ protected void removeErrorMsg() { protected void setNonEditableValues(Object constItem) { if (constItem instanceof String) { Objects.requireNonNull(((TextInputLayout) mView.findViewById(R.id.input_view_container)) - .getEditText()).setText(constItem.toString()); + .getEditText()).setText(Html.fromHtml(Html.fromHtml(constItem.toString()).toString())); } if (textInputLayout != null) textInputLayout.setEnabled(false); diff --git a/app/src/main/res/raw/claims.json b/app/src/main/res/raw/claims.json index 3b04414..ac8355b 100644 --- a/app/src/main/res/raw/claims.json +++ b/app/src/main/res/raw/claims.json @@ -1,58 +1,20 @@ { - "title": "Other Claim", + "title": "Manage My Coverage - Home", + "description": "Manage My Coverage", "type": "object", "properties": { - "claim_information": { - "type": "object", - "properties": { - "claim_description": { - "type": "string" - }, - "date_of_loss": { - "type": "string", - "format": "date" - }, - "your_damage_photos": { - "type": "array", - "items": { - "type": "object", - "properties": { - "photo": { - "type": "string", - "format": "photo" - } - } - } - } - }, - "required": [ - "claim_description", - "date_of_loss" - ] + "effective_date": { + "type": "string", + "format": "date" }, - "witness_information": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string", - "format": "email" - }, - "home_phone_number": { - "type": "string", - "format": "tel" - }, - "cell_phone_number": { - "type": "string", - "format": "tel" - } - } - } + "coverage_request": { + "title": "Please tell us what changes you require to your coverage", + "type": "string", + "format": "textarea" } }, - "required": [] + "required": [ + "effective_date", + "coverage_request" + ] } \ No newline at end of file diff --git a/app/src/main/res/raw/claims_edited.json b/app/src/main/res/raw/claims_edited.json index 3b04414..ac8355b 100644 --- a/app/src/main/res/raw/claims_edited.json +++ b/app/src/main/res/raw/claims_edited.json @@ -1,58 +1,20 @@ { - "title": "Other Claim", + "title": "Manage My Coverage - Home", + "description": "Manage My Coverage", "type": "object", "properties": { - "claim_information": { - "type": "object", - "properties": { - "claim_description": { - "type": "string" - }, - "date_of_loss": { - "type": "string", - "format": "date" - }, - "your_damage_photos": { - "type": "array", - "items": { - "type": "object", - "properties": { - "photo": { - "type": "string", - "format": "photo" - } - } - } - } - }, - "required": [ - "claim_description", - "date_of_loss" - ] + "effective_date": { + "type": "string", + "format": "date" }, - "witness_information": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string", - "format": "email" - }, - "home_phone_number": { - "type": "string", - "format": "tel" - }, - "cell_phone_number": { - "type": "string", - "format": "tel" - } - } - } + "coverage_request": { + "title": "Please tell us what changes you require to your coverage", + "type": "string", + "format": "textarea" } }, - "required": [] + "required": [ + "effective_date", + "coverage_request" + ] } \ No newline at end of file