From the course: Intermediate Kotlin for Android Developers

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Anko commons: Design and support.v4

Anko commons: Design and support.v4

From the course: Intermediate Kotlin for Android Developers

Start my 1-month free trial

Anko commons: Design and support.v4

- [Instructor] Anko provides several different artifacts that you can use to enhance your android development. In this video, we'll look at the use of the Snackbar, and fragments. So first we need to make sure we have the following dependencies in our build.gradle file. The anko-design dependency here on line 35, and the anko-support-v4-commons dependency on line 36. Since these aren't core to Anko, they're found in the different artifacts. Now we're going to be updating the PlanetDetailActivity class in order to take advantage of these new types of Anko extensions. Previously, we created our own extension on the view class to handle some limited interaction with the Snackbar. And that's here on line 21, where we created our own showSnackbar extension. But with the Anko Design Library, we no longer need to do that. So we can replace this code right here, with very simply, a call to Snackbar. And let's make sure we include the Anko Design import. That's just snackbar. But you'll notice…

Contents