Kotlin Android Extensions is a plugin that lets you access views from your layout XML as if they were a regular property inside of your Android View classes. In this video, learn how to set up your project to take advantage of the plugin.
- [Teacher] Kotlin Android Extensions is a plugin…that lets you access your views from your layout XML files…in a very simple way.…Let's see what we mean by that.…Here's a snippet of our layout file.…We're showing this one in a TextView…with an id of planetDescription.…Now if we wanted to set the text of this TextView…what do we typically need to do?…Let's see.…First we create a property for it in our class.…This is where we specify…the name we want to use and the type.…
Next, let's say this is a fragment.…You would get the view from the findViewById method…and then set the result to our property above.…And then, finally, potentially somewhere else…we get access to our property…and then we set our desired text.…This should sound very familiar.…But if we add the Kotlin Extensions plugin…we get to bypass most of these steps…and we end up with just this.…We can use the id of the element from our layout XML,…access it and then modify it.…
We don't need to do any preliminary setup.…Let's see how this works by moving over to Android Studio.…
- What Kotlin has to offer
- Working with lambdas
- Common Android extension functions
- Kotlin Android Extensions overview
- Making use of the Anko library
- Working with coroutines
- Nullability and collections
Skill Level Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis3h 59m Intermediate
Developing AWS Lambda Functions with Kotlinwith Troy Miles1h 55m Intermediate
1. Kotlin Overview
2. Extension Functions and Properties
3. Incorporating Anko
4. Advanced Anko
5. Working with Collections
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.