Stay organized with collections
Save and categorize content based on your preferences.
DataBinding
interface DataBinding
DSL object for configuring databinding options.
Summary
Public properties |
Boolean |
Whether to add the default data binding adapters.
|
Boolean? |
Whether to add the data binding KTX features.
|
Boolean |
Whether to enable data binding.
|
Boolean |
Whether to run data binding code generation for test projects.
|
String? |
The version of data binding to use.
|
Public properties
addKtx
val addKtx: Boolean?
Whether to add the data binding KTX features. A null value means that the user hasn't specified any value in the DSL. The default value can be tweaked globally using the android.defaults.databinding.addKtx
gradle property.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DataBinding\n===========\n\n\n```\ninterface DataBinding\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nDSL object for configuring databinding options.\n\nSummary\n-------\n\n| ### Public properties ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [addDefaultAdapters](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/DataBinding#addDefaultAdapters()) Whether to add the default data binding adapters. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`?` | [addKtx](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/DataBinding#addKtx()) Whether to add the data binding KTX features. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEnabled](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/DataBinding#isEnabled()) Whether to enable data binding. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEnabledForTests](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/DataBinding#isEnabledForTests()) Whether to run data binding code generation for test projects. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [version](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/DataBinding#version()) The version of data binding to use. |\n\nPublic properties\n-----------------\n\n### addDefaultAdapters\n\n```\nval addDefaultAdapters: Boolean\n```\n\nWhether to add the default data binding adapters. \n\n### addKtx\n\n```\nval addKtx: Boolean?\n```\n\nWhether to add the data binding KTX features. A null value means that the user hasn't specified any value in the DSL. The default value can be tweaked globally using the `android.defaults.databinding.addKtx` gradle property. \n\n### isEnabled\n\n```\nval isEnabled: Boolean\n```\n\nWhether to enable data binding. \n\n### isEnabledForTests\n\n```\nval isEnabledForTests: Boolean\n```\n\nWhether to run data binding code generation for test projects. \n\n### version\n\n```\nval version: String?\n```\n\nThe version of data binding to use."]]