एक्सएमएल थीम को 'लिखें' विंडो में माइग्रेट करें
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
किसी मौजूदा ऐप्लिकेशन में Compose का इस्तेमाल करने के लिए, आपको अपनी थीम को XML से माइग्रेट करना होगा, ताकि Compose स्क्रीन के लिए MaterialTheme
का इस्तेमाल किया जा सके. इसका मतलब है कि आपके ऐप्लिकेशन की थीम के लिए, दो सोर्स ऑफ़ ट्रुथ होंगे: व्यू पर आधारित थीम और Compose थीम. स्टाइल में किए गए बदलावों को कई जगहों पर अपडेट करना होगा. ऐप्लिकेशन को पूरी तरह से Compose पर माइग्रेट करने के बाद, XML थीमिंग को हटाया जा सकता है.
अपनी एक्सएमएल थीम को Compose में माइग्रेट करने के लिए, Material Theme Builder का इस्तेमाल करें. इससे, एक्सएमएल थीम से Compose में Material 3 पर माइग्रेट किया जा सकता है. आपके पास अपनी मौजूदा कलर भूमिकाओं का इस्तेमाल करने का विकल्प होता है. जैसे, अपनी एक्सएमएल थीम से प्राइमरी और सेकंडरी कलर. साथ ही, उन्हें मटीरियल थीम बिल्डर को पास किया जा सकता है. इससे Compose में पूरी तरह से Material 3 थीम बन जाती है. साथ ही, आपके ऐप्लिकेशन में इस्तेमाल करने के लिए, रंग और थीम की डाउनलोड की जा सकने वाली फ़ाइलें मिलती हैं.
Material Theme Builder, आपके ऐप्लिकेशन के लिए MaterialTheme
और हल्के और गहरे रंग की कलर स्कीम जनरेट करता है. अगर आपका ऐप्लिकेशन कस्टम शेप या टाइपोग्राफ़ी का इस्तेमाल करता है, तो कस्टम शेप और टाइपोग्राफ़ी को माइग्रेट करें. इसके लिए, Shape
और Typography
को तय करें. तय करने के बाद, यह जानकारी अपने MaterialTheme
को दें. ज़्यादा जानने के लिए, आकार और टाइपोग्राफ़ी देखें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, 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."]]