-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Compose workspace config #1450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compose workspace config #1450
Conversation
Added compose as an option to use Firebase
Added Firebase Config functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@millandavid Thanks for your PR!
I've added some initial comments that I think we should address before going into the ViewModel
step.
config/app/src/main/java/com/google/samples/quickstart/config/kotlin/MainComposeActivity.kt
Outdated
Show resolved
Hide resolved
config/app/src/main/java/com/google/samples/quickstart/config/kotlin/MainComposeActivity.kt
Outdated
Show resolved
Hide resolved
Added initial PR changes that Rosário had mentioned.
Combined the text and button into the parent composable function
Updated the MainComposeActivity.kt to remove the wildcard imports and replaced with the appropriate ones
Corrected exceeded max line length error by putting the comment under the code. Corrected build.gradle code to have proper syntax
config/app/src/main/java/com/google/samples/quickstart/config/kotlin/MainComposeActivity.kt
Outdated
Show resolved
Hide resolved
Updated MainComposeAcitvity.kt to correct lint error
A couples of things happened here: - Renamed `fetchConfig()` to `fetchRemoteConfig()` - Created ViewModel Factory to help inject VM dependencies - Moved FirebaseRemoteConfig initialization to the ViewModel (The UI now calls these methods when the screen is created, through a DisposableEffect) - The default value from the XML file is now shown when the screen is first shown
Restructured the UI by implementing Scaffold
Added scaffold and fillMaxWidth imports. Currently having issues with the Scaffold and the experimental wanting it to use wildcard statements
Migrated the code from Material 3 to 2. Also updated Gradle file to use Compose 1.3
Added snackbar when config button is pressed.
config/app/src/main/java/com/google/samples/quickstart/config/kotlin/MainComposeActivity.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @millandavid !!
For review by Rosário Fernandes
Created an option to use Config using Jetpack Compose.
Viewmodels is the next step to be implemented to this Quickstart rather than having the FirebaseActivity file.
In the MainComposeActivity file that was created, please review Composables to advise on whether to continue passing Lambdas or if a Context would be better suitable in this scenario to pass.