From the course: Intermediate Kotlin for Android Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Anko commons: Basics
From the course: Intermediate Kotlin for Android Developers
Anko commons: Basics
- [Instructor] Let's see how Anko can simplify our interactions with intense and the default Android logger. It's a library so we just need to make sure we have the dependency in our build.gradle file. At the time of this recording, it's 0.10.3. And then here on line 34 you can see that it's part of the Anko commons component. Now let's start by updating our planet list activity. We want this class to use some of the Anko extension methods. So let's clean up the on click listener that's inside of our planets adapter which starts here on line 39. Right now we create an intent that contains the planet id as an extra. And you can see that here on line 42, we then provide this intent to the start activity method of the context class here on line 45. But there's a lot of boiler plate code involved. So let's see how we can achieve this goal with less code using Anko extensions. So the first thing we're going to do is comment out this code here. And then we're going to start by adding Anko…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Anko overview3m 33s
-
(Locked)
Anko commons: Basics4m 12s
-
(Locked)
Anko commons: Design and support.v43m 55s
-
(Locked)
Anko layouts: Basics3m 1s
-
(Locked)
Anko layouts: Create a custom component6m 2s
-
(Locked)
Anko layouts: Style component views4m 18s
-
(Locked)
Anko layouts: Use a custom component4m 16s
-
(Locked)
Anko layouts: Listeners4m 28s
-
(Locked)
Anko layouts: Anko Support plugin1m 54s
-
-
-
-