0Pricing
Jetpack Compose Academy · درس

ما الذي يستبدله Compose: وداعًا لـ XML

لماذا تتفوق واجهة المستخدم التصريحية على تضخيم View الإجرائي

ما الذي يستبدله Compose: وداعًا لـ XML درس مجاني في Jetpack Compose Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Jetpack Compose Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Meet Jetpack Compose

Jetpack Compose is Android's modern toolkit for building UI in pure Kotlin. No more XML layout files. You describe screens with simple functions. 🎉

The Old Way: XML Layouts

For years, Android UI lived in XML files. You wrote markup describing views, then inflated and wired them up in Kotlin code separately.

<LinearLayout android:orientation="vertical">
    <TextView android:text="Hello" />
</LinearLayout>

Two Files, One Screen

The painful part was the split: layout lived in XML, behavior in Kotlin. You kept them in sync by hand, and findViewById glued them together.

Imperative vs Declarative

Old views were imperative: you found a widget and mutated it step by step, like textView.text = name. You told the UI exactly how to change.

Describe, Don't Mutate

Compose is declarative: you describe what the screen should look like for the current data, and the framework figures out the changes for you.

Text("Hello, " + name)

UI as a Function of State

The core idea: UI is a function of state. Give Compose your data, it draws the screen. Change the data, it redraws what differs.

Goodbye findViewById

No more findViewById and no view binding boilerplate. You reference UI directly as Kotlin functions, so a whole class of null and id bugs disappears.

Less Code, One Language

Everything is Kotlin now. Layout, logic, and styling live together, so the same screen takes far fewer lines and stays in one place.

Recomposition Keeps UI Fresh

When your data changes, Compose runs recomposition: it re-invokes the affected functions and updates only the parts of the screen that actually changed.

Compose Is Google's Future

Compose is the recommended way to build Android UI today. New tutorials, libraries, and Google samples all assume it, so learning it sets you up well.

Same Power, Less Friction

You lose nothing: Compose still gives you Material Design, animations, and lists. It just removes the XML friction that slowed everyone down.

Quick Check

Let's lock in the big shift from the old Android UI model.

Recap: Why Compose

You saw why Compose wins: pure Kotlin, declarative UI, no XML, no findViewById. Describe the screen for your data and let recomposition keep it fresh.

الأسئلة الشائعة

هل درس «ما الذي يستبدله Compose: وداعًا لـ XML» مجاني؟

نعم — نص درس «ما الذي يستبدله Compose: وداعًا لـ XML» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Jetpack Compose Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.

ماذا ستتعلم في «ما الذي يستبدله Compose: وداعًا لـ XML»؟

لماذا تتفوق واجهة المستخدم التصريحية على تضخيم View الإجرائي تتمرن على Jetpack Compose Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Jetpack Compose Academy؟

لا تُشترط خبرة سابقة. Jetpack Compose Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «ما الذي يستبدله Compose: وداعًا لـ XML»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Jetpack Compose Academy هذا؟

نعم. كل درس في Jetpack Compose Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. ما الذي يستبدله Compose: وداعًا لـ XML
  2. إعداد Android Studio لـ Compose
  3. تشريح دالة @Composable
  4. تشغيل أول تطبيق على المحاكي
← العودة إلى Jetpack Compose Academy