اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
الإشعارات الفورية
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
الإشعار هو رسالة يعرضها نظام التشغيل Android خارج التطبيق لتقديم رسائل برمجية ورسائل تذكير ومعلومات أخرى في الوقت المناسب للمستخدمين. في نظام التشغيل Android Automotive، يمكن عرض
الإشعار إما كإشعار تنبيه (HUN) أو في
لوحة الإشعارات (أو في كليهما). توضّح هذه الصفحة كيفية تخصيص عناوين URL للنطاقات العالية النطاق.

الشكل 1: إشعار
من خلال إلغاء قيم الضبط الموضّحة أدناه، يمكنك تخصيص عناوين URL للنطاقات المستضافة في الخارج بطريقتَين:
عند تخصيص شاشة معلومات المستخدم، احرص على تحديد مدى تأثّرها بترتيب Z
لشريط النظام. إذا كان الترتيب على محور Z لشريط النظام هو 10 أو أعلى، سيظهر فوق
العناصر الظاهرة على سطح الشاشة. على سبيل المثال، إذا تم عرض HUN في أعلى الشاشة وكان ترتيب المستوى Z لشريط النظام العلوي هو 10، يتم عرض شريط النظام العلوي فوق HUN
ما لم يتم تخصيص مساعد الرسوم المتحركة HUN لتمويه الموضع النهائي ل
HUN حسب ارتفاع شريط النظام العلوي.
المستندات ذات الصلة
config_showHeadsUpNotificationOnBottom
يمكن عرض شاشة معلومات المستخدم في أعلى الشاشة أو أسفلها استنادًا
إلى قيمة الإعداد config_showHeadsUpNotificationOnBottom
.
يتم ضبط هذه القيمة تلقائيًا على false
، وهي تحدد الموضع النهائي للإشعار في أعلى الشاشة.

الشكل 2: HUN التلقائي
config_headsUpNotificationAnimationHelper
هناك طرق متعدّدة لكيفية ظهور الإشعار على الشاشة و
مغادرته الشاشة. يتم توفير مجموعة من فئات مساعدة المشغِّل التلقائية ويمكن
تبديلها من خلال إلغاء config_headsUpNotificationAnimationHelper
.
com.android.car.notification.headsup.animationhelper.CarHeadsUpNotificationTopAnimationHelper
تنشئ هذه السمة مؤثرًا مرئيًا لعنصر HUN أثناء انتقاله من الموضع الأولي إلى الموضع النهائي، ثم إلى موضع مرئي، ثم إلى موضع غير مرئي.

الشكل 3: أفضل مساعدة في مجال الرسوم المتحركة
com.android.car.notification.headsup.animationhelper.CarHeadsUpNotificationBottomAnimationHelper
تنشئ هذه السمة مؤثرًا مرئيًا لعنصر HUN أثناء انتقاله من الموضع الأولي إلى الموضع النهائي، ثم إلى موضع مرئي، ثم إلى موضع غير مرئي.

الشكل 4: أداة مساعدة للصور المتحركة في أسفل الشاشة
com.android.car.notification.headsup.animationhelper.CarHeadsUpNotificationRightAnimationHelper
تنشئ هذه السمة صورة متحركة لعنصر HUN لنقله من الموضع الأولي على يمين الشاشة إلى الموضع النهائي، ثم إلى موضع مرئي، ثم إلى موضع غير مرئي.
الشكل 5: أداة مساعدة للصور المتحركة على الجانب الأيمن
مساعد الرسوم المتحرّكة المخصّصة
إذا كان مطلوبًا إجراء تخصيص إضافي، يمكن إلغاء فئات HeadsUpNotificationAnimationHelper
مساعِد المشغِّل أو استخدام فئة مخصّصة لمساعد المشغِّل، شرط أن تنفِّذ فئة المساعدة واجهة HeadsUpNotificationAnimationHelper
كما هو موضّح في مقتطف الرمز البرمجي التالي:
[...]
public class SampleAnimationHelper implements
HeadsUpNotificationAnimationHelper {
@Override
public AnimatorSet getAnimateInAnimator(Context context, View view) {
return (AnimatorSet) AnimatorInflater.loadAnimator(
context, R.animator.heads_up_notification_transition_in);
}
@Override
public AnimatorSet getAnimateOutAnimator(Context context, View view) {
return (AnimatorSet) AnimatorInflater.loadAnimator(
context, R.animator.heads_up_notification_transition_out);
}
@Override
public void resetHUNPosition(View view) {
view.setY(-1 * view.getHeight());
view.setAlpha(0);
}
}
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ 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,["# Heads-up notifications\n\nA *notification* is a message that Android displays outside an app to provide\nupdates, reminders, and other timely information to users. In the Android Automotive OS, a\nnotification can be displayed either as a *heads-up notification (HUN)* or in the\nNotification panel (or in both). This page explains how to customize HUNs.\n\n**Figure 1.** Notification\n\nBy overriding the configuration values detailed below, you can customize HUNs in two ways:\n\n- Position\n- Animation\n\nWhen customizing a HUN, be sure to determine how it is affected by the Z-order\nof system bars. If the Z-order of a system bar is 10 or higher, it appears on top of\nthe HUNs. For example, if the HUN is displayed at the top of the screen and the top\nsystem bar has a Z-order of 10, the top system bar is displayed on top of the HUN\n*unless* the HUN animation helper is customized to offset the final position of\nthe HUN by the height of the top system bar.\n\nRelated documentation\n---------------------\n\n- To learn how and why to overlay resources, see\n [Overlays](/docs/core/architecture/rros)\n in Customizing System UI.\n\n- To learn more about notifications, see\n [Notifications on Android Automotive OS](https://developer.android.com/training/cars/notifications)\n on developer.android.com.\n\nconfig_showHeadsUpNotificationOnBottom\n--------------------------------------\n\nA HUN can be displayed either on the top or bottom of the screen based\non the configuration value `config_showHeadsUpNotificationOnBottom`.\nSet to `false` by default, this value sets the final position of the\nnotification at the *top* of the screen.\n\n**Figure 2.** Default HUN\n\nconfig_headsUpNotificationAnimationHelper\n-----------------------------------------\n\nThere are multiple ways of how the notification should appear on screen and\nleave the screen. A set of default animator helper classes are provided and can\nbe switched out by overriding `config_headsUpNotificationAnimationHelper`.\n\n#### com.android.car.notification.headsup.animationhelper.CarHeadsUpNotificationTopAnimationHelper\n\nAnimates the HUN to transition from the initial position, down to the final position,\nto visible, and then to invisible.\n\n**Figure 3.** Top Animation Helper\n\n#### com.android.car.notification.headsup.animationhelper.CarHeadsUpNotificationBottomAnimationHelper\n\nAnimates the HUN to transition from the initial position, to the final position,\nto visible, and then to invisible.\n\n**Figure 4.** Bottom Animation Helper\n\n#### com.android.car.notification.headsup.animationhelper.CarHeadsUpNotificationRightAnimationHelper\n\nAnimates the HUN to transition from the initial position left, to the\nfinal position, to visible, and then to invisible.\n\n|---|---|\n| | |\n\n**Figure 5.** Right Animation Helper\n\n#### Custom animation helper\n\nShould additional customization be required, the animator helper\nclasses can be overridden or a custom animator helper class can be used\nprovided the help class implements the `HeadsUpNotificationAnimationHelper`\ninterface as shown in this code snippet: \n\n```ini\n[...]\n\npublic class SampleAnimationHelper implements\n HeadsUpNotificationAnimationHelper {\n\n @Override\n public AnimatorSet getAnimateInAnimator(Context context, View view) {\n return (AnimatorSet) AnimatorInflater.loadAnimator(\n context, R.animator.heads_up_notification_transition_in);\n }\n\n @Override\n public AnimatorSet getAnimateOutAnimator(Context context, View view) {\n return (AnimatorSet) AnimatorInflater.loadAnimator(\n context, R.animator.heads_up_notification_transition_out);\n }\n\n @Override\n public void resetHUNPosition(View view) {\n view.setY(-1 * view.getHeight());\n view.setAlpha(0);\n }\n}\n```"]]