Let's learn about Kotlin classes and files in Android Studio. In this tutorial we'll filter our list by cost and owner, using an if statement to construct our expression. We can use && and/or || to filter down our products. For example, we can do if it.cost is less than $200 then display that product, otherwise hide it.
I write at least dozens of if statements every day at my job and I bet you will too. Our if statement will go inside forEach loop so the statement is applied to each product.
This will become useful as we filter down data for our RecyclerView which we'll (hopefully) learn about in the next video. Android app development is fun and I hope you also like it.
Code for this tutorial can be found on GitHub, view the code and download the zip from this URL: https://github.com/danielmalone/Andro...
The above GitHub link contains direct links to every tutorial in this series. If you ever get lost click this link to see the entire codebase at the point each tutorial was recorded: https://github.com/danielmalone/Andro...
If you have questions about Kotlin lists, if statements, companion objects or want to know more about anything specific leave me a comment below. Enjoy :)
Connect with me on LinkedIn! / danielmalone
Смотрите видео Android Studio Tutorial - Part 7 (2020 Edition) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь DJ Malone 08 Апрель 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 13,833 раз и оно понравилось 136 людям.