أيقونات Material باستخدام Icon
استخدم مجموعة الأيقونات المضمنة في أي مكان
أيقونات Material باستخدام Icon درس مجاني في Jetpack Compose Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Jetpack Compose Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Meet the Icon Composable
For small symbols like a heart or a back arrow, Compose gives you Icon. It is lighter than Image and tints itself to your theme.
A Library of Icons
You get hundreds of ready-made symbols from Icons, the Material icon set. No drawing, no exporting, just reference one by name.
Icon(imageVector = Icons.Default.Favorite, contentDescription = "Like")imageVector Is the Symbol
Icon takes an imageVector, a vector graphic from the Material set. Because it is a vector, it stays crisp at any size.
Five Visual Styles
Each symbol comes in styles: Default, Outlined, Rounded, Sharp, and TwoTone. Pick the one that matches your app personality.
Icon(Icons.Outlined.Settings, contentDescription = "Settings")Extended Icon Pack
The base set is small to keep apps lean. Add the material-icons-extended dependency to unlock thousands more symbols.
Icons Tint Automatically
By default an Icon paints itself with the current content color from your theme, so it always looks consistent without you setting a color.
Override the Tint
Want a custom color? Pass a tint argument and the symbol repaints in exactly that shade.
Icon(Icons.Default.Star, contentDescription = null, tint = Color.Yellow)Sizing an Icon
Icons render at 24dp by default, the Material standard. Change it with a Modifier.size just like any other composable.
Icon(Icons.Default.Home, contentDescription = null, modifier = Modifier.size(32.dp))Describe It Too
Like Image, Icon needs a contentDescription. Describe its action, such as "Add to favorites", or pass null if a nearby label already explains it.
Icons Inside Buttons
Icons shine inside other composables. Dropping an Icon into an IconButton gives you a tappable, perfectly sized action.
IconButton(onClick = {}) { Icon(Icons.Default.Delete, "Delete") }Icon from a Drawable
You can also build an Icon from your own asset using painterResource instead of imageVector, keeping the same automatic tinting.
Quick Check
What is the default color an Icon uses when you do not set a tint?
Recap: Material Icons
You now use Icon for crisp vector symbols, choose a style, override the tint, and size with a modifier. Next: scaling images! 🎯
الأسئلة الشائعة
هل درس «أيقونات Material باستخدام Icon» مجاني؟
نعم — نص درس «أيقونات Material باستخدام Icon» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Jetpack Compose Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.
ماذا ستتعلم في «أيقونات Material باستخدام Icon»؟
استخدم مجموعة الأيقونات المضمنة في أي مكان تتمرن على Jetpack Compose Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Jetpack Compose Academy؟
لا تُشترط خبرة سابقة. Jetpack Compose Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «أيقونات Material باستخدام Icon»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Jetpack Compose Academy هذا؟
نعم. كل درس في Jetpack Compose Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- Composable الصورة
- أيقونات Material باستخدام Icon
- ContentScale والقص
- قصّ صورك وشكّلها