From a6f39b934b1ff8284ec2c28a66c57f7d28b91b6b Mon Sep 17 00:00:00 2001 From: Prajal Gupta <101054017+prajalg@users.noreply.github.com> Date: Sat, 18 Jun 2022 21:41:17 +0530 Subject: [PATCH] Create Session-3: View Binding and Data binding --- .../Session-3: View Binding and Data binding | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Android Development/Session-3: View Binding and Data binding diff --git a/Android Development/Session-3: View Binding and Data binding b/Android Development/Session-3: View Binding and Data binding new file mode 100644 index 0000000..0030ab1 --- /dev/null +++ b/Android Development/Session-3: View Binding and Data binding @@ -0,0 +1,36 @@ +# Session 3 +View Binding and Data Binding with Introduction to Kotlin +Conducted on: 13/06/2022 + +## Agenda +To learn the various uses, features and implementation of View Binding and Data Binding. + +## Summary +The discussion was held on how to link view to the code directly without using findViewById instead using View Binding and Data Binding. + +## The following things were discussed: + * Firstly, how to declare and initialise variables & values in Kotlin were discussed. + * Setting data binding and view binding: + * In build.gradle--->buildFeatures---> dataBinding true, or viewBinding true. + * Creation of a 'binding' variable in MainActivity.kt + * How to setContent view using Binding class instance and DataBindingUtil class. + * Use of and tags and there attributes to give name and type to the variable in the xml. + * How to access variables in the data using binding.. + + * Using this concept, we implemented it in a recyclerView. + * Made a viewHolder.xml for the view to be repeated. + * A data class & adapter for it was made. + * In the adapter, an inner class of type ViewHolder was made in which a list was made and the method for setting the recyclerview with the list was made + and the following methods were overriden: + * onCreateViewHolder + * onBindViewHolder + * getItemCount + *The list was modified in MainActivitya and the adapter was set to it. + The session was concluded with a small doubt clearing session. + +## Credits +*Conducted by:* Anisha Datta, Saurav Kumar + +*Report compiled by*: Prajal Gupta + +*Attendees*: Abhay, Aditya, Anurag, Devineni, Krishna, Prajal, Sachin, Satwik, Tilakraj, Vishal, Yashasvi