└ Compose/ComposeFest2021

[Compose Codelab/ComposeFest2021 - 3-1 week] Jetpack compose theming 리뷰

olivia 2021. 11. 24. 09:57

진행 내용 

3-1 week 코드랩 : Jetpack Compose theming

 

Jetpack Compose theming  |  Android Developers

In this codelab, you’ll learn how to create a theme for your app, style individual components and support light/dark themes.

developer.android.com

 

리뷰 내용

1. running time 에서 light/dark theme 을 확인하는 법

val isLightTheme = MaterialTheme.colors.isLight

2. Multiple styles

AnnotatedString + SpanStyle 를 상용하여 여러 텍스트 스타일을 적용할 수 있음

val text = buildAnnotatedString {
  append("This is some unstyled text\n")
  withStyle(SpanStyle(color = Color.Red)) {
    append("Red text\n")
  }
  withStyle(SpanStyle(fontSize = 24.sp)) {
    append("Large text")
  }
}

3. Theme shapes 를 적용할 수 있는 영역

Surface, Modifier.clip, Modifier.background, Modifier.border etc.

 

androidx.compose.foundation  |  Android Developers

androidx.wear.compose.navigation

developer.android.com

참고 자료

전체 진행 내용 : https://sites.google.com/view/devfest-korea-2021/compose-codelab

 

Devfest Korea 2021 - Compose Codelab

🤔 Jetpack Compose를 배워야 하는지 고민이신가요?

sites.google.com

 

github : https://github.com/olivia-soy/ComposeFest2021