-
Notifications
You must be signed in to change notification settings - Fork 0
初期フローの合体をした #144
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
初期フローの合体をした #144
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ import androidx.compose.foundation.layout.offset | |
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.foundation.text.KeyboardActions | ||
import androidx.compose.foundation.text.KeyboardOptions | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.TextField | ||
|
@@ -29,7 +31,9 @@ import androidx.compose.ui.Modifier | |
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.input.ImeAction | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
|
@@ -60,6 +64,7 @@ fun InitialFlow7Screen(navController: NavHostController) { | |
var imageUri: Uri? by remember { | ||
mutableStateOf(null) | ||
} | ||
val keyboardController = LocalSoftwareKeyboardController.current | ||
val launcher = | ||
rememberLauncherForActivityResult(contract = ActivityResultContracts.GetContent()) { uri -> | ||
if (uri == null) return@rememberLauncherForActivityResult | ||
|
@@ -116,14 +121,25 @@ fun InitialFlow7Screen(navController: NavHostController) { | |
onValueChange = { newValue -> text.value = newValue }, | ||
placeholder = { Text(text = "名前をここに入力してね") }, | ||
colors = | ||
TextFieldDefaults.textFieldColors( | ||
containerColor = GranulatedSugar, | ||
TextFieldDefaults.colors( | ||
focusedContainerColor = GranulatedSugar, | ||
unfocusedLabelColor = GranulatedSugar, | ||
), | ||
modifier = | ||
Modifier | ||
.padding(0.dp, 40.dp, 0.dp, 0.dp) | ||
.clip(CircleShape) | ||
.size(350.dp, 55.dp), | ||
.fillMaxWidth() | ||
.padding(horizontal = 10.dp, vertical = 40.dp), | ||
singleLine = true, | ||
keyboardOptions = | ||
KeyboardOptions.Default.copy( | ||
imeAction = ImeAction.Done, | ||
), | ||
keyboardActions = | ||
KeyboardActions( | ||
onDone = { | ||
keyboardController?.hide() | ||
}, | ||
), | ||
Comment on lines
+133
to
+142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nits] |
||
) | ||
Text( | ||
text = "※名前とアイコンは", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.text.KeyboardActions | ||
import androidx.compose.foundation.text.KeyboardOptions | ||
import androidx.compose.material3.DropdownMenuItem | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
|
@@ -27,6 +28,8 @@ import androidx.compose.ui.Alignment | |
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController | ||
import androidx.compose.ui.text.input.ImeAction | ||
import androidx.compose.ui.text.input.KeyboardType | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.tooling.preview.Preview | ||
|
@@ -57,6 +60,7 @@ fun InitialFlow8Screen(navController: NavHostController) { | |
val viewModel: TargetSettings = viewModel() | ||
val context = LocalContext.current | ||
val text = remember { mutableStateOf("") } | ||
val keyboardController = LocalSoftwareKeyboardController.current | ||
|
||
InitialFlowBackground { | ||
Box(modifier = Modifier.fillMaxSize()) { | ||
|
@@ -101,7 +105,15 @@ fun InitialFlow8Screen(navController: NavHostController) { | |
keyboardOptions = | ||
KeyboardOptions( | ||
keyboardType = KeyboardType.Number, | ||
imeAction = ImeAction.Done, | ||
), | ||
keyboardActions = | ||
KeyboardActions( | ||
onDone = { | ||
keyboardController?.hide() | ||
}, | ||
), | ||
Comment on lines
+108
to
+115
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nits] ここも |
||
singleLine = true, | ||
) | ||
Text( | ||
text = "目標期間", | ||
|
@@ -170,7 +182,7 @@ fun InitialFlow8Screen(navController: NavHostController) { | |
) { | ||
NextButton( | ||
navController = navController, | ||
nextDestination = "initialFlow/10", | ||
nextDestination = "initialFlow/9", | ||
modifier = Modifier.padding(20.dp, 0.dp, 20.dp, 10.dp), | ||
onClick = { | ||
viewModel.viewModelScope.launch { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits]
singleLine = true
だけでやりたいことはできてそうなのでここは不要かも