farbodbj / GuardianNews

Simple online news feed app using Guardian Open platform based on clean architecture and best practices.
1 stars 0 forks source link

Redundant #2

Closed keramat-farid closed 11 months ago

keramat-farid commented 11 months ago

Adapters hold the reference for all items them self, you don't need to declare a variable to save their references. If you want to prevent extra fragments creation you can use setOffscreenPageLimit

https://github.com/farbodbj/GuardianNews/blob/47fa4e005c8bd70f028b2b5218d904e96c77d8b6/app/src/main/java/com/bale_bootcamp/guardiannews/adapter/NewsPagerAdapter.kt#L13

farbodbj commented 11 months ago

fragments list removed. fragment instances are now made using a factory class and DI.