Created
January 26, 2022 03:32
-
-
Save fededri/ff7151179785503a1e4b7619c7f92efc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MoviesFragment : Fragment() { | |
private val viewModel: MoviesViewModel by activityViewModels {...} | |
override fun onCreateView(inflater: LayoutInflater): View = ComposeView(inflater.context).apply { | |
layoutParams = ... | |
setContent { | |
val state by viewModel.observeState().collectAsState() | |
MoviesListView(state = state, onMovieSelected = { movie -> | |
viewModel.action(MoviesActions.SelectMovie(movie)) | |
}) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment