diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt index 22e39236d..bea9847f7 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt @@ -13,13 +13,10 @@ import android.os.Build.VERSION_CODES.P import android.os.Bundle import android.view.Menu import android.view.MenuItem -import android.view.ViewGroup import androidx.annotation.RequiresApi import androidx.core.content.getSystemService import androidx.core.view.ViewCompat import androidx.core.view.isVisible -import androidx.core.view.updateLayoutParams -import androidx.core.view.updateMargins import androidx.fragment.app.DialogFragment import androidx.fragment.app.Fragment import androidx.preference.Preference @@ -76,7 +73,7 @@ class MainActivity : BaseActivity(), MainVie private val overlayProvider by lazy { ElevationOverlayProvider(this) } private val navController = - FragNavController(supportFragmentManager, R.id.mainFragmentContainer) + FragNavController(supportFragmentManager, R.id.main_fragment_container) companion object { const val EXTRA_START_MENU = "extraStartMenu" @@ -118,7 +115,7 @@ class MainActivity : BaseActivity(), MainVie super.onCreate(savedInstanceState) setContentView(ActivityMainBinding.inflate(layoutInflater).apply { binding = this }.root) setSupportActionBar(binding.mainToolbar) - messageContainer = binding.mainFragmentContainer + messageContainer = binding.mainMessageContainer updateHelper.messageContainer = binding.mainFragmentContainer val section = MainView.Section.values() @@ -237,18 +234,12 @@ class MainActivity : BaseActivity(), MainVie setOnViewChangeListener { section, name -> if (section == MainView.Section.ACCOUNT || section == MainView.Section.STUDENT_INFO) { binding.mainBottomNav.isVisible = false - binding.mainFragmentContainer.updateLayoutParams { - updateMargins(bottom = 0) - } if (appInfo.systemVersion >= P) { window.navigationBarColor = getThemeAttrColor(R.attr.colorSurface) } } else { binding.mainBottomNav.isVisible = true - binding.mainFragmentContainer.updateLayoutParams { - updateMargins(bottom = dpToPx(56f).toInt()) - } if (appInfo.systemVersion >= P) { window.navigationBarColor = diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 91283abee..11844e244 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,30 +1,37 @@ - + app:contentInsetStartWithNavigation="0dp" + app:layout_constraintTop_toTopOf="parent" /> + android:layout_height="0dp" + app:layout_constraintBottom_toTopOf="@id/main_bottom_nav" + app:layout_constraintTop_toBottomOf="@id/main_toolbar" /> - + + - + app:labelVisibilityMode="labeled" + app:layout_constraintBottom_toBottomOf="parent" /> +