8000 Improve Form DSL by dbaelz · Pull Request #22 · TheJuki/KFormMaster · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve Form DSL #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import java.util.*
* @author **TheJuki** ([GitHub](https://github.com/TheJuki))
* @version 1.0
*/
@FormDsl
class FormBuildHelper
@JvmOverloads constructor(context: Context, listener: OnFormElementValueChangedListener? = null, recyclerView: RecyclerView? = null, val cacheForm: Boolean = true, autoMeasureEnabled: Boolean = false) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import kotlin.collections.ArrayList
* @version 1.0
*/

@DslMarker
annotation class FormDsl

/** Type-safe builder method to initialize the form */
fun form(context: Context,
recyclerView: RecyclerView,
Expand All @@ -38,6 +41,7 @@ fun form(context: Context,
}

/** FieldBuilder interface */
@FormDsl
interface FieldBuilder {
fun build(): BaseFormElement<*>
}
Expand All @@ -59,6 +63,7 @@ fun FormBuildHelper.header(init: HeaderBuilder.() -> Unit): FormHeader {
}

/** Builder method to add a BaseFormElement */
@FormDsl
abstract class BaseElementBuilder<T : Serializable>(protected val tag: Int = -1, var title: String? = null) : FieldBuilder {
/**
* Form Element Value
Expand Down
0