diff --git a/app/src/main/java/com/example/labwork/button_navigation/Screens.kt b/app/src/main/java/com/example/labwork/button_navigation/Screens.kt index 990a6b3..e15d8df 100644 --- a/app/src/main/java/com/example/labwork/button_navigation/Screens.kt +++ b/app/src/main/java/com/example/labwork/button_navigation/Screens.kt @@ -33,17 +33,13 @@ import androidx.compose.ui.unit.em import androidx.compose.ui.unit.sp import com.example.labwork.R import com.example.labwork.pages.ItemProduct +import com.example.labwork.pages.ListInfo import com.example.labwork.pages.ListProduct import com.example.labwork.pages.getItemProducts @Composable fun ScreenInfo() { - Text( - modifier = Modifier - .fillMaxSize() - .wrapContentHeight(), - text = "Тут будет главный экран..." - ) + ListInfo() } @Composable diff --git a/app/src/main/java/com/example/labwork/pages/ListInfo.kt b/app/src/main/java/com/example/labwork/pages/ListInfo.kt new file mode 100644 index 0000000..f71ca1a --- /dev/null +++ b/app/src/main/java/com/example/labwork/pages/ListInfo.kt @@ -0,0 +1,118 @@ +package com.example.labwork.pages + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material.Tab +import androidx.compose.material.TabRow +import androidx.compose.material.TabRowDefaults +import androidx.compose.material.TabRowDefaults.tabIndicatorOffset +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.setValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Alignment.Companion.CenterHorizontally +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.example.labwork.R +import com.example.labwork.ui.theme.DarkBluePolitech +import com.example.labwork.ui.theme.LightBluePolitech + + +@Composable +fun ListInfo() { + var selectedTab by remember { mutableStateOf(0) } + Box(modifier = Modifier.fillMaxSize()) { + Column( + modifier = Modifier + .padding(16.dp) + .align(Alignment.TopCenter) + ) { + Image( + painter = painterResource(id = R.drawable.logo_ulstu), + contentDescription = "Menu Image", + modifier = Modifier + .size(200.dp) + .align(CenterHorizontally) + .shadow(16.dp) + .background(color = Color.Transparent) + ) + Spacer(modifier = Modifier.height(16.dp)) + TabRow( + selectedTabIndex = selectedTab, + backgroundColor = LightBluePolitech, + contentColor = Color.White, + indicator = { tabPositions -> + TabRowDefaults.Indicator( + color = Color.White, + height = 4.dp, + modifier = Modifier + .tabIndicatorOffset(tabPositions[selectedTab]) + ) + }, + modifier = Modifier.shadow(16.dp) + ) { + Tab( + selected = selectedTab == 0, + onClick = { selectedTab = 0 } + ) { + Text( + text = "Tab 1", + modifier = Modifier.padding(8.dp) + ) + } + Tab( + selected = selectedTab == 1, + onClick = { selectedTab = 1 } + ) { + Text( + text = "Tab 2", + modifier = Modifier.padding(8.dp) + ) + } + Tab( + selected = selectedTab == 2, + onClick = { selectedTab = 2 } + ) { + Text( + text = "Tab 3", + modifier = Modifier.padding(8.dp) + ) + } + } + Spacer(modifier = Modifier.height(16.dp)) + when (selectedTab) { + 0 -> TabContent("Tab 1 Content") + 1 -> TabContent("Tab 2 Content") + 2 -> TabContent("Tab 3 Content") + } + } + } +} + +@Composable +fun TabContent(content: String) { + Column(modifier = Modifier.fillMaxWidth()) { + Text( + text = content, + modifier = Modifier.padding(16.dp), + fontSize = 18.sp + ) + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-nodpi/logo_ulstu.png b/app/src/main/res/drawable-nodpi/logo_ulstu.png new file mode 100644 index 0000000..1adaa27 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/logo_ulstu.png differ diff --git a/app/src/main/res/drawable/resource__polytech_back.png b/app/src/main/res/drawable/resource__polytech_back.png new file mode 100644 index 0000000..a5d5fa6 Binary files /dev/null and b/app/src/main/res/drawable/resource__polytech_back.png differ