Skip to content
Snippets Groups Projects

MainActivity.kt

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by a6-alrashdi
    MainActivity.kt 814 B
    package com.example.match
    
    import android.os.Bundle
    import androidx.activity.ComponentActivity
    import androidx.activity.compose.setContent
    import androidx.lifecycle.viewmodel.compose.viewModel
    import com.example.match.ui.home.HomeViewModel
    import com.example.match.ui.theme.MatchTheme
    import dagger.hilt.android.AndroidEntryPoint
    
    @AndroidEntryPoint
    class MainActivity : ComponentActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContent {
                val viewModel: HomeViewModel = viewModel()
                viewModel.fetchTopLeaguesMatches()
                viewModel.fetchLiveScores()
                viewModel.fetchUpcomingMatches()
                MatchTheme {
                    AppNavHost()
                }
            }
        }
    }
    
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment