With Kotlin's property delegates, you can easily customize the behavior of a property. In this video, we'll learn how Kotlin's delegated properties work, by turning Android's SharedPreferences into a delegate.
To see this code working within the context of a full Android app, see the companion code:
github.com/djleeds/video-shar...
✨ New to Kotlin? Start here: typealias.com/start/
... or pick up the new Leanpub Edition! book.typealias.com/
🚀 I just launched a new email newsletter!
Sign up here: newsletter.typealias.com/
More fun with extension operator functions!
• 5 Fun Ways to Use Exte...
More about extension functions:
typealias.com/start/kotlin-re...
More about reified type parameters:
typealias.com/guides/getting-...
Chapters:
00:00 Introduction
00:45 Introduction to Property Delegates
03:18 Simple SharedPreferences Delegation
07:24 Exploring Improvements
10:00 Advanced SharedPreferences Delegation
20:47 Conclusion
If you've got ideas on how we could improve the code in this video, let me know in the comments!
Негізгі бет Easy SharedPreferences with Delegated Properties in Kotlin
Пікірлер: 68