Compose로 XML 테마 이전
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
기존 앱에 Compose를 도입할 경우 Compose 화면에 MaterialTheme
을 사용하려면 XML의 테마를 이전해야 합니다. 그러면 앱의 테마 설정은 뷰 기반 테마와 Compose 테마라는 두 가지 정보 소스를 갖습니다. 스타일 설정 변경은 여러 위치에서 이루어져야 합니다. 앱이 Compose로 완전히 이전되면 XML 테마를 삭제할 수 있습니다.
XML 테마를 Compose로 이전하려면 Material 테마 빌더를 사용하여 XML 테마에서 Compose의 Material 3로 이전하세요. XML 테마의 기본 색상 및 보조 색상과 같은 기존 색상 역할을 사용하여 Material Theme Builder에 전달할 수 있습니다. 이렇게 하면 Compose에서 완전한 Material 3 테마가 생성되고 앱에서 사용할 수 있는 다운로드 가능한 색상 및 테마 파일이 제공됩니다.
Material Theme Builder는 앱의 MaterialTheme
와 밝은 색상 및 어두운 색상 구성표를 생성합니다. 앱에서 맞춤 도형이나 서체를 사용하는 경우 각각 Shape
와 Typography
를 정의하여 맞춤 도형과 서체를 이전하세요. 정의한 후 MaterialTheme
에 해당 정보를 제공합니다. 자세한 내용은 모양 및 서체를 참고하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["When you introduce Compose in an existing app, you need to migrate your themes in XML to use `MaterialTheme` for Compose screens. This means your app's theming will have two sources of truth: the View-based theme and the Compose theme. Any changes to your styling need to be made in multiple places. Once your app is fully migrated to Compose, you can remove your XML theming.\n| **Note:** For non-Material design systems, see [Custom design systems in Compose](/develop/ui/compose/designsystems/custom).\n\nTo migrate your XML themes to Compose, use the [Material Theme Builder](https://m3.material.io/theme-builder) to migrate from an XML theme to [Material 3](/develop/ui/compose/designsystems/material3#material-theming) in Compose. You can use your existing color roles, such as primary and secondary colors from your XML theme, and pass them to the Material Theme Builder. This creates a fully Material 3 theme in Compose and provides downloadable color and theme files to use in your app.\n\nMaterial Theme Builder generates a `MaterialTheme` and light and dark color schemes for your app. If your app uses custom shapes or typography, migrate your custom shapes and typography by defining a `Shape` and `Typography`, respectively. Once defined, provide that information to your `MaterialTheme`. See [shapes](/develop/ui/compose/designsystems/material3#shapes) and [typography](/develop/ui/compose/designsystems/material3#typography) to learn more.\n| **Note:** If you are not using Material 3, see [Material Design 2 in Compose](/develop/ui/compose/designsystems/material) to learn how to create a theme. See [Migrate from Material 2 to Material 3 in Compose](/develop/ui/compose/designsystems/material2-material3) when you are ready to migrate to Material 3."]]