Skip to content

Commit

Permalink
Merge pull request #33 from natura-cosmeticos/feature/NFS-408-text-fi…
Browse files Browse the repository at this point in the history
…eld-input

Feature/text field input
  • Loading branch information
bihletti authored Mar 12, 2020
2 parents 2982ba3 + 789de3e commit 9e1bb62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class TextFieldInput @JvmOverloads constructor(
enum class LayoutState(val borderWidth: Int, val borderColor: Int, val labelColor: Int, val textColor: Int, val footerColor: Int) {
DEFAULT(R.dimen.ds_border_tiny, R.color.colorHighEmphasis, R.color.colorMediumEmphasis, R.color.colorHighEmphasis, R.color.colorMediumEmphasis),
DISABLED(R.dimen.ds_border_tiny, R.color.colorLowEmphasis, R.color.colorLowEmphasis, R.color.colorLowEmphasis, R.color.colorLowEmphasis),
FOCUSED(R.dimen.ds_border_emphasis, R.color.colorBrdNatOrange, R.color.colorMediumEmphasis, R.color.colorHighEmphasis, R.color.colorMediumEmphasis),
FOCUSED(R.dimen.ds_border_emphasis, R.color.colorBrdNatYellow, R.color.colorMediumEmphasis, R.color.colorHighEmphasis, R.color.colorMediumEmphasis),
ERROR(R.dimen.ds_border_emphasis, R.color.colorBrdNatRed, R.color.colorBrdNatRed, R.color.colorHighEmphasis, R.color.colorBrdNatRed),
SUCCESS(R.dimen.ds_border_tiny, R.color.colorBrdNatGreen, R.color.colorBrdNatGreen, R.color.colorHighEmphasis, R.color.colorBrdNatGreen)
}

private val SUCCESS_ICON = "EA1A"
private val SUCCESS_ICON = "EA15"
private val ERROR_ICON = "EA13"

private val inputLabel by lazy { findViewById<TextView>(R.id.text_field_input_label) }
Expand Down Expand Up @@ -122,7 +122,7 @@ class TextFieldInput @JvmOverloads constructor(
field = value
inputLabel?.setTextColor(ContextCompat.getColor(context, value.labelColor))
(inputBox.background as GradientDrawable).setStroke(
resources.getDimensionPixelSize(value.borderWidth),
resources.getDimension(value.borderWidth).toInt(),
ContextCompat.getColor(context, value.borderColor))
footerValue?.setTextColor(ContextCompat.getColor(context, value.footerColor))
footerIcon?.setTextColor(ContextCompat.getColor(context, value.footerColor))
Expand Down
2 changes: 1 addition & 1 deletion designsystem/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorBrdNatRed">#e74627</color>
<color name="colorBrdNatGreen">#8BC34A</color>
<color name="colorBrdNatGreen">#569A32</color>
<color name="colorBrdNatOrange">#FF6B06</color>
<color name="colorBrdNatOrangeDark">#EF8426</color>
<color name="colorBrdNatYellow">#F4AB34</color>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TextFieldInputTest {
val EMPTY_TEXT = ""
val NOT_EMPTY_TEXT = "test"
val ERROR_ICON_CODE = "EA13"
val SUCCESS_ICON_CODE = "EA1A"
val SUCCESS_ICON_CODE = "EA15"

@Test
fun basicLayout() {
Expand Down

0 comments on commit 9e1bb62

Please sign in to comment.