Skip to content

Commit

Permalink
agregar Field Text uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
rigo9412 committed May 9, 2019
1 parent 8a18299 commit facb262
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 35 deletions.
25 changes: 0 additions & 25 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ class MainActivity : AppCompatActivity() {

btnForm.setOnClickListener {
//val field1 = FieldImage(arrayListOf("nombre"),"Nombre*",false,"Campo requerido", TypeField.SELECT_IMAGE)
val field2 = FieldText(arrayListOf("hora"),"Hora de entrega*",false, TypeField.TEXT_HOURS,"Campo requerido")
val fieldRazonSocial = FieldText(arrayListOf("razonSocial"), "RazonSocial",true, TypeField.TEXT,
"Es requerido",150,true, arrayListOf() )
val fieldTipoFlotilla = FieldOptions(arrayListOf("tipoFlotilla"),"Tipo flotilla",TypeField.SELECT_OPTION,
arrayListOf("1","2","3"), arrayListOf())


val field3 = FieldText(arrayListOf("apellido_paterno"),"Apellido Paterno*",false, TypeField.TEXT_PHONE,"Campo requerido",140)
val field32 = FieldText(arrayListOf("apellido_paterno"),"Apellido Paterno*",false, TypeField.TEXT_PHONE,"Campo requerido",140)
//val field3 = Field(arrayListOf("apellido_materno"),"Apellido Materno*",true, TypeField.TEXT,"Campo requerido",140)
val form = Form("1","Informacion Personal", arrayListOf(field2,fieldTipoFlotilla,field3))
val form = Form("1","Informacion Personal", arrayListOf(fieldRazonSocial,fieldTipoFlotilla,field3))


val i = Intent(this, FormsActivity::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ open class FieldText() : Field(){
editText.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
editText.transformationMethod = PasswordTransformationMethod.getInstance()
}
TypeField.TEXT -> editText.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE
TypeField.TEXT -> {
if(upperCase == true)
editText.filters = arrayOf<InputFilter>(InputFilter.AllCaps())

editText.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE
}
TypeField.TEXT_DATE-> {

val pickerDialog = DatePickerDialog.OnDateSetListener { view, year, month, dayOfMonth ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.rigo.ramos.formslibrary.views


import android.R
import android.app.TimePickerDialog
import android.content.Context
import android.content.res.TypedArray
import android.os.Build
import android.util.AttributeSet
import android.view.View
import android.widget.TimePicker
import kotlinx.android.synthetic.main.notification_template_part_time.*


import java.lang.reflect.Constructor
import java.lang.reflect.Field
Expand Down Expand Up @@ -40,7 +41,7 @@ import android.content.DialogInterface
class TimePickerDialogFixedNougatSpinner : TimePickerDialog {

val TIME_PICKER_INTERVAL = 15
private var callback: TimePickerDialog.OnTimeSetListener? = null
private var callback: OnTimeSetListener? = null
private var mIgnoreEvent = false
private var timePicker: TimePicker? = null
private var lastHour = -1
Expand All @@ -56,7 +57,7 @@ class TimePickerDialogFixedNougatSpinner : TimePickerDialog {
*/
constructor(
context: Context,
listener: TimePickerDialog.OnTimeSetListener,
listener: OnTimeSetListener,
hourOfDay: Int,
minute: Int,
is24HourView: Boolean
Expand All @@ -80,7 +81,7 @@ class TimePickerDialogFixedNougatSpinner : TimePickerDialog {
constructor(
context: Context,
themeResId: Int,
listener: TimePickerDialog.OnTimeSetListener,
listener: OnTimeSetListener,
hourOfDay: Int,
minute: Int,
is24HourView: Boolean
Expand Down Expand Up @@ -110,7 +111,7 @@ class TimePickerDialogFixedNougatSpinner : TimePickerDialog {
val styleableClass = Class.forName("com.android.internal.R\$styleable")
val timePickerStyleableField = styleableClass.getField("TimePicker")
val timePickerStyleable = timePickerStyleableField.get(null) as IntArray
val a = context.obtainStyledAttributes(null, timePickerStyleable, android.R.attr.timePickerStyle, 0)
val a = context.obtainStyledAttributes(null, timePickerStyleable, R.attr.timePickerStyle, 0)
val timePickerModeStyleableField = styleableClass.getField("TimePicker_timePickerMode")
val timePickerModeStyleable = timePickerModeStyleableField.getInt(null)
val mode = a.getInt(timePickerModeStyleable, MODE_SPINNER)
Expand Down Expand Up @@ -148,7 +149,7 @@ class TimePickerDialogFixedNougatSpinner : TimePickerDialog {
timePicker,
context,
null,
android.R.attr.timePickerStyle,
R.attr.timePickerStyle,
0
)
delegateField.set(timePicker, delegate) // set the TimePicker.mDelegate to the spinner delegate
Expand Down

0 comments on commit facb262

Please sign in to comment.