This repository has been archived on 2026-05-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
weserplaner/app/src/main/java/com/denizk0461/studip/activity/MainActivity.kt
T

32 lines
1.1 KiB
Kotlin
Raw Normal View History

2023-04-08 11:41:02 +02:00
package com.denizk0461.studip.activity
import android.os.Bundle
import androidx.core.view.WindowCompat
import androidx.fragment.app.FragmentActivity
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.fragment.findNavController
import androidx.navigation.ui.setupWithNavController
2023-04-08 11:41:02 +02:00
import com.denizk0461.studip.databinding.ActivityMainBinding
/**
* Main activity that handles all common fragments. This is opened on app launch.
*/
class MainActivity : FragmentActivity() {
2023-04-08 11:41:02 +02:00
// View binding
2023-04-08 11:41:02 +02:00
private lateinit var binding: ActivityMainBinding
2023-04-08 11:41:02 +02:00
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
// Inflate view binding and bind to this activity
2023-04-08 11:41:02 +02:00
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
// Set up bottom navigation view to navigate between fragments
binding.navView.setupWithNavController(
binding.navHostFragmentContentMain.getFragment<NavHostFragment>().findNavController()
)
}
2023-04-08 11:41:02 +02:00
}