본 글은 개인적으로 Jetpack AndroidX Compose의 스터디한 내용을 정리하는 아카이브용입니다.
지극히 개인적인
의견입니다.
테스트 전제 조건
실험하는 소스 : https://github.com/Pluu/WebToon/compare/develop-compose
Jetpack Compose
1.0.0-alpha07 : https://developer.android.com/jetpack/androidx/versions/all-channel#november_11_2020
color.copy(alpha = AmbientContentAlpha.current)
material-components-android-compose-theme-adapter
accompanist
Lottie
@Composable
fun Loader() {
val animationSpec = remember { LottieAnimationSpec.RawRes(R.raw.loader) }
LottieAnimation(
animationSpec,
modifier = Modifier.preferredSize(100.dp)
)
}
dependencies {
implementation 'com.airbnb.android:lottie-compose:1.0.0-alpha02'
}
SwipeToRefresh
https://github.com/android/compose-samples/blob/main/JetNews/app/src/main/java/com/example/jetnews/ui/SwipeToRefresh.kt
사용 방법
SwipeToRefreshLayout(
refreshingState = loading,
onRefresh = onRefresh,
refreshIndicator = { ... },
content = content,
)
[Jetchat, Jetsurvey] Replace
Tags with FragmentContainerViews #161 https://github.com/android/compose-samples/issues/161
Advocate의 답변 : Since these are not AAC samples and the navigation solution for Compose is starting to take shape, I think we shouldn’t complicate the boilerplate any more and wait until we have an official integration.
공식 지원이 되기까지 기다려달라.
개인적인 형태는 alpha를 0
으로 적용
BackPressedDispatcherAmbient
https://github.com/android/compose-samples/blob/main/Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/BackHandler.kt
@Composable
fun ProvideDesignSystemColors(
colors: DesignSystemColors,
content: @Composable () -> Unit
) {
val colorPalette = remember { colors }
colorPalette.update(colors)
Providers(AmbientDesignSystemColors provides colorPalette, children = content)
}
https://adambennett.dev/2020/11/server-driven-theming-in-jetpack-compose/
Had a bit of a Friday afternoon hack today: adding animated keyboard (IME) support to Accompanist Insets for #JetpackCompose
This adds support for reacting to Android 10's `WindowInsetsAnimation`
https://twitter.com/chrisbanes/status/1327319154412707847
comments powered by Disqus
Subscribe to this blog via RSS.
LazyColumn/Row에서 동일한 Key를 사용하면 크래시가 발생하는 이유
Posted on 30 Nov 2024