StartAndroid
11.1K subscribers
349 photos
9 videos
4 files
1.67K links
Канал об Android (Андроид) разработке

Сайт - http://startandroid.ru

Чат - https://tttttt.me/startandroidchat

Контакты - https://startandroid.ru/ru/about/cntct5.html

Реклама - https://startandroid.ru/ru/about/reklama.html
Download Telegram
Интересные размышления на тему: "В какой момент дергать UseCase (или репозиторий) в ViewModel". Автор предлагает несколько решений и описывает плюсы и минусы.

#android #mvvm #viewmodel

https://proandroiddev.com/when-to-load-data-in-viewmodels-ad9616940da7
Краткий обзор фабрик, которые дают нам возможность повлиять на создание основных Android сущностей

- AppComponentFactory for customising the instantiation of application components
- LayoutInflater.Factory2 and View for customising view inflation
- FragmentFactory for customising fragment creation
- ViewModelProvider.Factory with CreationExtras for simplifying ViewModel creation
- WorkerFactory for customising Worker creation in WorkManager

#android #activity #fragment #viewmodel #di

https://marcellogalhardo.dev/posts/injection-points/
В Hilt появилась возможность использовать Assisted Injection для ViewModel, чтобы передавать свои объекты в конструктор модели.

#android #dagger #hilt #viewmodel

https://medium.com/@alexander.michaud/hiltviewmodel-assisted-injection-with-compose-a800723165bf
В третьей части серии статей о ViewModel Best Practices обсуждают следующие пункты:
- Try not to import Android dependencies in the ViewModels:
- Lazily inject dependencies in the constructor.

#android #viewmodel

https://proandroiddev.com/mastering-android-viewmodels-essential-dos-and-donts-part-3-%EF%B8%8F3%EF%B8%8F%E2%83%A3-1833ce3ddd2b