Что-то получается...

This commit is contained in:
Данила Мочалов 2023-10-09 18:09:28 +04:00
parent 8d7f7cccab
commit c25ac4a9a9
7 changed files with 41 additions and 27 deletions

View File

@ -7,11 +7,11 @@
<deviceKey> <deviceKey>
<Key> <Key>
<type value="VIRTUAL_DEVICE_PATH" /> <type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\dxren\.android\avd\Pixel_3a_API_34_extension_level_7_x86_64.avd" /> <value value="C:\Users\Danya\.android\avd\Pixel_2_API_34_2.avd" />
</Key> </Key>
</deviceKey> </deviceKey>
</Target> </Target>
</targetSelectedWithDropDown> </targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-10-08T11:14:30.167187700Z" /> <timeTargetWasSelectedWithDropDown value="2023-10-09T12:44:34.176701300Z" />
</component> </component>
</project> </project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17_PREVIEW" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@ -17,16 +17,10 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContent { setContent {
ShawarmaTheme {
// A surface container using the 'background' color from the theme
Surface(
color = MyLightYellow,
modifier = Modifier.fillMaxSize()
)
{
MainNavBar() MainNavBar()
}
}
} }
} }
} }

View File

@ -1,23 +1,35 @@
package com.example.shawarma.screens package com.example.shawarma.screens
import android.annotation.SuppressLint
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController import androidx.navigation.compose.rememberNavController
import com.example.shawarma.screens.authorization.AuthorizationScreen import com.example.shawarma.screens.authorization.AuthorizationScreen
import com.example.shawarma.screens.registration.RegistrationScreen import com.example.shawarma.screens.registration.RegistrationScreen
import com.example.shawarma.ui.theme.MyLightYellow
import com.example.shawarma.utils.ScreenPaths import com.example.shawarma.utils.ScreenPaths
@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
@Composable @Composable
fun MainNavBar() { fun MainNavBar() {
val navController = rememberNavController() val navController = rememberNavController()
Scaffold(
NavHost(navController = navController, startDestination = ScreenPaths.authorization.name) { backgroundColor = MyLightYellow,
composable(ScreenPaths.authorization.name) { modifier = Modifier.fillMaxSize()
AuthorizationScreen(navController) ) {scaffoldPadding ->
} NavHost(navController = navController, startDestination = ScreenPaths.authorization.name) {
composable(ScreenPaths.registration.name) { composable(ScreenPaths.authorization.name) {
RegistrationScreen(navController) AuthorizationScreen(navController)
}
composable(ScreenPaths.registration.name) {
RegistrationScreen(navController)
}
} }
} }
} }

View File

@ -1,5 +1,6 @@
package com.example.shawarma.screens.authorization package com.example.shawarma.screens.authorization
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.imePadding
@ -33,8 +34,10 @@ import com.example.shawarma.widgets.ShawarmaLogo1
@Composable @Composable
fun AuthorizationScreen(navHostController: NavHostController) { fun AuthorizationScreen(navHostController: NavHostController) {
ShawarmaLogo1() Box(contentAlignment = Alignment.TopCenter){
AuthorizationCard(navHostController) ShawarmaLogo1()
AuthorizationCard(navHostController)
}
} }
@Composable @Composable
@ -47,12 +50,15 @@ fun AuthorizationCard(navHostController: NavHostController) {
modifier = Modifier modifier = Modifier
.zIndex(2f) .zIndex(2f)
.verticalScroll(rememberScrollState()) .verticalScroll(rememberScrollState())
.imePadding().padding(10.dp) .imePadding()
.padding(10.dp)
.fillMaxHeight() .fillMaxHeight()
) { ) {
Card( Card(
shape = RoundedCornerShape(20.dp), shape = RoundedCornerShape(20.dp),
modifier = Modifier.size(275.dp, 290.dp + 72.dp).padding(top = 72.dp) modifier = Modifier
.size(275.dp, 290.dp + 72.dp)
.padding(top = 72.dp)
) { ) {
Column( Column(
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally

View File

@ -3,6 +3,7 @@ package com.example.shawarma.screens.registration
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.FlingBehavior import androidx.compose.foundation.gestures.FlingBehavior
import androidx.compose.foundation.gestures.ScrollScope import androidx.compose.foundation.gestures.ScrollScope
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.imePadding
@ -28,6 +29,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex import androidx.compose.ui.zIndex
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import com.example.shawarma.screens.authorization.AuthorizationCard
import com.example.shawarma.ui.theme.JejuFamily import com.example.shawarma.ui.theme.JejuFamily
import com.example.shawarma.ui.theme.MyLightRed import com.example.shawarma.ui.theme.MyLightRed
import com.example.shawarma.utils.ScreenPaths import com.example.shawarma.utils.ScreenPaths
@ -36,9 +38,10 @@ import com.example.shawarma.widgets.ShawarmaLogo1
@Composable @Composable
fun RegistrationScreen(navHostController: NavHostController) { fun RegistrationScreen(navHostController: NavHostController) {
RegistrationCard(navHostController) Box(contentAlignment = Alignment.TopCenter){
ShawarmaLogo1() ShawarmaLogo1()
RegistrationCard(navHostController)
}
} }
@Composable @Composable

View File

@ -23,5 +23,4 @@ kotlin.code.style=official
android.nonTransitiveRClass=true android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false android.nonFinalResIds=false
org.gradle.unsafe.configuration-cache=true
android.suppressUnsupportedCompileSdk=34 android.suppressUnsupportedCompileSdk=34