2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
헤드업 알림
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
알림은 Android에서 사용자에게 업데이트, 알림, 기타 시기적절한 정보를 제공하기 위해 앱 외부에 표시하는 메시지입니다. Android Automotive OS에서는 알림을 헤드업 알림(HUN)으로 표시하거나 알림 패널에 표시할 수 있습니다(또는 두 방법으로 모두 표시). 이 페이지에서는 HUN을 맞춤설정하는 방법을 설명합니다.

그림 1. 알림
아래 설명된 구성 값을 재정의하면 다음 두 가지 방법으로 HUN을 맞춤설정할 수 있습니다.
HUN을 맞춤설정할 때는 시스템 표시줄의 Z 순서에서 어떤 영향을 받는지 확인해야 합니다. 시스템 표시줄의 Z 순서가 10 이상이면 HUN의 상단에 나타납니다. 예를 들어 HUN이 화면 상단에 표시되고 상단 시스템 표시줄의 Z 순서가 10인 경우 상단 시스템 표시줄은 HUN 상단에 표시됩니다. 단, 애니메이션 도우미가 상단 시스템 표시줄 높이로 HUN의 최종 위치를 오프셋하도록 맞춤설정되는 경우는 예외로 합니다.
관련 문서
config_showHeadsUpNotificationOnBottom
HUN은 구성 값 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
인터페이스를 구현하는 경우 맞춤 애니메이터 도우미 클래스를 사용할 수 있습니다.
[...]
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);
}
}
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-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-07-27(UTC)"],[],[],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```"]]