Skip to content

Fast & Easy Form is an Android form builder library that simplifies creating and managing forms with features like validations, data retrieval, updates, and event listeners.

Notifications You must be signed in to change notification settings

LordSaac/FastEasyForm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast & Easy Form: is a builder forms for your Android project, with this library you will can build forms more fast and easy, using a clear structure for implement in your project. This solution offer a different tools like: validations, get data, update data and events listeners.

Build status codecov codecov codebeat badge API Maven Central

Examples

DARK MODE ON Menu Screen Input
Example Example Example

Features

  • Reduce development time for forms
  • Create simple and user-friendly forms
  • Implement row-level validation for the form fields
  • Ability to update rows/data within the form
  • Retrieve data based on a unique identifier
  • Implement interactive listeners for form elements
  • Scroll view form
  • Customize text colors
  • Customize icons
  • Change size text
  • Support for Jetpack Compose
  • Support Dark Mode
  • Use Java 11

Requirements

Fast & Easy Form is written in Kotlin & Java and compatible with min Sdk version 26 and min version Java 11. This library is only compatible with phones.

Installation

Settings Gradle

Fast & Easy Form is available through Github. To install it, simply add the following line to your settings gradle:

allprojects {
    repositories {

       maven { url 'https://jitpack.io' }

    }
}

Dependencie

For dependencie version, add the following to your gradle:

 compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
 }

kotlinOptions {
        jvmTarget = '11'
 }

dependencies {

     implementation 'com.github.LordSaac:FastEasyForm:v2.0.1'

}

Getting Started

Example MainActivity

For classic class activity follow the next code example.

class MainActivity : AppCompatActivity(), FormsListenerIGB {

    private lateinit var rv_main: RecyclerView // Add RecyclerView into xml

    private lateinit var easyForm: EasyForm

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        this.rv_main = findViewById(R.id.rv_main)

        this.init()

    }

    private fun init(){

 this.easyForm = BuildForm(mContext = this) {

    mode = ThemeMode.DARK 

    container = this.rv_main  

    body { 

        section { 

            title = "My Section Number 1"
            description = "Here I put my first section."

            content { 

                Row(RType.TITLE) { 
                    setText.title = "Getting started"
                    setColor.title = R.color.colorPrimary_aar 
                }

                Row(RType.INFO) { 
                    setText.title = "Hello world!"
                    setColor.title = R.color.colorGray 
                }

            }

        }

    }

}


    }



    override fun actionFormResponse(result: ResponseFormsIGB) {



    }

}

Example ComposeActivity

For projects JetPack Compose follow the next code example.

class ComposeActivity : ComponentActivity() {

    private val context = this

    private lateinit var easyForm: EasyForm

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        this.easyForm = EasyForm(this)

        setContent {
            FormSimpleIGBTheme {
                // A surface container using the 'background' color from the theme

                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colorScheme.background
                ) {

                    ComposeScreen(context,easyForm)

                }
            }
        }
    }

}

Composable

Config the composable code into activity or preview screen.

@Composable
fun ComposeScreen(context:Context,customForm: EasyForm) {

    EasyFormCompose(
        customForm = customForm,
        modifier = Modifier.fillMaxWidth(),
        mode = uiMode.dark,
        body = {

         
               Section {

                title = "Configuration Settings"

                description = "Config your configuration setting"

                Content {

                    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 {




                        }


                    }

                    Row(RType.ACTION) {

                        tag = "GAME_SETTING"
                        setText.title = "Game Setting"
                        setText.descriptionBottom = "Configuration your games settings"
                        setImage.iconLeft = R.drawable.controler_color
                        setSize.title = 14f

                        onClick {




                        }

                    }

                    Row(RType.ACTION) {
                        tag = "FRECUENCIA_VISITA"
                        setText.title = "Notifications"
                        setText.descriptionBottom = "Configuration your favorite ringtone settings"
                        setImage.iconLeft = R.drawable.bell_color
                        setSize.title = 14f

                        onClick {

                        }
                    }

                }

            }
   
         
        }

    )

}

Full Example project

If you want check the the code project, you can check click HERE or check FULL DOCUMENTATION.

Contribution

Thank you for use this library on your project, with you collaboration this project could grow more with improvements and new idea. This project don't have support but you are most welcome to contribute.

Licence

Copyright 2024 José I. Gutiérrez B.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Fast & Easy Form is an Android form builder library that simplifies creating and managing forms with features like validations, data retrieval, updates, and event listeners.

Topics

Resources

Stars

Watchers

Forks

Packages