- 얼마 전에 리플 효과를 적용시킨 FAB 버튼을 구현했었다.- 리플 내부에는 클릭 상태를 감지하는 interactionSource를 포함하고 있다. 이를 통해 리플뿐만 아니라 버튼 자체의 스케일이 변하는 애니메이션까지 추가해 보겠다.interactionSource = interactionSource,indication = rememberRipple( color = colorResource(R.color.color_system_label_default_light).copy(alpha = 0.16f), bounded = true),onClick = onClick - 먼저 아래 값들을 선언해 준다. 모두 pressed 상태를 감지하기 위한 요소이다.val interactionSource = rem..
- 보통 버튼이나 FAB 클릭하면 명암이 짙어지는 Ripple 효과가 발생하는 것을 볼 수 있다. - 이번엔 Text를 가진 상위 컴포저블로부터 onClick 이벤트를 받아 하위 Text의 굵기를 변경하는 작업을 진행했다. - 일단 아래 두 개 값이 pressed 상태를 경신하고 체크하는 기본 요소가 된다.val interactionSource = remember { MutableInteractionSource() }val isPressed by interactionSource.collectIsPressedAsState() - MutableInteractionSource : InteractionSource는 컴포넌트에서 발생하는 사용자 상호작용을 감지하는 채널로서 Pressed, Focused, Drag..