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/8.0/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/8.0/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) | [enable](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/DataBinding#enable()) Whether to enable data binding. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enableForTests](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/DataBinding#enableForTests()) Whether to run data binding code generation for test projects. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEnabled](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/DataBinding#isEnabled()) **This property is deprecated.** deprecated, use enable |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEnabledForTests](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/DataBinding#isEnabledForTests()) **This property is deprecated.** deprecated, use enableForTests |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [version](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/DataBinding#version()) The version of data binding to use. |\n\nPublic properties\n-----------------\n\n### addDefaultAdapters\n\n```\nvar addDefaultAdapters: Boolean\n```\n\nWhether to add the default data binding adapters. \n\n### addKtx\n\n```\nvar 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### enable\n\n```\nvar enable: Boolean\n```\n\nWhether to enable data binding. \n\n### enableForTests\n\n```\nvar enableForTests: Boolean\n```\n\nWhether to run data binding code generation for test projects. \n\n### isEnabled\n\n```\nvar isEnabled: Boolean\n```\n| **This property is deprecated.** \ndeprecated, use enable \n\n### isEnabledForTests\n\n```\nvar isEnabledForTests: Boolean\n```\n| **This property is deprecated.** \ndeprecated, use enableForTests \n\n### version\n\n```\nvar version: String?\n```\n\nThe version of data binding to use."]]