watermark logo

рдЕрдЧрд▓рд╛

рд╕реНрд╡рдд: рдкреНрд▓реЗ

ViewModel Explained - Android Architecture Component | Tutorial

1 рд╡рд┐рдЪрд╛рд░реЛрдВ тАв 10/12/24
рд╢реЗрдпрд░ рдХрд░рдирд╛
рдПрдореНрдмреЗрдб
121gamers
121gamers
14 рдЧреНрд░рд╛рд╣рдХреЛрдВ
14

ЁЯПЖ My Online Courses
тнРDiscount Coupon: LAUNCH-STEVDZA-SAN
https://stevdza-san.com

ЁЯР▒тАНЁЯСд Wanna become a member? Join!
https://www.youtube.com/channe....l/UCYLAirIEMMXtWOECu

ЁЯУ╕ Instagram
https://www.instagram.com/stevdza_san/


// ViewModel dependency
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"

The ViewModel class is designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations. So when we are talking about Activity or Fragment we are actualy refering to UI Controllers. And ViewModel class should be created for each UI Controller in order to separate things like data and diferent calculations from UI Controler. In UI Controller there should only be necessary code for managing our UI, and everything else we could placed inside a ViewModel class.


Timestamps
0:00 - Introducing with ViewModel
1:30 - Practical example with ViewModel
6:30 - Conclusion

рдФрд░ рджрд┐рдЦрд╛рдУ
0 рдЯрд┐рдкреНрдкрдгрд┐рдпрд╛рдБ sort рдЗрд╕рдХреЗ рдЕрдиреБрд╕рд╛рд░ рдХреНрд░рдордмрджреНрдз рдХрд░реЗрдВ
рдлреЗрд╕рдмреБрдХ рдЯрд┐рдкреНрдкрдгрд┐рдпрд╛рдБ

рдЕрдЧрд▓рд╛

рд╕реНрд╡рдд: рдкреНрд▓реЗ