BOX

- 지정된 Ratio 조건을 가지는 둥근 테두리 모양의 이미지 렌더링 컴포넌트를 작업했다. - Ratio는 가로 세로 비율인데, 디자인 가이드에 1:2, 16:9 형식처럼 디자이너분이 지정을 해주셨고, 그에 따라 Enum Class로 정리했다.enum class CustomRatio(val width: Int, val height: Int, ...) { RATIO_1_1(1, 1, ...), RATIO_4_5(4, 5, ...), ... - 그리고 Float 타입으로 Ratio 값을 구하는 공식 함수도 선언해 준다.val value: Float get() = width.toFloat() / height - 둥근 테두리 구성을 위해 Modifier의 border를 사용했다. width..
- 상위 컴포저블로 Surface를 활용한 컴포넌트에 알파 값이 적용된 컬러를 적용했더니 아래처럼 색상이 깨지는 문제가 발생했다.Surface( modifier = Modifier .height(size.value) .clip(RoundedCornerShape(dimensionResource(R.dimen.corner_radius_06))) .tbRipple { onClick.invoke() }, color = if (isDisabled) colorResource(R.color.color_system_fill_disabled_light) else colorResource(appearance.color), contentColor = colorResour..
- 이미지를 중첩시키고 싶다면 Box 컴포저블을 사용하면 된다. Z 축으로 쌓이는 컨테이너 구조이다. - Image 말고 다른 컴포저블들도 중첩된다.@Composablefun Avatar(~~) { Box( modifier = Modifier.wrapContentSize() ) { Image(~~~) Image( painter = painterResource(id = R.drawable.abc), contentDescription = "Profile", modifier = Modifier .size(size.dp) .padding(3.5.dp) ..