Comments (2)
Hi, @fmatosqg. It seems like a good idea, but I never worked with Anko and don't quite know how it works, but I will learn more about it and analyse if is possible to provide support to use the Convalida with Anko.
from convalida.
I was sawing the Anko example on the GitHub repository:
verticalLayout {
val name = editText()
button("Say Hello") {
onClick { toast("Hello, ${name.text}!") }
}
}
And I think the solution below works:
@RequiredValidation
lateinit var name: EditText
@ValidateOnClick
lateinit var validateButton: Button
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
verticalLayout {
name = editText()
validateButton = button("Say Hello")
}
SampleActiityFieldsValidation.init(this) // the generated class
}
@OnValidationSuccess
fun success() = Toast.makeText(this, "${name.text}", Toast.LENGTH_LONG).show()
Can you try it?
from convalida.
Related Issues (20)
- CPF validation HOT 3
- Validate difference between fields HOT 1
- CEP/ POSTAL code validation HOT 1
- A validation for numeric value limit HOT 2
- Validation for credit card number HOT 1
- Not require validation when field is blank HOT 2
- annotationProcesso HOT 1
- Update docs HOT 9
- Support AndroidX packages HOT 1
- Support to apply validations using a Kotlin DSL HOT 1
- Get invalid fields in OnValidationError method. HOT 1
- Move artifacts from Jitpack to Maven Central or Bintray. HOT 1
- Implement validation for Spinner.
- Remove "Validation" suffix from all annotations and bindings. HOT 8
- Add parameter to receive error message as pure string value in all validations. HOT 1
- Implement validation for ISBN. HOT 1
- Implement CNPJ validation HOT 2
- validation on fragment is not working after back pressed HOT 9
- Kotlin compiler Null Pointer exception HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from convalida.