- Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the FormSimpleIGB wiki!
| Functions | Descriptions | Code |
|---|---|---|
| start | Starts generating the form in the user interface. | easyForm.start(your_reciclerview) |
| validateAll | Valid all fields of the form. | easyForm.tool.validateAll() |
| validateByTag | Validates a specific field identified by a label. | easyForm.tool.validateByTag("Tag Id") |
| getResultByTag | Gets the result of a specific field by its label. | easyForm.tool.getResultByTag("Tag Id") |
| getResult | Gets the overall result of the form. | easyForm.tool.getResultAll() |
| updateRow | Updates a row or section of the form. | easyForm.tool.updateRow("Tag Id",ResponseFormsIGB()) |
| eventChecked | Handles item verification or selection events. | easyForm.tool.eventChecked(false,0) |
| finishProgressView | close action progress view when execurted a action. | easyForm.tool.finishProgressView("YOUR_TAG_ID") |
| startProgressView | start action progress view for execute an any action. | easyForm.tool.startProgressView("YOUR_TAG_ID") |
This code sets up a form structure with sections and rows. It configures the theme mode, specifies a container, divides the form into sections, and defines the content within those sections. This structure provide a structured way to create forms with different elements and configurations.
var easyFastForm =BuildForm(mContext =this) {
mode = uiMode.dark // Config theme with three options: LIGHT, DARK, & AUTO (System theme selected for the user).
container =MyRecyclerView// Set your RecyclerView; this option is only used when using classic mode, not JetPack Compose.
body { // Inside this option, you can set Rows or Sections, depending on your form's structure.
section { // If you want to divide your form into sections, use this option
title ="My Section Number 1"
description ="Here I put my first section."
content { // Inside this option, you can set your rows.
row(RType.INFO) {
title ="Developer"
text ="JIGB-K"
}
}
}
}
}
It is a property to invoke rows within the form to declare the section's title below it.
Row(RType.TITLE) { // <--- Add Title
setText.title ="Getting started"//<--- add your title name
setColor.title =R.color.colorPrimary_aar
}
It's a row that functions to make direct calls to other windows within the project. It is fully configurable and easy to use.
Row(RType.ACTIVITY){ // <-- Here Call Any activity
title ="Test Activity #1"//<-- title .
activity =ExampleActivity::class.java // <-- Add your activity
}
This functionality allows selecting more than one option, making it great for multiple-choice questionnaires.
Row(RType.MULTIPLE_CHECK_LIST){
tag ="002"
setText.title ="Favorite Fruit"
checkList{
option(){
text ="Banana"
}
option(){
text ="Apple"
}
option(){
text ="Peach"
}
option(){
text ="Papaya"
}
}
validation =true
}
Specifically for rows needing quick validation, like accepting terms or specific questions.
Row(RType.CHECK){
setText.text="Are you like you job?"// Add text for the text
tag ="0012"//tag for identification of the row
checked =true// Initialize check in false or true
}
For rows requiring various text editions, such as numbers, phones, emails, etc.
Row(EDIT){
setText.title ="Cell Phone"// title row.
inputTypeEditText =InputType.TYPE_CLASS_PHONE// To choose type EDITTEXT (https://developer.android.com/reference/android/widget/EditText)
}
Enables choosing a single option from several available choices.
Row(RType.SINGLE_CHECK_LIST){
tag ="007"
setText.title ="Favorite Movie"
setting.rowSingleCheck.activeIconSuccess =true
checkList{
option(){
text ="Action"
}
option(){
text ="Drama"
}
option(){
text ="Comedy"
}
option(){
text ="Fantasy"
}
}
validation =true
}
Use this row for a button actions for config any action.
Row(RType.ON_CLICK){
setText.title ="Click me!"
onClick {
val builder =AlertDialog.Builder(context)
builder.setTitle("Hello")
.setMessage("I'm here")
.setPositiveButton("OK") { dialog, _ ->// Do something when OK button is clicked
dialog.dismiss()
}
.setNegativeButton("Cancel") { dialog, _ ->// Do something when Cancel button is clicked
dialog.dismiss()
}
.show()
}
}
Primarily used to display information without offering special functionalities.
Row(RType.INFO){
setText.title ="Licence"// title row.
setText.text="Copyright 2024 José I. Gutiérrez B."
}
This row is use for action like jump to another activity or execute fuction in your main activity.
Row(RType.ACTION) {
tag ="FRECUENCIA_VISITA"
setText.title ="Sounds & Others"
setText.descriptionBottom ="Configuration your sounds & rintongs settings"
setText.bubble ="1"
setImage.iconLeft =R.drawable.sound_color
setText.titleToolbar ="Atras"
setSize.title =14f
onClick {
// Your code Here
}
}
This row is use for active the date picker native in Android.
Row(RType.DATE_PICKER) {
tag ="Select Birthday"
setText.title ="Birthday"
setDatePicker.format ="dd/MM/yyyy"
setText.descriptionBottom ="12/01/2024"
setImage.iconLeft =R.drawable.calendar_color
setSize.title =14f
}
This row is use for active the time picker native in Android.
Row(RType.TIME_PICKER) {
tag ="Select Time"
setText.title ="Check In"
setTimePicker.format ="hh:mm a"
setTimePicker.is24HourFormat =false
setImage.iconLeft =R.drawable.calendar_timer
setSize.title =14f
}
This row is use for active the control swtich, you can personalize the the calor.
Row(RType.SWITCH) {
setText.title ="Terms & Conditions"
setText.descriptionBottom ="Are you agree with our terms?"
setText.edtHint ="Insert your email"
setImage.iconLeft =R.drawable.contract_file
setSwitch.active =false
tag ="MY_TERMS"
}
| Parameter | Row compatibility | Description |
|---|---|---|
| tag | ALL | Assigns a unique identifier. |
| Activity | ACTIVITY | Used to invoke the desired activity. |
| bundleActivity | ACTIVITY | Used to send information between activities. |
| checked | ALL | Declares that the field in this row needs validation before processing. |
| isAvailable | EDIT | Specifies if the displayed data is enabled for editing. |
| isSingleList | SINGLE_CHECK_LIST | Notifies the list that the selection will be one-to-many. |
| universalContentGravity | ALL | Adjusts the position of the container confirming the entire row's body. |
| isEndableImageSelected | SINGLE_CHECK_LIST | Enables or disables checkboxes. |
| TypeRow | ALL | Assigns the type of row to be built. |
| onClick | ACTION | Config any action into onclick. |
| Parameter | Row compatibility | Description |
|---|---|---|
| title | ALL | Assigns text for the title. |
| titleToolbar | SINGLE_CHECK_LIST, MULTIPLE_CHECK_LIST | Assigns text for the title toolbar. |
| bubble | ALL | Assign number or text for into bubble text. |
| text | ALL | Assigns a description below the title. |
| descriptionBottom | ALL | Assigns a title bottom below the title. |
| btnFinishSelect | MULTIPLE_CHECK_LIST | Assigns a title bottom below the options to select. |
| edtHint | EDIT | Displays informative text inside the edit field. |
| comment | EDIT | Adds special comments within the row. |
| icon | ALL | Used to assign icons using Font Awesome codes. |
| errorMessages | ALL | Displays informative text indicating that this field must be filled. |
| Parameter | Row compatibility | Description |
|---|---|---|
| options | SINGLE_CHECK_LIST, MULTIPLE_CHECK_LIST | Assigns special lists to choose from one or many options, depending on the list type. |
| arrayDates | CALENDAR | Assigns a special list of dates to delimit dates between weeks. |
| Parameter | Row compatibility | Description |
|---|---|---|
| validationOn | SINGLE_CHECK_LIST, MULTIPLE_CHECK_LIST, EDIT | Active validation, when you the parameters is important for your form. This important use this option whit funcions validationByTag or validationAll |
| rulePattern | EDIT | If you need validation special character, you can using regular expression. |
| Parameter | Row compatibility | Description |
|---|---|---|
| isEditable | EDIT | Sets whether the data can be edited by the user. |
| inputTypeEditText | EDIT | Configures the keyboard type for data capture. |
| maxLength | EDIT | Sets the maximum number of characters the user can input. |
| Parameter | Row compatibility | Description |
|---|---|---|
| rowSingleCheck.activeIconSuccess | SINGLE_CHECK_LIST | When user selected a options will appear icon success. |
| rowMultipleCheck.activeIconSuccess | MULTIPLE_CHECK_LIST | When user selected a options will appear icon success. |
| Parameter | Row compatibility | Description |
|---|---|---|
| intentEnter | ACTIVITY | Assigns an animation for opening an activity. |
| intentExit | ACTIVITY | Assigns an animation for closing an activity. |
| Parameter | Row compatibility | Description |
|---|---|---|
| title | ALL | Sets the color for row titles. |
| descriptions | ALL | Sets the color for row descriptions. |
| descriptionBottom | ALL | Sets the color for row descriptions below the title |
| icons | ALL | Sets the color for row icons. |
| separator | ALL | Sets the color for lines separating rows. |
| circle | ALL | Not enabled at the moment. |
| letter | ALL | Sets the color for row titles. |
| edit | ALL | Sets the color for text editing titles of a row. |
| editStyle | ALL | Not enabled at the moment. |
| titleToolbar | ALL | Sets the color for toolbar component titles. |
| backgroundToolbar | ALL | Sets the color for the background of the row container. |
| backgroundContent | ALL | Sets the color for the background of the row container. |
| imageEmpty | ALL | Sets the background color for image containers. |
| progressView | ALL | Sets the background color for progress view. |
| backgroundContentMain | ALL | Change color background of the row. |
| btnFinishSelect | MULTIPLE_CHECK_LIST | Change color background of the button for the list multiple select. |
| Parameter | Row compatibility | Description |
|---|---|---|
| is24HourFormat | TIME_PICKER | Set boolean parameter for enable format 24 format for the time picker row. |
| format | TIME_PICKER | Set specify format for show the time after selected. |
| Parameter | Row compatibility | Description |
|---|---|---|
| format | DATE_PICKER | Set specify format for show the date after selected. |
| Parameter | Row compatibility | Description |
|---|---|---|
| title | ALL | Allows assigning the title size. |
| description | ALL | Allows assigning the description size. |
| description bottom | ALL | Allows assigning the description bottom size. |
| bubble | ALL | Allows assigning the bubble size. |
| letter | ALL | Not enabled at the moment. |
| edit | ALL | Allows assigning the size of editable texts. |
| icon | ALL | Allows assigning the size of icons. |
| iconLeft | ALL | Allows assigning the size of icons left. |
| row | ALL | Allows assigning the general size of the row. |
| Parameter | Row compatibility | Description |
|---|---|---|
| Content | ALL | Sets spaces inside the entire container equally. |
| Content.top | ALL | Sets spaces inside affecting the top part of the container. |
| Content.bottom | ALL | Sets spaces inside affecting the bottom part of the container. |
| Content.left | ALL | Sets spaces inside affecting the left part of the container. |
| Content.right | ALL | Sets spaces inside affecting the right part of the container. |
| Parameter | Row compatibility | Description |
|---|---|---|
| content | ALL | Sets spaces outside the entire container equally. |
| content.Top | ALL | Sets spaces outside affecting the top part of the container. |
| Parameter | Row compatibility | Description |
|---|---|---|
| text | ALL | Aligns text on different lines, either center, left, or right of the container. |
| description | ALL | Aligns the description on different lines, either center, left, or right of the container. |
| Parameter | Row compatibility | Description |
|---|---|---|
| title | ALL | Controls the visibility of the title (Visible, Invisible, or Gone depending on the context). |
| description | ALL | Controls the visibility of the description (Visible, Invisible, or Gone depending on the context). |
| icon | ALL | Controls the visibility of the icon (Visible, Invisible, or Gone depending on the context). |
| check | ALL | Controls the visibility of the checkbox (Visible, Invisible, or Gone depending on the context). |
| editText | ALL | Controls the visibility of the editable text (Visible, Invisible, or Gone |
| switch | SWTICH | Controls the visibility of the switch view text (Visible, Invisible, or Gone |
| descriptionBottom | ALL | Controls the visibility of the descroption bottom view text (Visible, Invisible, or Gone |
| iconLeft | ALL | Controls the visibility of the icon left (Visible, Invisible, or Gone depending on the context). |
| btnFinishSelect | MULTIPLE_CHECK_LIST | Controls the visibility of the bottom finish select (Boolean). |
| activeBtnCheck | MULTIPLE_CHECK_LIST | Controls the visibility of the image check (Boolean). |
| bubble | ALL | Controls the visibility of the bubble text (Visible, Invisible, or Gone depending on the context). |
| progressBarRight | ALL | Controls the visibility of the progress view (Visible, Invisible, or Gone depending on the context). |