Our great sponsors
-
architecture-samples
A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I'm studying "Android App Development with Kotlin" by Google at Udacity. In one of the lessons, you are taught how to handle clicking items from a RecyclerView in the fragment, using a callback function, like this: val clickListener: (sleepId: Long) -> Unit) , and from the fragment calling any methods of your ViewModel. Studying this project https://github.com/android/architecture-samples, the pattern used to handle clicks is to send the ViewModel to the ViewHolder and add it to the binding as a variable and make all the XML method calls, like this: android: onClick = "@{viewModel.taskComplete(task)}".Performatively, which of these ways is faster?
Related posts
- I need a repo with a modern and advanced architecture for an Android project. Can you help me?
- Example code for seprate business logic from UI layer in flutter.
- I am a graduate who wants to become an Android developer. Any advice please?
- Is there a list of composables and functions anywhere?
- Newbie questions about dependency inversion.