I/O 24에서 Compose 변경점

Arakene·2024년 6월 16일

Shared element transitions

Modifier.sharedElement() and Modifier.sharedBounds() have been added to Compose. They allow you to create beautiful transitions between screens with finer control than the View system allowed. Wrap your AnimatedContent composables in SharedTransitionLayout and then add the Modifier.sharedElement() or Modifier.sharedBounds() onto the content that you’d like to share between screens. Compose will then find composables with matching keys and smoothly transition between them.

추후 직접 사용해보고 문서 추가 예정

Lazy list item animations

insert, remove, reorder 시 애니메이션 추가됨
Modifier.animateItem()만 붙이면 적용된다함
애니메이션 스펙을 전달함으로 커스텀 가능

Text

AnnotatedString.fromHtml() 익스텐션 사용

BasicTextField에 TextFieldState 추가

더 다양한 유저 경험을 제공할 수 있음 키보드 gifs등등
can be hoisted out of the component and updated asynchronously.

Note: Material TextField will be updated to use the new BasicTextField in a subsequent release, but if you’d like to try it out in your apps, see the documentation.

Contextual Flow Layouts

Performance improvements

Strong skipping mode

2.0.20 컴파일러 릴리즈에서 experimental -> production으로 변경되며 사용되는 것이 기본값으로 됨
해당 모드는 unstable paramters를 가진 컴포저블들이 스킵이 가능하도록 해줌
예시앱에서는 해당 모드 사용 시 home screen 리컴포지션 시간에서 20% 향상이 있다함

Stable APIs

We continue to stabilize experimental APIs and remove experimental annotations. Notable APIs for this release include Pager, AnchoredDraggable, SegmentedButton, SwipeToDismissBox, Slider, and more.

CameraX Compose

We are releasing a new Compose-specific CameraX artifact called camera-viewfinder-compose. In this first alpha release, you can use the new Viewfinder composable to display a camera preview on your screen that always shows the correct aspect ratio and rotation, whether you resize your window, unfold your device, or change the display or orientation. It also correctly handles camera and surface lifecycles, something that can be difficult when dealing with cameras. It also enables complex interactions in the camera coordinate system, making it easy for you to implement gestures such as tap-to-focus or pinch-to-zoom.

제일 많이 사용해본 jetpack 라이브러리 CameraX의 새로운 compose 타겟 라이브러리가 알파버전으로 나옴
나중에 베타버전까지 넘어오면 사용해볼 계획

profile
안녕하세요 삽질하는걸 좋아하는 4년차 안드로이드 개발자입니다.

0개의 댓글