com.amap.api.navi

## 类 AMapHudView

- java.lang.Object
- - FrameLayout
  - - com.amap.api.navi.AMapHudView

- 所有已实现的接口:
    AMapNaviListener

      public class AMapHudView
      extends FrameLayout
      implements AMapNaviListener

  HUD（Head Up Display）界面，方便用户夜间行车，避免长时间将注意力放于手机屏幕上。仅支持设备全屏显示。

  当用户点击HUD界面，会出现HUD设置栏（包括：返回按钮和镜像按钮）。

  HUD (Head Up Display) interface, which facilitates nighttime driving for users and avoids prolonged attention on the mobile screen. Only supports full-screen display on devices.

  When users click on the HUD interface, the HUD settings bar will appear (including: back button and mirror button).

- - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `getHudMenuEnabled()` 返回 HUD设置栏是否显示 Returns whether the HUD settings bar is displayed.
    `int` | `getHudViewMode()` 返回HUD显示模式，目前有正常、镜像两种显示模式 Returns the HUD display mode, currently with normal and mirror display modes.
    `void` | `onCalculateRouteFailure(AMapCalcRouteResult routeResult)` 路线规划失败回调，包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算，具体算路结果可以通过`AMapCalcRouteResult`获取 Route planning failure callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc.
    `void` | `onCalculateRouteSuccess(AMapCalcRouteResult routeResult)` 路线规划成功回调，包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算，具体算路结果可以通过`AMapCalcRouteResult`获取 Route planning success callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc.
    `void` | `onCalculateRouteSuccess(int[] routeIds)` 算路成功回调 Route calculation success callback
    `void` | `onDestroy()` 销毁AMapHudView Destroy AMapHudView
    `void` | `onGetNavigationText(java.lang.String text)` 导航播报信息回调函数 Navigation broadcast information callback function.
    `void` | `onNaviRouteNotify(AMapNaviRouteNotifyData notifyData)` 导航过程中道路信息通知 Road information notification during navigation.
    `void` | `setHudMenuEnabled(java.lang.Boolean enabled)` HUD界面是否显示设置栏 Whether the HUD interface displays the settings bar.
    `void` | `setHudViewListener(AMapHudViewListener listener)` 设置AMapHudViewListener监听 Set AMapHudViewListener listener
    `void` | `setHudViewMode(int mode)` 设置HUD显示模式，目前仅支持设备全屏显示 Sets the HUD display mode, currently only supports full-screen display on devices.

    - ### 从类继承的方法 java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### 从接口继承的方法 com.amap.api.navi.AMapNaviListener

      `hideCross, hideLaneInfo, hideModeCross, notifyParallelRoad, onArriveDestination, onArrivedWayPoint, onCalculateRouteFailure, onEndEmulatorNavi, onGetNavigationText, onGpsOpenStatus, onGpsSignalWeak, onInitNaviFailure, onInitNaviSuccess, onLocationChange, onNaviInfoUpdate, onPlayRing, onReCalculateRouteForTrafficJam, onReCalculateRouteForYaw, onServiceAreaUpdate, onStartNavi, onTrafficStatusUpdate, OnUpdateTrafficFacility, OnUpdateTrafficFacility, showCross, showLaneInfo, showLaneInfo, showModeCross, updateAimlessModeCongestionInfo, updateCameraInfo, updateIntervalCameraInfo`

- - ### 方法详细资料

    - #### getHudViewMode

          public int getHudViewMode()

      返回HUD显示模式，目前有正常、镜像两种显示模式
      Returns the HUD display mode, currently with normal and mirror display modes.
      返回:
        1-表示正常模式，2-表示镜像模式。
        1 - represents normal mode, 2 - represents mirror mode.

    - #### setHudViewMode

          public void setHudViewMode(int mode)

      设置HUD显示模式，目前仅支持设备全屏显示
      Sets the HUD display mode, currently only supports full-screen display on devices.
      参数:
        `mode` - HUD显示模式，包括：`AMapNaviViewOptions.HUD_NORMAL_SHOW`（HUD正向显示）和`AMapNaviViewOptions.HUD_MIRROR_SHOW`（HUD镜像显示）。
        HUD display mode, including: `AMapNaviViewOptions.HUD_NORMAL_SHOW` (HUD forward display) and `AMapNaviViewOptions.HUD_MIRROR_SHOW` (HUD mirror display).

    - #### getHudMenuEnabled

          public boolean getHudMenuEnabled()

      返回 HUD设置栏是否显示
      Returns whether the HUD settings bar is displayed.
      返回:
        true-显示，false-不显示。
        true - display, false - not display.

    - #### setHudMenuEnabled

          public void setHudMenuEnabled(java.lang.Boolean enabled)

      HUD界面是否显示设置栏
      Whether the HUD interface displays the settings bar.

      设置栏包含返回按钮和镜像按钮。用户点击HUD界面，显示设置栏，5秒未有操作，自动隐藏。

      The settings bar contains a back button and a mirror button. When the user clicks the HUD interface, the settings bar is displayed, and it automatically hides after 5 seconds without operation.

      参数:
        `enabled` - true表示当用户点击屏幕时，会显示HUD设置栏，5秒未有操作，进行隐藏。
        false表示将不会显示用户的状态栏。
        true means that when the user clicks the screen, the HUD settings bar will be displayed, and it will be hidden after 5 seconds without operation.
        false means that the user's status bar will not be displayed.

    - #### onDestroy

          public final void onDestroy()

      销毁AMapHudView
      Destroy AMapHudView

    - #### setHudViewListener

          public void setHudViewListener(AMapHudViewListener listener)

      设置AMapHudViewListener监听
      Set AMapHudViewListener listener
      参数:
        `listener` - AMapHudViewListener监听
        AMapHudViewListener listener

    - #### onGetNavigationText

          public void onGetNavigationText(java.lang.String text)

      导航播报信息回调函数
      Navigation broadcast information callback function.
      指定者:
        `onGetNavigationText` 在接口中 `AMapNaviListener`
      参数:
        `text` - 播报文字。
        Broadcast text.
      从以下版本开始:
        5.3.0

    - #### onCalculateRouteSuccess

          public void onCalculateRouteSuccess(int[] routeIds)

      算路成功回调
      Route calculation success callback
      指定者:
        `onCalculateRouteSuccess` 在接口中 `AMapNaviListener`
      参数:
        `routeIds` - 路线id数组
        Route ID array
      从以下版本开始:
        5.2.0

    - #### onCalculateRouteSuccess

          public void onCalculateRouteSuccess(AMapCalcRouteResult routeResult)

      从接口复制的说明: `AMapNaviListener`
      路线规划成功回调，包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算，具体算路结果可以通过`AMapCalcRouteResult`获取
      Route planning success callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc. Specific route calculation results can be obtained through `AMapCalcRouteResult`.

      可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
      Route calculation error code, route type, and route ID can be obtained through CalcRouteResult

      指定者:
        `onCalculateRouteSuccess` 在接口中 `AMapNaviListener`
      参数:
        `routeResult` - `AMapCalcRouteResult`

    - #### onCalculateRouteFailure

          public void onCalculateRouteFailure(AMapCalcRouteResult routeResult)

      从接口复制的说明: `AMapNaviListener`
      路线规划失败回调，包括算路、导航中偏航、用户改变算路策略、行程点等触发的重算，具体算路结果可以通过`AMapCalcRouteResult`获取
      Route planning failure callback, including recalculations triggered by route calculation, yaw during navigation, user changing route strategy, waypoints, etc. Specific route calculation results can be obtained through `AMapCalcRouteResult`

      可以通过CalcRouteResult获取算路错误码、算路类型以及路线id
      Route calculation error code, route type, and route ID can be obtained through CalcRouteResult

      指定者:
        `onCalculateRouteFailure` 在接口中 `AMapNaviListener`
      参数:
        `routeResult` - `AMapCalcRouteResult`

    - #### onNaviRouteNotify

          public void onNaviRouteNotify(AMapNaviRouteNotifyData notifyData)

      从接口复制的说明: `AMapNaviListener`
      导航过程中道路信息通知
      Road information notification during navigation.

      注意：该接口仅驾车模式有效
      Note: This interface is only valid in driving mode

      导航过程中针对拥堵区域、限行区域、禁行区域、道路封闭等情况的躲避通知。
      Avoidance notifications for traffic jam areas, restricted areas, prohibited areas, road closures, etc. during navigation.
      通知和避让信息结果可以通过`AMapNaviRouteNotifyData`获取
      Notification and avoidance information results can be obtained through `AMapNaviRouteNotifyData`

      指定者:
        `onNaviRouteNotify` 在接口中 `AMapNaviListener`
      参数:
        `notifyData` - 通知和避让信息，详细信息请参考`AMapNaviRouteNotifyData`
        Notification and avoidance information, please refer to `AMapNaviRouteNotifyData` for detailed information