Skip to content

Commit

Permalink
Merge branch 'main' into feature/alarm
Browse files Browse the repository at this point in the history
  • Loading branch information
isanghoony authored Sep 25, 2024
2 parents af6a59a + 21f1b79 commit c4a3936
Show file tree
Hide file tree
Showing 50 changed files with 605 additions and 1,135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ package com.appleroid.core.designsystem.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand All @@ -21,13 +26,16 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.appleroid.core.designsystem.theme.BLACK
import com.appleroid.core.designsystem.theme.DOT
import com.appleroid.core.designsystem.theme.GREY05
import com.appleroid.core.designsystem.theme.GREY08
import com.appleroid.core.designsystem.theme.POINT01
import com.appleroid.core.designsystem.theme.WHITE

Expand Down Expand Up @@ -123,3 +131,36 @@ fun ImageWithTextBtn(
}
}
}

@Composable
fun LabelBtn(
modifier: Modifier,
text: String,
textColor: Color,
borderColor : Color,
horizontalPadding : Dp
){
Box(
modifier = modifier
.wrapContentWidth()
.wrapContentHeight()
.background(
color = Color.Transparent,
shape = RoundedCornerShape(17.dp)
)
.border(
width = 1.dp,
color = borderColor,
shape = RoundedCornerShape(17.dp)
)
){
Text(
text = text,
style = MaterialTheme.typography.labelSmall,
color = textColor,
modifier = Modifier
.padding(horizontal = horizontalPadding)
.padding(top = 2.dp, bottom = 3.5.dp)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,22 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.appleroid.core.designsystem.R
import com.appleroid.core.designsystem.theme.BTN_BACKGROUND
import com.appleroid.core.designsystem.theme.DOT
import com.appleroid.core.designsystem.theme.GREY01
import com.appleroid.core.designsystem.theme.GREY02
import com.appleroid.core.designsystem.theme.GREY04
import com.appleroid.core.designsystem.theme.GREY05
import com.appleroid.core.designsystem.theme.POINT01
import com.appleroid.core.designsystem.theme.POINT01_23
import com.appleroid.core.designsystem.theme.WHITE
import com.appleroid.core.designsystem.utils.textSp

@Composable
fun WithTextCheckBoxCard(
Expand Down Expand Up @@ -65,14 +72,18 @@ fun WithTextCheckBoxCard(
Image(
painter = painterResource(if(isSelected) R.drawable.ic_select_check else R.drawable.ic_unselect_check),
contentDescription = "icon_check",
modifier = Modifier.size(16.dp)
modifier = Modifier
.size(16.dp)
.align(Alignment.CenterVertically)
)

Text(
LabelText(
text = text,
color = if(isSelected) POINT01 else WHITE,
style = MaterialTheme.typography.labelMedium,
modifier = Modifier.padding(start = 12.dp)
modifier = Modifier
.padding(start = 12.dp)
.align(Alignment.CenterVertically)
)

if (percentText.isNotBlank()) {
Expand All @@ -82,7 +93,9 @@ fun WithTextCheckBoxCard(
text = percentText,
color = WHITE,
style = MaterialTheme.typography.labelMedium,
modifier = Modifier.padding(start = 8.dp, end = 16.dp)
modifier = Modifier
.padding(start = 8.dp, end = 16.dp)
.align(Alignment.CenterVertically)
)
}
}
Expand All @@ -94,7 +107,6 @@ fun MbtiCheckBox(
modifier: Modifier = Modifier,
key : String,
text : String,
painter : Painter,
isChecked : Boolean,
onClick : (String) -> Unit
){
Expand All @@ -106,43 +118,31 @@ fun MbtiCheckBox(
){
Box(modifier = Modifier
.fillMaxSize()
.padding(8.dp)
.clip(CircleShape)
.padding(5.dp)
.clip(RoundedCornerShape(12.dp))
.border(
width = 1.dp,
color = if(isChecked) POINT01 else BTN_BACKGROUND,
shape = CircleShape
)
.background(
color = if(isChecked) POINT01_23 else BTN_BACKGROUND,
width = 2.dp,
color = if(isChecked) POINT01 else GREY04,
shape = RoundedCornerShape(12.dp)
)
.background(color = GREY04)
){
Icon(
painter = painter,
tint = if(isChecked) POINT01 else DOT,
contentDescription = "mbti",
modifier = Modifier.align(Alignment.Center)
)
}

if(isChecked){
Box(
LabelText(
modifier = Modifier
.width(33.dp)
.height(20.dp)
.align(Alignment.BottomCenter)
.background(
color = POINT01,
shape = RoundedCornerShape(6.dp)
)
){
Text(
text = text,
style = MaterialTheme.typography.displaySmall,
color = Color.Black,
modifier = Modifier.align(Alignment.Center)
)
}
.height(44.dp)
.align(Alignment.Center),
text = text,
color = if(isChecked) POINT01 else GREY02,
style = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 14.dp.textSp,
lineHeight = 21.dp.textSp,
letterSpacing = 0.dp.textSp,
textAlign = TextAlign.Center
),
alignment = Alignment.Center
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ fun TitleText(
fun DescriptionText(
modifier: Modifier = Modifier,
title : String = "",
alignment: Alignment = Alignment.CenterStart
alignment: Alignment = Alignment.CenterStart,
textAlign: TextAlign = TextAlign.Left
){
Box(
modifier = modifier
Expand All @@ -45,6 +46,7 @@ fun DescriptionText(
text = title,
color = GREY01,
style = MaterialTheme.typography.labelMedium,
textAlign = textAlign,
modifier = Modifier.align(alignment)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fun MKungTextField(
textStyle: TextStyle,
placeholder : String = "",
placeholderColor : Color = GREY01,
isLimitWidth : Boolean = false,
focusRequester: FocusRequester = remember { FocusRequester() },
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardActions: KeyboardActions = KeyboardActions.Default,
Expand Down Expand Up @@ -87,10 +86,7 @@ fun MKungTextField(
modifier = Modifier
.align(Alignment.CenterStart)
.focusRequester(focusRequester)
.then(
if(isLimitWidth) Modifier.width(textFieldWidth)
else Modifier.wrapContentWidth()
)
.fillMaxWidth()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.appleroid.core.designsystem.component

import androidx.compose.foundation.Image

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -59,7 +62,7 @@ fun BackWithTextTopAppBar(
.align(Alignment.CenterStart)
.size(28.dp)
.clickable {

}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package com.appleroid.core.designsystem.theme
import androidx.compose.ui.graphics.Color

val BLACK = Color(0xFF000000)

val GREY08 = Color(0xFF454545)
val GREY07 = Color(0xFF212121)
val GREY06 = Color(0xFF141414)
val GREY05 = Color(0xFF292929)
val GREY04 = Color(0xFF383838)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ fun mKungTypography() = Typography(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.SemiBold,
fontSize = 18.dp.textSp,
lineHeight = 20.dp.textSp,
lineHeight = 27.dp.textSp,
letterSpacing = 0.dp.textSp,
color = WHITE
),
labelMedium = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.SemiBold,
fontWeight = FontWeight.Normal,
fontSize = 14.dp.textSp,
lineHeight = 16.dp.textSp,
lineHeight = 21.dp.textSp,
letterSpacing = 0.dp.textSp,
color = WHITE
),
Expand All @@ -54,6 +54,14 @@ fun mKungTypography() = Typography(
lineHeight = 16.dp.textSp,
letterSpacing = 0.dp.textSp
),
displayMedium = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 14.dp.textSp,
lineHeight = 21.dp.textSp,
letterSpacing = 0.dp.textSp,
color = WHITE
),
displaySmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ fun Int.toDp(): Dp {
return (this / Resources.getSystem().displayMetrics.density).dp
}
class PhoneNumberVisualTransformation : VisualTransformation {

override fun filter(text: AnnotatedString): TransformedText {
val formattedText = formatPhoneNumber(text.text)

val formattedText = formatPhoneNumber(text.text.replace(".","").replace(",",""))

val offsetMapping = object : OffsetMapping {
override fun originalToTransformed(offset: Int): Int {
if (offset <= 2) return offset
Expand Down
Loading

0 comments on commit c4a3936

Please sign in to comment.