2023-04-08 11:41:02 +02:00
|
|
|
package com.denizk0461.studip.activity
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
|
|
|
import androidx.core.view.WindowCompat
|
2023-04-28 15:14:50 +02:00
|
|
|
import androidx.fragment.app.FragmentActivity
|
2023-05-02 20:52:56 +02:00
|
|
|
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
|
|
|
|
|
|
2023-04-21 15:42:21 +02:00
|
|
|
/**
|
|
|
|
|
* Main activity that handles all common fragments. This is opened on app launch.
|
|
|
|
|
*/
|
2023-04-28 15:14:50 +02:00
|
|
|
class MainActivity : FragmentActivity() {
|
2023-04-08 11:41:02 +02:00
|
|
|
|
2023-04-21 15:42:21 +02:00
|
|
|
// View binding
|
2023-04-08 11:41:02 +02:00
|
|
|
private lateinit var binding: ActivityMainBinding
|
2023-04-26 19:49:29 +02:00
|
|
|
|
2023-04-08 11:41:02 +02:00
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
|
|
2023-04-21 15:42:21 +02:00
|
|
|
// Inflate view binding and bind to this activity
|
2023-04-08 11:41:02 +02:00
|
|
|
binding = ActivityMainBinding.inflate(layoutInflater)
|
|
|
|
|
setContentView(binding.root)
|
|
|
|
|
|
2023-05-02 20:52:56 +02:00
|
|
|
// Set up bottom navigation view to navigate between fragments
|
|
|
|
|
binding.navView.setupWithNavController(
|
|
|
|
|
binding.navHostFragmentContentMain.getFragment<NavHostFragment>().findNavController()
|
|
|
|
|
)
|
2023-04-13 12:25:43 +02:00
|
|
|
}
|
2023-04-08 11:41:02 +02:00
|
|
|
}
|