Skip to content

Instantly share code, notes, and snippets.

@catalinghita8
Last active October 4, 2020 10:54
Show Gist options
  • Select an option

  • Save catalinghita8/4eaa7924ba07d8f7a2a0d0db0ea114b6 to your computer and use it in GitHub Desktop.

Select an option

Save catalinghita8/4eaa7924ba07d8f7a2a0d0db0ea114b6 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val mockUserProfile = UserProfile.getMockProfileUser()
setContent { MainActivityComposable(mockUserProfile) }
}
}
@Composable
fun MainActivityComposable(userProfile: UserProfile) {
Surface( ... )
{ ProfileCardComposable(userProfile) }
}
...
@Preview
@Composable
fun UserProfileCardPreview() {
val mockUserProfile = UserProfile.getMockProfileUser()
MainActivityComposable(mockUserProfile)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment