نظرة عامة على أنواع الموارد
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تصف كل صفحة في هذا القسم الاستخدام والتنسيق وبناء نوع معين من مورد التطبيق الذي يمكنك تقديمه في دليل موارد المشروع (res/
).
في ما يلي ملخّص موجز لكل صفحة:
- موارد الصور المتحركة
- تحديد الرسوم المتحركة مسبقًا:
يتم حفظ الصور المتحركة ما قبل سن المراهقة في res/anim/
ويمكن الوصول إليها من الصف R.anim
.
يتم حفظ الرسوم المتحركة في الإطارات في res/drawable/
ويمكن الوصول إليها من الفئة R.drawable
.
- مورد قائمة حالات الألوان
- حدِّد موردًا لونيًا يتغيّر استنادًا إلى حالة
View
.
تم حفظ التغييرات في res/color/
والوصول إليها من الصف R.color
.
- الموارد القابلة للرسم
- حدِّد رسومات مختلفة باستخدام الصور النقطية أو XML.
تم حفظ التغييرات في res/drawable/
والوصول إليها من الصف R.drawable
.
- مورد التنسيق
- حدِّد تنسيق واجهة مستخدم التطبيق.
تم حفظ التغييرات في res/layout/
والوصول إليها من الصف R.layout
.
- مرجع القائمة
- تحديد محتوى قوائم التطبيقات
تم حفظ التغييرات في res/menu/
والوصول إليها من الصف R.menu
.
- موارد السلاسل
- يمكنك تحديد السلاسل وصفائف السلاسل والجمع، وتضمين تنسيق السلسلة ونمطها.
تم حفظ التغييرات في res/values/
والوصول إليها من خلال الصفوف R.string
وR.array
وR.plurals
.
- مرجع النمط
- تحديد شكل عناصر واجهة المستخدم وتنسيقها
تم حفظ التغييرات في res/values/
والوصول إليها من الصف R.style
.
- موارد الخطوط
- تحديد مجموعات الخطوط وتضمين خطوط مخصّصة في ملف XML.
تم حفظ التغييرات في res/font/
والوصول إليها من الصف R.font
.
- المزيد من أنواع الموارد
- حدِّد القيم الأساسية الأخرى كموارد ثابتة، بما في ذلك ما يلي:
- بول
- مورد XML يتضمّن قيمة منطقية.
- اللون
- مورد XML الذي يتضمّن قيمة لون سداسية عشرية
- السمة
- مورد XML يحمل قيمة سمة مع وحدة قياس.
- الإندونيسية
- مورد XML الذي يوفر معرّفًا فريدًا لموارد التطبيق
ومكوّناته.
- عدد صحيح
- مورد XML الذي يتضمّن قيمة عدد صحيح
- صفيف صحيح
- مورد XML الذي يوفّر مجموعة من الأعداد الصحيحة
- المصفوفة المكتوبة
- مورد XML يوفر سمة
TypedArray
يمكنك استخدامها
لمصفوفة من العناصر القابلة للرسم.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Resource types overview\n\nEach page in this section describes the usage, format, and syntax for a certain type\nof [app resource](/guide/topics/resources/providing-resources)\nthat you can provide in your project resources directory (`res/`).\n\nHere's a brief summary of each page:\n\n[Animation resources](/guide/topics/resources/animation-resource)\n: Define pre-determined animations. \n\n Tween animations are saved in `res/anim/` and accessed from the `R.anim` class. \n\n Frame animations are saved in `res/drawable/` and accessed from the `R.drawable` class.\n\n[Color state list resource](/guide/topics/resources/color-list-resource)\n: Define a color resource that changes based on the `View` state. \n\n Saved in `res/color/` and accessed from the `R.color` class.\n\n[Drawable resources](/guide/topics/resources/drawable-resource)\n: Define various graphics with bitmaps or XML. \n\n Saved in `res/drawable/` and accessed from the `R.drawable` class.\n\n[Layout resource](/guide/topics/resources/layout-resource)\n: Define the layout for your application UI. \n\n Saved in `res/layout/` and accessed from the `R.layout` class.\n\n[Menu resource](/guide/topics/resources/menu-resource)\n: Define the contents of your application menus. \n\n Saved in `res/menu/` and accessed from the `R.menu` class.\n\n[String resources](/guide/topics/resources/string-resource)\n: Define strings, string arrays, and plurals and include string formatting and styling. \n\n Saved in `res/values/` and accessed from the `R.string`, `R.array`,\n and `R.plurals` classes.\n\n[Style resource](/guide/topics/resources/style-resource)\n: Define the look and format for UI elements. \n\n Saved in `res/values/` and accessed from the `R.style` class.\n\n[Font resources](/guide/topics/resources/font-resource)\n: Define font families and include custom fonts in XML. \n\n Saved in `res/font/` and accessed from the `R.font` class.\n\n[More resource types](/guide/topics/resources/more-resources)\n: Define other primitive values as static resources, including the following:\n\n [Bool](/guide/topics/resources/more-resources#Bool)\n : XML resource that carries a boolean value.\n\n [Color](/guide/topics/resources/more-resources#Color)\n : XML resource that carries a hexadecimal color value.\n\n [Dimension](/guide/topics/resources/more-resources#Dimension)\n : XML resource that carries a dimension value with a unit of measure.\n\n [ID](/guide/topics/resources/more-resources#Id)\n : XML resource that provides a unique identifier for application resources and\n components.\n\n [Integer](/guide/topics/resources/more-resources#Integer)\n : XML resource that carries an integer value.\n\n [Integer array](/guide/topics/resources/more-resources#IntegerArray)\n : XML resource that provides an array of integers.\n\n [Typed array](/guide/topics/resources/more-resources#TypedArray)\n : XML resource that provides a [TypedArray](/reference/android/content/res/TypedArray), which you can use\n for an array of drawables."]]