프로젝트
GitHub에서 보기
mobnetic/compose-shared-element
소개
Flutter의 Hero 위젯에서 영감을 받은 Jetpack Compose SharedElement 전환 실험
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalcompose-shared-element
Note: This is not meant to be a maintained library.
Proof of concept exploration of how to implement SharedElement transition in Jetpack Compose.
Inspired by Flutter Hero widget.
Transition consists of following animations:
- Position
- Scale
- Crossfade (which makes it work on any kind of element, e.g.
Text)
UsersListScreen:![]() UserDetailScreen: ![]() |
Slowed down transition animation:![]() |
|---|
Usage
- Define
FROMandTOelements with shared tag
@Composable
fun ScreenA() {
// ...
SharedElement(tag = "tag", type = SharedElementType.FROM) {
Image(image, Modifier.preferredSize(48.dp))
}
// ...
}
@Composable
fun ScreenB() {
// ...
SharedElement(tag = "tag", type = SharedElementType.TO) {
Image(image, Modifier.preferredSize(200.dp))
}
// ...
}
- Make
SharedElementsRoota common parent ofScreenAandScreenB. It doesn't have to be their direct parent.
SharedElementsRoot {
// change between ScreenA and ScreenB
}
- Transition starts automatically when second
SharedElementis detected
Sample
See sample usage with UsersListScreen and UserDetailsScreen here.
Issues
Considering the experimental state of this library and state of Jetpack Compose itself there are some issues described here.
관련 프로젝트 살펴보기
불러오는 중…


