diff --git a/app/src/main/java/org/secfirst/umbrella/whitelabel/feature/form/view/FormUI.kt b/app/src/main/java/org/secfirst/umbrella/whitelabel/feature/form/view/FormUI.kt index 7394d1d8..0e6c1733 100644 --- a/app/src/main/java/org/secfirst/umbrella/whitelabel/feature/form/view/FormUI.kt +++ b/app/src/main/java/org/secfirst/umbrella/whitelabel/feature/form/view/FormUI.kt @@ -1,32 +1,23 @@ package org.secfirst.umbrella.whitelabel.feature.form.view -import android.content.res.ColorStateList import android.graphics.drawable.ColorDrawable -import android.os.Build import android.support.v4.content.ContextCompat -import android.support.v4.graphics.drawable.DrawableCompat -import android.support.v4.view.ViewCompat -import android.support.v7.widget.AppCompatCheckBox import android.view.Gravity -import android.view.ViewManager import android.widget.CheckBox import android.widget.EditText import android.widget.RadioButton import com.stepstone.stepper.Step import com.stepstone.stepper.VerificationError import org.jetbrains.anko.* -import org.jetbrains.anko.appcompat.v7.linearLayoutCompat import org.jetbrains.anko.appcompat.v7.tintedCheckBox import org.jetbrains.anko.appcompat.v7.tintedRadioButton -import org.jetbrains.anko.custom.ankoView import org.secfirst.umbrella.whitelabel.R import org.secfirst.umbrella.whitelabel.data.database.form.Answer import org.secfirst.umbrella.whitelabel.data.database.form.Screen import org.secfirst.umbrella.whitelabel.feature.form.FieldType import org.secfirst.umbrella.whitelabel.feature.form.hasAnswer import org.secfirst.umbrella.whitelabel.feature.form.view.controller.FormController -import java.util.logging.Logger class FormUI(private val screen: Screen, private val answers: List?) : AnkoComponent, Step { @@ -39,6 +30,11 @@ class FormUI(private val screen: Screen, private val answers: List?) : A background = ColorDrawable(ContextCompat.getColor(context, R.color.form_background)) verticalLayout { padding = dip(20) + textView(screen.title){ + textSize = 20f + textColor = R.color.umbrella_purple + }.lparams{gravity = Gravity.CENTER_HORIZONTAL} + screen.items.forEach { item -> when (item.type) { @@ -61,9 +57,9 @@ class FormUI(private val screen: Screen, private val answers: List?) : A textColor = formTextColor }.lparams(width = matchParent) - if (Build.VERSION.SDK_INT < 24) { - editText.backgroundTintList = ColorStateList.valueOf(formTextColor) - } +// if (Build.VERSION.SDK_INT < 24) { +// editText.backgroundTintList = ColorStateList.valueOf(formTextColor) +// } answer.itemId = item.id bindEditText(answer, editText, ui) } @@ -79,9 +75,9 @@ class FormUI(private val screen: Screen, private val answers: List?) : A hintTextColor = R.color.immersive_background textColor = formTextColor }.lparams(width = matchParent) - if (Build.VERSION.SDK_INT < 24) { - editText.backgroundTintList = ColorStateList.valueOf(formTextColor) - } +// if (Build.VERSION.SDK_INT < 24) { +// editText.backgroundTintList = ColorStateList.valueOf(formTextColor) +// } answer.itemId = item.id answer.run { bindEditText(answer, editText, ui) } } @@ -98,9 +94,9 @@ class FormUI(private val screen: Screen, private val answers: List?) : A isChecked = answer.choiceInput } answer.optionId = formOption.id - if (Build.VERSION.SDK_INT < 24) { - checkBox.buttonTintList = ColorStateList.valueOf(formTextColor) - } +// if (Build.VERSION.SDK_INT < 24) { +// checkBox.buttonTintList = ColorStateList.valueOf(formTextColor) +// } bindCheckBox(answer, checkBox, ui) } } @@ -118,9 +114,9 @@ class FormUI(private val screen: Screen, private val answers: List?) : A textColor = formTextColor } answer.optionId = formOption.id - if (Build.VERSION.SDK_INT < 24) { - radioButton.buttonTintList = ColorStateList.valueOf(formTextColor) - } +// if (Build.VERSION.SDK_INT < 24) { +// radioButton.buttonTintList = ColorStateList.valueOf(formTextColor) +// } bindRadioButton(answer, radioButton, ui) } } diff --git a/app/src/main/res/drawable/nav_item_color_state.xml b/app/src/main/res/drawable/nav_item_color_state.xml index 4e55393d..c2e736f5 100644 --- a/app/src/main/res/drawable/nav_item_color_state.xml +++ b/app/src/main/res/drawable/nav_item_color_state.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/form_view.xml b/app/src/main/res/layout/form_view.xml index bdb14130..f50f4350 100644 --- a/app/src/main/res/layout/form_view.xml +++ b/app/src/main/res/layout/form_view.xml @@ -40,6 +40,10 @@ app:ms_showErrorState="true" app:ms_showErrorStateOnBack="true" app:ms_stepperType="tabs" + app:ms_activeStepColor="@color/avocado" + app:ms_bottomNavigationBackground="@color/avocado" + app:ms_backButtonColor="@color/light_white" + app:ms_nextButtonColor="@color/light_white" tools:theme="@style/AppTheme" /> - - \ No newline at end of file +