Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#8 sign up1 UI #10

Merged
merged 4 commits into from
Nov 5, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.hackathon.alddeul_babsang.core_ui.component

import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.sp
import com.hackathon.alddeul_babsang.core_ui.theme.*

@Composable
fun SignUpLoginTextField(
value: String,
onValueChange: (String) -> Unit,
placeholderText: String
) {
TextField(
value = value,
onValueChange = onValueChange,
placeholder = {
Text(
text = placeholderText,
style = head4Bold,
color = Gray300,
)
},
colors = TextFieldDefaults.colors(
focusedContainerColor = Color.White, // ํฌ์ปค์Šค๋œ ์ƒํƒœ์—์„œ ๋ฐฐ๊ฒฝ์ƒ‰์„ ํฐ์ƒ‰์œผ๋กœ ์„ค์ •
unfocusedContainerColor = Color.White, // ๋น„ํฌ์ปค์Šค ์ƒํƒœ์—์„œ ๋ฐฐ๊ฒฝ์ƒ‰์„ ํฐ์ƒ‰์œผ๋กœ ์„ค์ •
cursorColor = Color.Black,
focusedIndicatorColor = Orange900,
unfocusedIndicatorColor = Gray300
)
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
package com.hackathon.alddeul_babsang.presentation.auth

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.hackathon.alddeul_babsang.R
import com.hackathon.alddeul_babsang.core_ui.component.AlddeulButton
import com.hackathon.alddeul_babsang.core_ui.component.SignUpLoginTextField
import com.hackathon.alddeul_babsang.core_ui.theme.AlddeulBabsangTheme
import com.hackathon.alddeul_babsang.core_ui.theme.head4Bold

@Composable
fun SignUpScreen1(navController: NavController) {
val (id, setId) = remember {
mutableStateOf("")
}

val (password, setPassword) = remember {
mutableStateOf("")
}

Column(
modifier = Modifier
.fillMaxSize()
.background(Color.White)
.padding(top = 145.dp)
.imePadding(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Top
) {
Text(
stringResource(R.string.setIdPassword),
textAlign = TextAlign.Center,
style = head4Bold,
lineHeight = 25.sp

)
Spacer(modifier = Modifier.height(50.dp))

SignUpLoginTextField(
value = id,
onValueChange = setId,
placeholderText = stringResource(R.string.setId)
)

Spacer(modifier = Modifier.height(16.dp))

SignUpLoginTextField(
value = password,
onValueChange = setPassword,
placeholderText = stringResource(R.string.setPassword)
)

Spacer(modifier = Modifier.weight(1f))

AlddeulButton(
text = R.string.next,
onClick = {
if (id.isNotEmpty() && password.isNotEmpty()) {
//navController.navigate("signUp2")
}
}
)

}

}


@Preview
@Composable
fun SignUpScreen1Preview() {
AlddeulBabsangTheme {
SignUpScreen1(
navController = rememberNavController()
)
}
}
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
<string name="btn_review_complete">์™„๋ฃŒ</string>
<string name="tv_review_length">%1$s/100์ž</string>
<string name="toast_review_length">๋ฆฌ๋ทฐ๋Š” 100์ž ์ด๋‚ด๋กœ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.</string>
<string name="next">๋‹ค์Œ</string>
<string name="setIdPassword">์•„์ด๋””์™€ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ\n์„ค์ •ํ•ด์ฃผ์„ธ์š”</string>
<string name="setId">์•„์ด๋”” ์ž…๋ ฅ</string>
<string name="setPassword">๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ</string>
seoyeonsw marked this conversation as resolved.
Show resolved Hide resolved

</resources>
Loading