├── DataBindingBasicSample ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kamal │ │ │ │ └── myapplication │ │ │ │ ├── User.kt │ │ │ │ └── MainActivity.kt │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── readme.md ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── OneWayBindingExample ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kamal │ │ │ │ └── onewaybindingexample │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainViewModel.kt │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .idea │ ├── codeStyles │ │ ├── codeStyleConfig.xml │ │ └── Project.xml │ ├── vcs.xml │ ├── runConfigurations.xml │ ├── gradle.xml │ └── misc.xml ├── .gitignore ├── readme.md ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── DataBindingUsingObjects ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── layout │ │ │ │ │ └── activity_main.xml │ │ │ │ └── drawable-v24 │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── kamal │ │ │ │ │ └── databindingusingobjects │ │ │ │ │ ├── Employee.kt │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── kamal │ │ │ │ └── databindingusingobjects │ │ │ │ └── ExampleUnitTest.kt │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── kamal │ │ │ └── databindingusingobjects │ │ │ └── ExampleInstrumentedTest.kt │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .idea │ ├── codeStyles │ │ ├── codeStyleConfig.xml │ │ └── Project.xml │ ├── vcs.xml │ ├── runConfigurations.xml │ ├── gradle.xml │ └── misc.xml ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── DataBindingWithLiveData ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kamal │ │ │ │ └── databindingwithlivedata │ │ │ │ ├── MainViewModel.kt │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── readme.md ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── DataBindingWithViewModel ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kamal │ │ │ │ └── databindingwithviewmodel │ │ │ │ ├── MainViewModel.kt │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── readme.md ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── RecyclerViewDataBindingExample ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kamal │ │ │ │ ├── model │ │ │ │ └── DataClass.kt │ │ │ │ ├── base │ │ │ │ ├── ClickCallback.kt │ │ │ │ ├── RecyclerViewHolder.kt │ │ │ │ └── RecyclerBaseAdapterClass.kt │ │ │ │ └── ui │ │ │ │ ├── MainViewModel.kt │ │ │ │ ├── MyAdapterClass.kt │ │ │ │ └── MainActivity.kt │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── row_data_item.xml │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .idea │ ├── codeStyles │ │ ├── codeStyleConfig.xml │ │ └── Project.xml │ ├── vcs.xml │ ├── runConfigurations.xml │ ├── gradle.xml │ └── misc.xml ├── .gitignore ├── readme.md ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── DataBindingExampleUsingObservableField ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── kamal │ │ │ │ └── databindingexampleusingobservablefield │ │ │ │ ├── User.kt │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── readme.md ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew └── README.md /DataBindingBasicSample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /DataBindingBasicSample/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='My Application' 3 | -------------------------------------------------------------------------------- /OneWayBindingExample/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='OneWayBindingExample' 3 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='DataBindingUsingObjects' 3 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='DataBindingWithLiveData' 3 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='DataBindingWithViewModel' 3 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='RecyclerViewDataBindingExample' 3 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name='DataBindingExampleUsingObservableField' 3 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/java/com/kamal/myapplication/User.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.myapplication 2 | 3 | data class User(val name: String) -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | My Application 3 | 4 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | OneWayBindingExample 3 | 4 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/java/com/kamal/model/DataClass.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.model 2 | 3 | data class DataClass(val name : String) -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DataBindingUsingObjects 3 | 4 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DataBindingWithLiveData 3 | 4 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DataBindingWithViewModel 3 | 4 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RecyclerViewDataBindingExample 3 | 4 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/java/com/kamal/databindingusingobjects/Employee.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingusingobjects 2 | 3 | data class Employee(var name:String) -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/java/com/kamal/base/ClickCallback.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.base 2 | 3 | interface ClickCallback { 4 | fun onClick( pos: Int); 5 | } -------------------------------------------------------------------------------- /DataBindingBasicSample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DataBindingExampleUsingObservableField 3 | 4 | -------------------------------------------------------------------------------- /OneWayBindingExample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DataBindingUsingObjects/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DataBindingWithLiveData/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DataBindingWithViewModel/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /OneWayBindingExample/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingBasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/OneWayBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingUsingObjects/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithLiveData/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingWithViewModel/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /OneWayBindingExample/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingUsingObjects/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/RecyclerViewDataBindingExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CammyKamal/Android-Data-Binding-Examples/HEAD/DataBindingExampleUsingObservableField/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/java/com/kamal/databindingexampleusingobservablefield/User.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingexampleusingobservablefield 2 | 3 | import androidx.databinding.ObservableField 4 | 5 | data class User(val name:ObservableField) -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /DataBindingBasicSample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /OneWayBindingExample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /OneWayBindingExample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 05 11:18:12 IST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /DataBindingBasicSample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Nov 03 12:18:57 IST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 06 13:02:31 IST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 05 10:42:39 IST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 04 14:44:25 IST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 05 12:25:24 IST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 04 13:33:38 IST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/java/com/kamal/databindingwithlivedata/MainViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingwithlivedata 2 | 3 | import androidx.lifecycle.MutableLiveData 4 | import androidx.lifecycle.ViewModel 5 | 6 | class MainViewModel : ViewModel() { 7 | 8 | lateinit var name: MutableLiveData 9 | } 10 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/java/com/kamal/databindingwithviewmodel/MainViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingwithviewmodel 2 | 3 | import androidx.databinding.ObservableField 4 | import androidx.lifecycle.ViewModel 5 | 6 | class MainViewModel : ViewModel() { 7 | 8 | var name: ObservableField = ObservableField("") 9 | } -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # DataBinding-With-ViewModel-Using-Generic-Classes-To-Bind-RecyclerView-Adapters 3 | 4 | Project usage of data binding and ViewModel and contains generic classes for recyclerview Adatpers 5 | 6 | ### Project Uses 7 | 1. Data binding 8 | 2. KTX(Kotlin) 9 | 3. RecyclerView 10 | 4. ViewModel 11 | 5. Android Studio 3.5 12 | 6. LifeCycle-Extensions 13 | 14 | -------------------------------------------------------------------------------- /DataBindingBasicSample/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # Data-Binding-Basic-Sample 3 | Project Shows basic usage of data binding in layout with Data Model Object. 4 | 5 | ### Project Uses 6 | 1. Data binding 7 | 2. KTX(Kotlin) 8 | 3. Android Studio 3.5 9 | 10 | ### Layout Design 11 | Data tag is used with layout container to define the variable object. Variable object i.e. User is used to set value in the layout. 12 | 13 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # DataBinding-With-LiveData 3 | 4 | Project usage of data binding in layout with LiveData i.e. how you can use LiveData in layout to udpate specific content. 5 | 6 | ### Project Uses 7 | 1. Data binding 8 | 2. KTX(Kotlin) 9 | 3. LiveData 10 | 4. Android Studio 3.5 11 | 12 | ### Layout Design 13 | LiveData is used with layout container to update textview. 14 | 15 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # DataBinding-Example-Using-ObservableField 3 | 4 | Project usage of data binding in layout with ObservableField i.e. how you can use ObservableField in layout to udpate specific content. 5 | 6 | ### Project Uses 7 | 1. Data binding 8 | 2. KTX(Kotlin) 9 | 3. ObservableField 10 | 4. Android Studio 3.5 11 | 12 | ### Layout Design 13 | ObservableField is used with layout container to update textview. 14 | 15 | -------------------------------------------------------------------------------- /OneWayBindingExample/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # One-Way-DataBinding-With-ViewModel 3 | 4 | Project usage of data binding and ViewModel in layout with Change Listeners i.e. how you can use change listeners in layout tag to udpate specific content. 5 | 6 | ### Project Uses 7 | 1. Data binding 8 | 2. KTX(Kotlin) 9 | 3. ViewModel 10 | 4. Android Studio 3.5 11 | 12 | ### Layout Design 13 | ViewModel is used with layout container to update Editext/checkbox with change Listeners. 14 | 15 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/java/com/kamal/ui/MainViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.model 2 | 3 | import androidx.lifecycle.ViewModel 4 | 5 | class MainViewModel : ViewModel() { 6 | 7 | var dataList: ArrayList = ArrayList() 8 | 9 | init { 10 | dataList.add(DataClass("1")) 11 | dataList.add(DataClass("2")) 12 | dataList.add(DataClass("3")) 13 | dataList.add(DataClass("4")) 14 | dataList.add(DataClass("5")) 15 | } 16 | } -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/test/java/com/kamal/databindingusingobjects/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingusingobjects 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # DataBinding-With-ViewModel-And-ObservableField 3 | 4 | Project usage of data binding and ViewModel in layout with ObservableField i.e. how you can use ObservableField in layout to udpate specific content. 5 | 6 | ### Project Uses 7 | 1. Data binding 8 | 2. KTX(Kotlin) 9 | 3. ObservableField 10 | 4. ViewModel 11 | 5. Android Studio 3.5 12 | 6. LifeCycle-Extensions 13 | 14 | ### Layout Design 15 | ViewModel with ObservableField is used with layout container to update textview. 16 | 17 | -------------------------------------------------------------------------------- /OneWayBindingExample/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/java/com/kamal/base/RecyclerViewHolder.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.model 2 | 3 | import androidx.databinding.ViewDataBinding 4 | import androidx.recyclerview.widget.RecyclerView 5 | import com.kamal.base.ClickCallback 6 | 7 | open class RecyclerViewHolder( 8 | val binding: ViewDataBinding, 9 | var context: ClickCallback? 10 | ) : RecyclerView.ViewHolder(binding.root) { 11 | var listener: ClickCallback? = null 12 | var posValue: Int = -1 13 | 14 | init { 15 | binding.root.setOnClickListener { 16 | listener = context 17 | listener!!.onClick(posValue) 18 | } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/java/com/kamal/databindingusingobjects/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingusingobjects 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import androidx.databinding.DataBindingUtil 6 | import com.kamal.databindingusingobjects.databinding.ActivityMainBinding 7 | 8 | class MainActivity : AppCompatActivity() { 9 | lateinit var activityMainBinding: ActivityMainBinding 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | activityMainBinding=DataBindingUtil.setContentView(this,R.layout.activity_main) 14 | activityMainBinding.employee=Employee("Kamal Vaid") 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /OneWayBindingExample/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/java/com/kamal/ui/MyAdapterClass.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.ui 2 | 3 | import android.util.Log 4 | import com.kamal.base.ClickCallback 5 | import com.kamal.model.DataClass 6 | import com.kamal.model.R 7 | import com.kamal.model.RecyclerBaseAdapterClass 8 | 9 | class MyAdapterClass(var data: List) : RecyclerBaseAdapterClass(), ClickCallback { 10 | 11 | override fun getLayoutIdForPosition(position: Int) = R.layout.row_data_item 12 | 13 | override fun getDataModel(position: Int) = data[position] 14 | 15 | override fun getItemCount() = data.size 16 | 17 | override fun getOnClickListener()= this 18 | 19 | override fun onClick( position: Int) { 20 | Log.e("Clicked Pos:", position.toString()) 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/java/com/kamal/onewaybindingexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.onewaybindingexample 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import androidx.databinding.DataBindingUtil 6 | import androidx.lifecycle.ViewModelProviders 7 | import com.kamal.onewaybindingexample.databinding.ActivityMainBinding 8 | 9 | class MainActivity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | val viewModel = ViewModelProviders.of(this)[MainViewModel::class.java] 14 | DataBindingUtil.setContentView(this, R.layout.activity_main).also { 15 | it.viewModel = viewModel 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DataBindingBasicSample/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.41' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.71' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.3' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.41' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /OneWayBindingExample/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.41' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.41' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.41' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | 23 | } 24 | } 25 | 26 | task clean(type: Delete) { 27 | delete rootProject.buildDir 28 | } 29 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/layout/row_data_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 16 | 17 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/java/com/kamal/ui/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.model 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import androidx.databinding.DataBindingUtil 6 | import androidx.lifecycle.ViewModelProviders 7 | import com.kamal.model.databinding.ActivityMainBinding 8 | import com.kamal.ui.MyAdapterClass 9 | import kotlinx.android.synthetic.main.activity_main.* 10 | 11 | class MainActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | val viewModel = ViewModelProviders.of(this)[MainViewModel::class.java] 16 | DataBindingUtil.setContentView(this, R.layout.activity_main) 17 | recycler_view.adapter = MyAdapterClass(viewModel.dataList) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/src/main/java/com/kamal/onewaybindingexample/MainViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.onewaybindingexample 2 | 3 | import android.view.View 4 | import androidx.databinding.ObservableField 5 | import androidx.lifecycle.ViewModel 6 | 7 | class MainViewModel : ViewModel() { 8 | 9 | var isChecked: ObservableField = ObservableField(false) 10 | 11 | var dataValue: ObservableField = ObservableField("") 12 | 13 | var name: ObservableField = ObservableField("") 14 | 15 | fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 16 | name.set(s.toString()) 17 | } 18 | 19 | fun onCheckedChanged(view: View, isVisible: Boolean) { 20 | if (isVisible) { 21 | dataValue.set("Checked") 22 | } else { 23 | dataValue.set("Unchecked") 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.3.41' 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | classpath 'com.android.tools.build:gradle:3.1.3' 14 | // NOTE: Do not place your application dependencies here; they belong 15 | // in the individual module build.gradle files 16 | } 17 | } 18 | 19 | allprojects { 20 | repositories { 21 | google() 22 | jcenter() 23 | 24 | } 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/androidTest/java/com/kamal/databindingusingobjects/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingusingobjects 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.kamal.databindingusingobjects", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/java/com/kamal/myapplication/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.myapplication 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import androidx.databinding.DataBindingUtil 6 | import com.kamal.myapplication.databinding.ActivityMainBinding 7 | import kotlinx.android.synthetic.main.activity_main.* 8 | 9 | class MainActivity : AppCompatActivity() { 10 | 11 | lateinit var userObj: User 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | 16 | userObj = User("Updating Value in OnCreate") 17 | val binding: ActivityMainBinding = 18 | DataBindingUtil.setContentView(this, R.layout.activity_main).also { 19 | it.user = userObj 20 | } 21 | 22 | btn_click.setOnClickListener { 23 | userObj = User("Changed Value on Click") 24 | binding.user = userObj 25 | binding.executePendingBindings() 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/src/main/java/com/kamal/databindingexampleusingobservablefield/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingexampleusingobservablefield 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import androidx.databinding.DataBindingUtil 6 | import androidx.databinding.ObservableField 7 | import com.kamal.databindingexampleusingobservablefield.databinding.ActivityMainBinding 8 | import kotlinx.android.synthetic.main.activity_main.* 9 | 10 | class MainActivity : AppCompatActivity() { 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | var userObj: User= User(ObservableField("changed in on Create")) 15 | val binding: ActivityMainBinding= DataBindingUtil.setContentView(this,R.layout.activity_main).also{ 16 | it.user=userObj 17 | } 18 | 19 | btn_click.setOnClickListener { 20 | binding.user!!.name.set("Changed value inside onclick") 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/src/main/java/com/kamal/databindingwithviewmodel/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingwithviewmodel 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import androidx.databinding.DataBindingUtil 6 | import androidx.lifecycle.ViewModelProvider 7 | import androidx.lifecycle.ViewModelProviders 8 | import com.kamal.databindingwithviewmodel.databinding.ActivityMainBinding 9 | import kotlinx.android.synthetic.main.activity_main.* 10 | 11 | class MainActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | val viewModel = ViewModelProviders.of(this)[MainViewModel::class.java] 16 | 17 | val binding: ActivityMainBinding = 18 | DataBindingUtil.setContentView(this, R.layout.activity_main).also { 19 | viewModel.name.set("Value Changed in OnCreate") 20 | it.viewModel=viewModel 21 | } 22 | 23 | btn_click.setOnClickListener { 24 | viewModel.name.set("Value Changed inside Onclick") 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /OneWayBindingExample/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 29 9 | buildToolsVersion "29.0.1" 10 | defaultConfig { 11 | applicationId "com.kamal.onewaybindingexample" 12 | minSdkVersion 15 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | dataBinding{ 24 | enabled = true 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation fileTree(dir: 'libs', include: ['*.jar']) 30 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 31 | implementation 'androidx.appcompat:appcompat:1.0.2' 32 | implementation 'androidx.core:core-ktx:1.0.2' 33 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 34 | implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0' 35 | 36 | } 37 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 29 9 | buildToolsVersion "29.0.1" 10 | defaultConfig { 11 | applicationId "com.kamal.myapplication" 12 | minSdkVersion 15 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | dataBinding{ 26 | enabled = true 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation fileTree(dir: 'libs', include: ['*.jar']) 32 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 33 | implementation 'androidx.appcompat:appcompat:1.0.2' 34 | implementation 'androidx.core:core-ktx:1.0.2' 35 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 36 | } 37 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 15 | 16 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/src/main/java/com/kamal/databindingwithlivedata/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.kamal.databindingwithlivedata 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import androidx.databinding.DataBindingUtil 6 | import androidx.lifecycle.MutableLiveData 7 | import androidx.lifecycle.ViewModelProviders 8 | import com.kamal.databindingwithlivedata.databinding.ActivityMainBinding 9 | import kotlinx.android.synthetic.main.activity_main.* 10 | 11 | class MainActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | val viewModel = ViewModelProviders.of(this)[MainViewModel::class.java] 16 | viewModel.name = MutableLiveData() 17 | viewModel.name.value = "Value set inside OnCreate" 18 | DataBindingUtil.setContentView(this, R.layout.activity_main).also { 19 | it.viewModel = viewModel 20 | it.lifecycleOwner = this 21 | } 22 | 23 | btn_click.setOnClickListener { 24 | viewModel.name.value = "Value set on Button Click" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 29 9 | buildToolsVersion "29.0.1" 10 | defaultConfig { 11 | applicationId "com.kamal.databindingexampleusingobservablefield" 12 | minSdkVersion 15 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | dataBinding{ 26 | enabled = true 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation fileTree(dir: 'libs', include: ['*.jar']) 32 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 33 | implementation 'androidx.appcompat:appcompat:1.0.2' 34 | implementation 'androidx.core:core-ktx:1.0.2' 35 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 36 | } 37 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 29 9 | buildToolsVersion "29.0.1" 10 | defaultConfig { 11 | applicationId "com.kamal.databindingwithviewmodel" 12 | minSdkVersion 15 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | dataBinding{ 26 | enabled = true 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation fileTree(dir: 'libs', include: ['*.jar']) 32 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 33 | implementation 'androidx.appcompat:appcompat:1.0.2' 34 | implementation 'androidx.core:core-ktx:1.0.2' 35 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 36 | implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0' 37 | } 38 | -------------------------------------------------------------------------------- /OneWayBindingExample/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /DataBindingBasicSample/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /DataBindingWithViewModel/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /DataBindingExampleUsingObservableField/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /DataBindingWithLiveData/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 29 9 | buildToolsVersion "29.0.1" 10 | defaultConfig { 11 | applicationId "com.kamal.databindingwithlivedata" 12 | minSdkVersion 15 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | dataBinding{ 25 | enabled = true 26 | } 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 32 | implementation 'androidx.appcompat:appcompat:1.0.2' 33 | implementation 'androidx.core:core-ktx:1.0.2' 34 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 35 | implementation "android.arch.lifecycle:livedata:2.0.0" 36 | annotationProcessor "android.arch.lifecycle:compiler:2.0.0" 37 | implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0' 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Android-Data-Binding-Samples 2 | A collection of samples using Android Data Binding. 3 | 4 | 1. DataBindingBasicSample : This project shows basic Data Binding example in kotlin. 5 | 2. DataBindingExampleUsingObservableField : This project uses Data Binding with ObservableField in kotlin. 6 | 3. DataBindingWithLiveData : This project uses data binding with LiveData in kotlin 7 | 4. DataBindingWithViewModel : This project uses data binding with viewmodel in kotlin 8 | 5. OneWayBindingExample : This project shows how one way data binding works. 9 | 6. RecyclerViewDataBindingExample : This projects contains generic implementation of RecyclerView Data Binding. 10 | -------------------------------------------------------------------------------- /RecyclerViewDataBindingExample/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | apply plugin: 'kotlin-kapt' 8 | 9 | 10 | android { 11 | compileSdkVersion 29 12 | buildToolsVersion "29.0.1" 13 | defaultConfig { 14 | applicationId "com.kamal.recyclerviewdatabindingexample" 15 | minSdkVersion 15 16 | targetSdkVersion 29 17 | versionCode 1 18 | versionName "1.0" 19 | } 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | 27 | dataBinding { 28 | enabled = true 29 | } 30 | 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(dir: 'libs', include: ['*.jar']) 35 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 36 | implementation 'androidx.appcompat:appcompat:1.0.2' 37 | implementation 'androidx.core:core-ktx:1.0.2' 38 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 39 | implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0' 40 | implementation 'androidx.recyclerview:recyclerview:1.0.0' 41 | kapt 'com.android.databinding:compiler:3.1.3' 42 | } 43 | -------------------------------------------------------------------------------- /DataBindingUsingObjects/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 29 9 | buildToolsVersion "29.0.2" 10 | defaultConfig { 11 | applicationId "com.kamal.databindingusingobjects" 12 | minSdkVersion 15 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | dataBinding{ 25 | enabled true 26 | } 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 32 | implementation 'androidx.appcompat:appcompat:1.1.0' 33 | implementation 'androidx.core:core-ktx:1.2.0' 34 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 35 | testImplementation 'junit:junit:4.12' 36 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 37 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 38 | } 39 | -------------------------------------------------------------------------------- /DataBindingBasicSample/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 16 | 17 | 28 | 29 |