Start impl base news ui
This commit is contained in:
@@ -53,11 +53,13 @@ kapt {
|
||||
dependencies {
|
||||
// Compose
|
||||
implementation(libs.androidx.activity.compose)
|
||||
implementation(platform(libs.compose.bom))
|
||||
implementation(platform(libs.androidx.compose.bom))
|
||||
implementation(libs.compose.runtime)
|
||||
implementation(libs.compose.ui)
|
||||
implementation(libs.compose.foundation)
|
||||
implementation(libs.compose.material3)
|
||||
implementation(libs.compose.material.icons.extended)
|
||||
|
||||
|
||||
// Navigation Compose
|
||||
implementation(libs.androidx.navigation.compose)
|
||||
|
||||
@@ -2,12 +2,16 @@ package ru.fincode.tsudesk.presentation.main
|
||||
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.CalendarToday
|
||||
import androidx.compose.material.icons.rounded.Newspaper
|
||||
import androidx.compose.material.icons.rounded.School
|
||||
import androidx.compose.material.icons.rounded.Settings
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import androidx.navigation.NavHostController
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import ru.fincode.tsudesk.R
|
||||
@@ -21,14 +25,10 @@ fun MainScaffold(
|
||||
navController: NavHostController,
|
||||
content: @Composable (Modifier) -> Unit,
|
||||
) {
|
||||
val scheduleIcon =
|
||||
androidx.compose.ui.graphics.vector.ImageVector.vectorResource(R.drawable.ic_progress)
|
||||
val newsIcon =
|
||||
androidx.compose.ui.graphics.vector.ImageVector.vectorResource(R.drawable.ic_progress)
|
||||
val progressIcon =
|
||||
androidx.compose.ui.graphics.vector.ImageVector.vectorResource(R.drawable.ic_progress)
|
||||
val settingsIcon =
|
||||
androidx.compose.ui.graphics.vector.ImageVector.vectorResource(R.drawable.ic_progress)
|
||||
val scheduleIcon = Icons.Rounded.CalendarToday
|
||||
val newsIcon = Icons.Rounded.Newspaper
|
||||
val progressIcon = Icons.Rounded.School
|
||||
val settingsIcon = Icons.Rounded.Settings
|
||||
|
||||
val items = listOf(
|
||||
TopLevelItem(TopLevelDestination.SCHEDULE, R.string.tab_schedule, scheduleIcon),
|
||||
@@ -41,10 +41,7 @@ fun MainScaffold(
|
||||
val selected = selectedTopLevel(backStackEntry)
|
||||
|
||||
Scaffold(
|
||||
// ВАЖНО: при edge-to-edge отключаем автоматические systemBars insets у Scaffold,
|
||||
// иначе получаем двойные отступы (Scaffold + windowInsetsPadding в Header'е)
|
||||
contentWindowInsets = WindowInsets(0),
|
||||
|
||||
bottomBar = {
|
||||
if (shouldShowBottomBar(backStackEntry)) {
|
||||
val uiItems = items.map { item ->
|
||||
@@ -68,8 +65,6 @@ fun MainScaffold(
|
||||
}
|
||||
}
|
||||
) { innerPadding ->
|
||||
// innerPadding учитывает bottomBar и системные элементы Scaffold (если будут),
|
||||
// но НЕ добавляет statusBars (мы делаем это вручную в нужных местах, например в Header)
|
||||
content(Modifier.padding(innerPadding))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user