- 
                Notifications
    You must be signed in to change notification settings 
- Fork 7.4k
Description
Following up on my suggestion to implement Modern Android App Architecture here, I've come up with a list of actionable tasks which we can discuss in this issue.
1. Replace RelativeLayout with ConstraintLayout
ConstraintLayout seems to be the recommended way to design layouts in Android, right now. I suggest we replace all our RelativeLayout usages with ConstraintLayout.
Quickstarts to be updated
- Admob (assigned to @rosariopfernandes, refactor(admob): replace RelativeLayout with ConstraintLayout #1222)
- App Indexing (assigned to @rosariopfernandes, refactor(app-indexing): replace RelativeLayout with ConstraintLayout #1230)
- Authentication (assigned to @rosariopfernandes, refactor(auth): remove RelativeLayout usage #1237)
- Remote Config (assigned to @rosariopfernandes, refactor(config): replace RelativeLayout with ConstraintLayout #1232)
- Crashlytics (assigned to @rosariopfernandes, refactor(crash, functions): replace RelativeLayout with ConstraintLayout #1235)
-  Dynamic Links- removed this one because it's usingLinearLayout
- Realtime Database (assigned to @samtstern,, Remove RelativeLayout from Database quickstart #1244)
- Cloud Firestore (assigned to @samtstern, Remove RelativeLayout from Firestore quickstart #1245)
- Cloud Functions (assigned to @rosariopfernandes, refactor(crash, functions): replace RelativeLayout with ConstraintLayout #1235)
-  Cloud Storage- removed because it usesLinearLayout
2. Use the Navigation Component
Starting in Android Studio 4.0, creating a new project now gives you a single activity with 2 fragments and the Navigation Component included to help navigate between the 2 fragments.
I suggest we update our quickstarts to use the same single-activity-multiple-fragments approach with the Navigation Component.
Quickstarts to be updated
- Admob (assigned to @rosariopfernandes, refactor(admob): use Jetpack's Navigation Component #1247)
- Authentication (assigned to @rosariopfernandes, refactor(auth): use Jetpack's Navigation Component #1265)
- Realtime Database (assigned to @rosariopfernandes, refactor(database): use Jetpack's Navigation Component #1252 )
- Cloud Firestore (assigned to @samtstern, Use Navigation in Firestore #1268 )
3. Use ViewModel+LiveData+Repository
The Android's App Architecture Guide recommends structuring the app with a ViewModel and a Repository for better separation of concerns.
Not only will this be a huge refactor, but we might also run into other issues because of the quickstarts which include snippets that are shown on the Firebase Docs. So I'd suggest we start with the databases quickstarts first, to see if it's worth refactoring the others.
- Cloud Firestore
- Realtime Database