Skip to content

Commit

Permalink
Merge pull request #251 from team-xquare/feature/174-업데이트버그
Browse files Browse the repository at this point in the history
🔀 :: (#250) Feature/174 업데이트버그
  • Loading branch information
yeon0821 authored Nov 8, 2023
2 parents 2816c5b + 439af71 commit 5fac2b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ fun MealDetail(
)
if (breakfast.isNotEmpty()) {
Meal(
mealWithDateEntity = mealWithDateEntity,
mealCalories = mealWithDateEntity.caloriesOfBreakfast,
meal = breakfast,
time = "아침",
)
}
if (lunch.isNotEmpty()) {
Meal(
mealWithDateEntity = mealWithDateEntity,
mealCalories = mealWithDateEntity.caloriesOfLunch,
meal = lunch,
time = "점심",
)
}
if (dinner.isNotEmpty()) {
Meal(
mealWithDateEntity = mealWithDateEntity,
mealCalories = mealWithDateEntity.caloriesOfDinner,
meal = dinner,
time = "저녁",
)
Expand All @@ -83,15 +83,15 @@ fun MealDetail(

@Composable
fun Meal(
mealWithDateEntity: AllMealEntity.MealWithDateEntity,
mealCalories: String,
meal: String,
time: String,
) {
Spacer(Modifier.size(8.dp))
Row(verticalAlignment = Alignment.CenterVertically) {
Body1(text = time, color = gray800)
Body3(
text = mealWithDateEntity.caloriesOfLunch,
text = mealCalories,
color = gray700,
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
Expand All @@ -25,17 +24,18 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.DropdownMenu
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.Icon
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.material.TextFieldDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand All @@ -61,7 +61,6 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavController
import coil.compose.AsyncImage
import coil.compose.rememberAsyncImagePainter
import com.semicolon.design.Body1
import com.semicolon.design.Body2
import com.semicolon.design.Body3
import com.semicolon.design.color.primary.black.black
Expand Down Expand Up @@ -355,14 +354,16 @@ private fun BugreportWhereMenu(
}
}

@OptIn(ExperimentalMaterialApi::class)
@Composable
private fun BugreportExplanationText(
text: String,
isSecret: Boolean = false,
onTextChange: (String) -> Unit,
placeholder: String = "",
placeholder: String,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default
) {
val interactionSource = remember { MutableInteractionSource() }
BasicTextField(
value = text,
onValueChange = onTextChange,
Expand All @@ -373,24 +374,6 @@ private fun BugreportExplanationText(
color = black,
lineHeight = 24.sp,
),
decorationBox = {
Box(contentAlignment = Alignment.TopStart) {
if (text.isEmpty()) {
Body1(
text = placeholder,
color = gray300,
modifier = Modifier
.height(100.dp)
.wrapContentSize(align = Alignment.TopStart)
)
Box(modifier = Modifier.padding(top = 4.dp)) {
it()
}
} else {
it()
}
}
},
keyboardOptions = keyboardOptions,
cursorBrush = SolidColor(purple400),
visualTransformation = if (isSecret) PasswordVisualTransformation() else VisualTransformation.None,
Expand All @@ -401,5 +384,18 @@ private fun BugreportExplanationText(
.background(gray50)
.border(width = 1.dp, color = gray300, shape = RoundedCornerShape(8.dp))
.padding(horizontal = 16.dp, vertical = 12.dp)
)
) {
TextFieldDefaults.TextFieldDecorationBox(
value = text,
visualTransformation = VisualTransformation.None,
innerTextField = it,
singleLine = false,
enabled = false,
placeholder = { Text(text = placeholder) },
interactionSource = interactionSource,
contentPadding = TextFieldDefaults.textFieldWithoutLabelPadding(
start = 2.dp, top = 1.dp
)
)
}
}

0 comments on commit 5fac2b4

Please sign in to comment.