diff --git a/.idea/misc.xml b/.idea/misc.xml index 37a7509..e6ed9d3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,14 @@ - + + + + + diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 4a6c5b7..92e6653 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -44,7 +44,7 @@ android:imeOptions="actionNext" app:autoCorrect="false" app:dateFormat="ddMMyyyy" - app:dividerCharacter="slash" + app:dividerCharacter="point" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" diff --git a/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt b/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt index edc3afa..dbf50d5 100644 --- a/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt +++ b/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt @@ -30,6 +30,7 @@ class DateEditText : TextInputEditText { enum class DividerCharacter(val value: String) { Minus("-"), Slash("/"), + Point(".") } @@ -129,10 +130,16 @@ class DateEditText : TextInputEditText { */ private fun getDividerCharacter(typedArray: TypedArray) { val dividerCharacter = typedArray.getInt(R.styleable.DateEditText_dividerCharacter, 0) - if (dividerCharacter == 0) { - this.dividerCharacter = DividerCharacter.Slash - } else if (dividerCharacter == 1) { - this.dividerCharacter = DividerCharacter.Minus + when (dividerCharacter) { + 0 -> { + this.dividerCharacter = DividerCharacter.Slash + } + 1 -> { + this.dividerCharacter = DividerCharacter.Minus + } + 2 -> { + this.dividerCharacter = DividerCharacter.Point + } } } diff --git a/dateedittext/src/main/res/values/attrs.xml b/dateedittext/src/main/res/values/attrs.xml index 203cb2a..70740a7 100644 --- a/dateedittext/src/main/res/values/attrs.xml +++ b/dateedittext/src/main/res/values/attrs.xml @@ -3,6 +3,7 @@ +