Merge dashboard settings into the language branch with localized controls
This commit is contained in:
commit
49d3f92799
11 files changed
+117
-28
No files matched your search
@@ -55,6 +55,7 @@ object AirPlayPersistence {
|
||||
private const val KEY_MEDIA_BUFFER_MS = "media_buffer_ms"
|
||||
private const val KEY_CLUSTER_MAP = "cluster_map_enabled"
|
||||
private const val KEY_CLUSTER_MAP_SCALE = "cluster_map_scale_percent"
|
||||
private const val KEY_CLUSTER_CONTENT = "cluster_content"
|
||||
private const val KEY_CLUSTER_MARKER_X = "cluster_marker_horizontal_step"
|
||||
private const val KEY_CLUSTER_MARKER_Y = "cluster_marker_vertical_step"
|
||||
private const val KEY_WIDTH_PHYSICAL_MM = "display_width_physical_mm"
|
||||
@@ -421,6 +422,15 @@ object AirPlayPersistence {
|
||||
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putBoolean(KEY_CLUSTER_MAP, enabled).apply()
|
||||
}
|
||||
|
||||
fun loadClusterContent(context: Context): CarPlayClusterDisplay.Content =
|
||||
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getString(KEY_CLUSTER_CONTENT, null)
|
||||
?.let { name -> CarPlayClusterDisplay.Content.entries.firstOrNull { it.name == name } }
|
||||
?: CarPlayClusterDisplay.Content.MAP
|
||||
|
||||
fun saveClusterContent(context: Context, content: CarPlayClusterDisplay.Content) {
|
||||
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putString(KEY_CLUSTER_CONTENT, content.name).apply()
|
||||
}
|
||||
|
||||
fun loadClusterMapScalePercent(context: Context): Int = CarPlayClusterDisplay.STREAM_SCALE_PERCENT.let { default ->
|
||||
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getInt(KEY_CLUSTER_MAP_SCALE, default)
|
||||
.takeIf { it in CarPlayClusterDisplay.scalePresets } ?: default
|
||||
|
||||
@@ -708,8 +708,9 @@ class CarPlayHostActivity : ComponentActivity() {
|
||||
AirPlayPersistence.loadClusterMapScalePercent(this),
|
||||
AirPlayPersistence.loadClusterMarkerHorizontalStep(this),
|
||||
AirPlayPersistence.loadClusterMarkerVerticalStep(this),
|
||||
AirPlayPersistence.loadClusterContent(this),
|
||||
).also {
|
||||
appendLog("Cluster map: requesting ${it.widthPixels}x${it.heightPixels} on ${size.x}x${size.y} safeArea=${it.safeArea}")
|
||||
appendLog("Cluster map: requesting ${it.widthPixels}x${it.heightPixels} on ${size.x}x${size.y} safeArea=${it.safeArea} url=${it.initialUrl}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -336,21 +336,34 @@ class DiPlayActivity : ComponentActivity() {
|
||||
}
|
||||
} else {
|
||||
val sizes = CarPlayClusterDisplay.scalePresets
|
||||
choice(card, getString(R.string.cluster_map_size), listOf(getString(R.string.cluster_size_standard), getString(R.string.cluster_size_larger), getString(R.string.cluster_size_largest)),
|
||||
val contents = CarPlayClusterDisplay.Content.entries
|
||||
val content = AirPlayPersistence.loadClusterContent(this)
|
||||
choice(card, getString(R.string.dashboard_shows), listOf(
|
||||
getString(R.string.dashboard_content_map),
|
||||
getString(R.string.dashboard_content_turn_card),
|
||||
getString(R.string.dashboard_content_map_with_turn_card),
|
||||
), contents.indexOf(content)) {
|
||||
AirPlayPersistence.saveClusterContent(this, contents[it])
|
||||
render()
|
||||
}
|
||||
// Both contents share the same safe area and position controls.
|
||||
val turnCard = content == CarPlayClusterDisplay.Content.TURN_CARD
|
||||
choice(card, getString(if (turnCard) R.string.turn_card_size else R.string.cluster_map_size),
|
||||
listOf(getString(R.string.cluster_size_standard), getString(R.string.cluster_size_larger), getString(R.string.cluster_size_largest)),
|
||||
sizes.indexOf(AirPlayPersistence.loadClusterMapScalePercent(this)).coerceAtLeast(0)) {
|
||||
AirPlayPersistence.saveClusterMapScalePercent(this, sizes[it])
|
||||
}
|
||||
val across = CarPlayClusterDisplay.horizontalSteps.toList()
|
||||
choice(card, getString(R.string.car_marker_horizontal), across.map { markerStepLabel(it, getString(R.string.marker_left), getString(R.string.marker_right)) },
|
||||
choice(card, getString(if (turnCard) R.string.turn_card_horizontal else R.string.car_marker_horizontal), across.map { markerStepLabel(it, getString(R.string.marker_left), getString(R.string.marker_right)) },
|
||||
across.indexOf(AirPlayPersistence.loadClusterMarkerHorizontalStep(this)).coerceAtLeast(0)) {
|
||||
AirPlayPersistence.saveClusterMarkerHorizontalStep(this, across[it])
|
||||
}
|
||||
val upDown = CarPlayClusterDisplay.verticalSteps.toList()
|
||||
choice(card, getString(R.string.car_marker_vertical), upDown.map { markerStepLabel(it, getString(R.string.marker_up), getString(R.string.marker_down)) },
|
||||
choice(card, getString(if (turnCard) R.string.turn_card_vertical else R.string.car_marker_vertical), upDown.map { markerStepLabel(it, getString(R.string.marker_up), getString(R.string.marker_down)) },
|
||||
upDown.indexOf(AirPlayPersistence.loadClusterMarkerVerticalStep(this)).coerceAtLeast(0)) {
|
||||
AirPlayPersistence.saveClusterMarkerVerticalStep(this, upDown[it])
|
||||
}
|
||||
card.addView(button(getString(R.string.reset_car_marker_to_centre), false) {
|
||||
card.addView(button(getString(if (turnCard) R.string.reset_turn_card_to_centre else R.string.reset_car_marker_to_centre), false) {
|
||||
AirPlayPersistence.saveClusterMarkerHorizontalStep(this, 0)
|
||||
AirPlayPersistence.saveClusterMarkerVerticalStep(this, 0)
|
||||
render()
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<string name="carplay_control_running">التحكم في CarPlay قيد التشغيل</string>
|
||||
<string name="carplay_control_window_ended">انتهت نافذة التحكم في CarPlay</string>
|
||||
<string name="carplay_icon">أيقونة CarPlay</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">خريطة CarPlay على لوحة العدادات · تجريبية</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">خريطة CarPlay على لوحة العدادات · تجريبي</string>
|
||||
<string name="carplay_service_already_running">خدمة CarPlay قيد التشغيل بالفعل</string>
|
||||
<string name="carplay_session_already_running">جلسة CarPlay قيد التشغيل بالفعل</string>
|
||||
<string name="carplay_session_ended_reconnecting">انتهت جلسة CarPlay؛ إعادة الاتصال</string>
|
||||
@@ -144,7 +144,7 @@
|
||||
<string name="choose_where_to_save_your_report">اختر أين تحفظ تقريرك.\u0020</string>
|
||||
<string name="choose_your_iphone">اختر iPhone الخاص بك</string>
|
||||
<string name="close">إغلاق</string>
|
||||
<string name="cluster_map_size">حجم خريطة المجموعة</string>
|
||||
<string name="cluster_map_size">حجم خريطة لوحة العدادات</string>
|
||||
<string name="connect">اتصال</string>
|
||||
<string name="connect_phone">اتصال بالهاتف</string>
|
||||
<string name="connect_when_diplay_opens">الاتصال عند فتح DiPlay</string>
|
||||
@@ -237,7 +237,7 @@
|
||||
<string name="model">الطراز</string>
|
||||
<string name="music_buffer">ذاكرة الموسيقى</string>
|
||||
<string name="resolution_native">أصلي</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">الملاحة على HUD ولوحة العدادات</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">الملاحة على شاشة العرض الأمامية ولوحة العدادات</string>
|
||||
<string name="navigation_stream_type">نوع بث الملاحة</string>
|
||||
<string name="nearby_devices">الأجهزة القريبة</string>
|
||||
<string name="nearby_devices_connects_your_iphone_microphone_enables_sir">«الأجهزة القريبة» تربط iPhone. الميكروفون يمكّن Siri والمكالمات. تتطلب إصدارات Android الأقدم أيضًا الموقع للإعداد اللاسلكي. قد يطلب وضع USB اتصال VPN محلي.</string>
|
||||
@@ -332,7 +332,7 @@
|
||||
<string name="show_password">إظهار كلمة المرور</string>
|
||||
<string name="show_phone_navigation_arrows_distance_and_street_names_on">إظهار أسهم الملاحة والمسافة وأسماء الشوارع من الهاتف على شاشات BYD المدعومة. تختلف توافقية المركبة.</string>
|
||||
<string name="show_the_side_map_only_when_its_card_is_open_and_switch_to">إظهار الخريطة الجانبية فقط عند فتح بطاقتها، والتبديل إلى الخريطة الكاملة في سمة الخريطة. تغييرات السمة والبطاقة تُبقي CarPlay متصلاً.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">يعرض خريطة iPhone على لوحة العدادات. اختر «صغير» أو «ملاحة بملء الشاشة» في قائمة المقود الخاصة باللوحة.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">يعرض خريطة iPhone على لوحة العدادات. اختر عرض الملاحة المصغّر أو الكامل من قائمة لوحة العدادات باستخدام أزرار المقود.</string>
|
||||
<string name="start_carplay_automatically_after_device_boot">بدء CarPlay تلقائياً بعد إقلاع الجهاز</string>
|
||||
<string name="starting">جارٍ البدء</string>
|
||||
<string name="starting_airplay_service">جارٍ بدء خدمة AirPlay</string>
|
||||
@@ -400,4 +400,12 @@
|
||||
<string name="hotspot_error_long_name">يجب ألا يتجاوز اسم نقطة الاتصال 32 بايت</string>
|
||||
<string name="hotspot_error_invalid_character">يحتوي الاسم أو كلمة المرور على محرف غير صالح</string>
|
||||
<string name="hotspot_error_password_length">يجب أن تتكون كلمة مرور نقطة الاتصال من 8 إلى 63 محرفًا</string>
|
||||
<string name="dashboard_shows">محتوى لوحة العدادات</string>
|
||||
<string name="dashboard_content_map">الخريطة · الافتراضي</string>
|
||||
<string name="dashboard_content_turn_card">بطاقة الانعطاف</string>
|
||||
<string name="dashboard_content_map_with_turn_card">خريطة مع بطاقة الانعطاف</string>
|
||||
<string name="turn_card_size">حجم بطاقة الانعطاف</string>
|
||||
<string name="turn_card_horizontal">بطاقة الانعطاف · أفقيًا</string>
|
||||
<string name="turn_card_vertical">بطاقة الانعطاف · عموديًا</string>
|
||||
<string name="reset_turn_card_to_centre">إعادة بطاقة الانعطاف إلى الوسط</string>
|
||||
</resources>
|
||||
@@ -124,7 +124,7 @@
|
||||
<string name="carplay_control_running">Control de CarPlay en ejecución</string>
|
||||
<string name="carplay_control_window_ended">Ventana de control de CarPlay finalizada</string>
|
||||
<string name="carplay_icon">Icono de CarPlay</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">Mapa de CarPlay en el cuadro de instrumentos · experimental</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">Mapa de CarPlay en el panel de instrumentos · experimental</string>
|
||||
<string name="carplay_service_already_running">El servicio de CarPlay ya está en ejecución</string>
|
||||
<string name="carplay_session_already_running">La sesión de CarPlay ya está en ejecución</string>
|
||||
<string name="carplay_session_ended_reconnecting">Sesión de CarPlay finalizada; reconectando</string>
|
||||
@@ -144,7 +144,7 @@
|
||||
<string name="choose_where_to_save_your_report">Elige dónde guardar tu informe.\u0020</string>
|
||||
<string name="choose_your_iphone">Elige tu iPhone</string>
|
||||
<string name="close">Cerrar</string>
|
||||
<string name="cluster_map_size">Tamaño del mapa del cuadro</string>
|
||||
<string name="cluster_map_size">Tamaño del mapa del panel de instrumentos</string>
|
||||
<string name="connect">Conectar</string>
|
||||
<string name="connect_phone">Conectar teléfono</string>
|
||||
<string name="connect_when_diplay_opens">Conectar al abrir DiPlay</string>
|
||||
@@ -237,7 +237,7 @@
|
||||
<string name="model">Modelo</string>
|
||||
<string name="music_buffer">Búfer de música</string>
|
||||
<string name="resolution_native">Nativa</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">Navegación en HUD y cuadro de instrumentos</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">Navegación en HUD y panel de instrumentos</string>
|
||||
<string name="navigation_stream_type">Tipo de flujo de navegación</string>
|
||||
<string name="nearby_devices">Dispositivos cercanos</string>
|
||||
<string name="nearby_devices_connects_your_iphone_microphone_enables_sir">«Dispositivos cercanos» conecta tu iPhone. El micrófono activa Siri y las llamadas. Las versiones antiguas de Android también requieren Ubicación para la configuración inalámbrica. El modo USB puede pedir una conexión VPN local.</string>
|
||||
@@ -332,7 +332,7 @@
|
||||
<string name="show_password">Mostrar contraseña</string>
|
||||
<string name="show_phone_navigation_arrows_distance_and_street_names_on">Muestra las flechas de navegación, la distancia y los nombres de calles del teléfono en pantallas BYD compatibles. La compatibilidad varía según el vehículo.</string>
|
||||
<string name="show_the_side_map_only_when_its_card_is_open_and_switch_to">Muestra el mapa lateral solo cuando su tarjeta está abierta y cambia al mapa completo en el tema del mapa. Los cambios de tema y tarjeta mantienen CarPlay conectado.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">Muestra el mapa del iPhone en el cuadro de instrumentos. Elige «Pequeño» o «Navegación a pantalla completa» en el menú del volante del cuadro.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">Muestra el mapa del iPhone en el panel de instrumentos. Selecciona navegación en pantalla pequeña o completa en el menú del panel mediante los controles del volante.</string>
|
||||
<string name="start_carplay_automatically_after_device_boot">Iniciar CarPlay automáticamente tras el arranque del dispositivo</string>
|
||||
<string name="starting">Iniciando</string>
|
||||
<string name="starting_airplay_service">Iniciando el servicio de AirPlay</string>
|
||||
@@ -400,4 +400,12 @@
|
||||
<string name="hotspot_error_long_name">El nombre del punto de acceso no debe superar los 32 bytes</string>
|
||||
<string name="hotspot_error_invalid_character">El nombre o la contraseña contiene un carácter no válido</string>
|
||||
<string name="hotspot_error_password_length">La contraseña del punto de acceso debe tener entre 8 y 63 caracteres</string>
|
||||
<string name="dashboard_shows">Contenido del panel de instrumentos</string>
|
||||
<string name="dashboard_content_map">Mapa · predeterminado</string>
|
||||
<string name="dashboard_content_turn_card">Tarjeta de giro</string>
|
||||
<string name="dashboard_content_map_with_turn_card">Mapa con tarjeta de giro</string>
|
||||
<string name="turn_card_size">Tamaño de la tarjeta de giro</string>
|
||||
<string name="turn_card_horizontal">Tarjeta de giro · horizontal</string>
|
||||
<string name="turn_card_vertical">Tarjeta de giro · vertical</string>
|
||||
<string name="reset_turn_card_to_centre">Centrar la tarjeta de giro</string>
|
||||
</resources>
|
||||
@@ -124,7 +124,7 @@
|
||||
<string name="carplay_control_running">Управление CarPlay работает</string>
|
||||
<string name="carplay_control_window_ended">Окно управления CarPlay завершено</string>
|
||||
<string name="carplay_icon">Значок CarPlay</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">Карта CarPlay на комбинации приборов · экспериментально</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">Карта CarPlay на приборной панели · экспериментально</string>
|
||||
<string name="carplay_service_already_running">Служба CarPlay уже работает</string>
|
||||
<string name="carplay_session_already_running">Сеанс CarPlay уже работает</string>
|
||||
<string name="carplay_session_ended_reconnecting">Сеанс CarPlay завершён; переподключение</string>
|
||||
@@ -144,7 +144,7 @@
|
||||
<string name="choose_where_to_save_your_report">Выберите, куда сохранить отчёт.\u0020</string>
|
||||
<string name="choose_your_iphone">Выберите свой iPhone</string>
|
||||
<string name="close">Закрыть</string>
|
||||
<string name="cluster_map_size">Размер карты комбинации</string>
|
||||
<string name="cluster_map_size">Размер карты на приборной панели</string>
|
||||
<string name="connect">Подключить</string>
|
||||
<string name="connect_phone">Подключить телефон</string>
|
||||
<string name="connect_when_diplay_opens">Подключать при открытии DiPlay</string>
|
||||
@@ -237,7 +237,7 @@
|
||||
<string name="model">Модель</string>
|
||||
<string name="music_buffer">Буфер музыки</string>
|
||||
<string name="resolution_native">Нативное</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">Навигация на HUD и комбинации приборов</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">Навигация на HUD и приборной панели</string>
|
||||
<string name="navigation_stream_type">Тип потока навигации</string>
|
||||
<string name="nearby_devices">Рядом находящиеся устройства</string>
|
||||
<string name="nearby_devices_connects_your_iphone_microphone_enables_sir">«Рядом находящиеся устройства» связывают iPhone. Микрофон нужен для Siri и звонков. Старые версии Android также требуют местоположение для беспроводной настройки. Режим USB может запросить локальное VPN-подключение.</string>
|
||||
@@ -332,7 +332,7 @@
|
||||
<string name="show_password">Показать пароль</string>
|
||||
<string name="show_phone_navigation_arrows_distance_and_street_names_on">Показывает стрелки навигации, расстояние и названия улиц с телефона на поддерживаемых дисплеях BYD. Совместимость зависит от автомобиля.</string>
|
||||
<string name="show_the_side_map_only_when_its_card_is_open_and_switch_to">Показывать боковую карту только когда её карточка открыта, а для полной карты переключаться в теме карты. Изменения темы и карточек сохраняют подключение CarPlay.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">Показывает карту iPhone на комбинации приборов. Выберите «Маленькая» или «Навигация на весь экран» в меню руля комбинации.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">Показывает карту iPhone на приборной панели. В меню приборной панели, управляемом с руля, выберите навигацию на малом или полном экране.</string>
|
||||
<string name="start_carplay_automatically_after_device_boot">Запускать CarPlay автоматически после загрузки устройства</string>
|
||||
<string name="starting">Запуск</string>
|
||||
<string name="starting_airplay_service">Запуск службы AirPlay</string>
|
||||
@@ -400,4 +400,12 @@
|
||||
<string name="hotspot_error_long_name">Имя точки доступа не должно превышать 32 байта</string>
|
||||
<string name="hotspot_error_invalid_character">Имя или пароль содержит недопустимый символ</string>
|
||||
<string name="hotspot_error_password_length">Пароль точки доступа должен содержать от 8 до 63 символов</string>
|
||||
<string name="dashboard_shows">Содержимое приборной панели</string>
|
||||
<string name="dashboard_content_map">Карта · по умолчанию</string>
|
||||
<string name="dashboard_content_turn_card">Карточка поворота</string>
|
||||
<string name="dashboard_content_map_with_turn_card">Карта с карточкой поворота</string>
|
||||
<string name="turn_card_size">Размер карточки поворота</string>
|
||||
<string name="turn_card_horizontal">Карточка поворота · по горизонтали</string>
|
||||
<string name="turn_card_vertical">Карточка поворота · по вертикали</string>
|
||||
<string name="reset_turn_card_to_centre">Вернуть карточку поворота в центр</string>
|
||||
</resources>
|
||||
@@ -120,7 +120,7 @@
|
||||
<string name="carplay_control_running">CarPlay 控制通道运行中</string>
|
||||
<string name="carplay_control_window_ended">CarPlay 控制会话已结束</string>
|
||||
<string name="carplay_icon">CarPlay 图标</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">仪表盘显示 CarPlay 地图 · 实验性</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">仪表盘上的CarPlay地图 · 实验性</string>
|
||||
<string name="carplay_service_already_running">CarPlay 服务已在运行</string>
|
||||
<string name="carplay_session_already_running">CarPlay 会话已在运行</string>
|
||||
<string name="carplay_session_ended_reconnecting">CarPlay 会话已结束;正在重新连接</string>
|
||||
@@ -140,7 +140,7 @@
|
||||
<string name="choose_where_to_save_your_report">选择报告的保存位置。</string>
|
||||
<string name="choose_your_iphone">选择 iPhone</string>
|
||||
<string name="close">关闭</string>
|
||||
<string name="cluster_map_size">仪表盘地图尺寸</string>
|
||||
<string name="cluster_map_size">仪表盘地图大小</string>
|
||||
<string name="common_cancel">取消</string>
|
||||
<string name="connect">连接</string>
|
||||
<string name="connect_phone">连接手机</string>
|
||||
@@ -242,7 +242,7 @@
|
||||
<string name="model">型号</string>
|
||||
<string name="music_buffer">音乐缓冲</string>
|
||||
<string name="resolution_native">原生</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">在 HUD 和仪表盘显示导航</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">HUD和仪表盘导航</string>
|
||||
<string name="navigation_stream_type">导航音频流类型</string>
|
||||
<string name="nearby_devices">附近的设备</string>
|
||||
<string name="nearby_devices_connects_your_iphone_microphone_enables_sir">“附近的设备”权限用于连接 iPhone;麦克风权限用于 Siri 和通话。较旧的 Android 版本还需要位置权限来设置无线连接。USB 模式可能会请求建立本地 VPN 连接。</string>
|
||||
@@ -341,7 +341,7 @@
|
||||
<string name="show_password">显示密码</string>
|
||||
<string name="show_phone_navigation_arrows_distance_and_street_names_on">在支持的比亚迪显示屏上显示手机导航箭头、距离和道路名称。不同车型的兼容性有所差异。</string>
|
||||
<string name="show_the_side_map_only_when_its_card_is_open_and_switch_to">仅在地图卡片展开时显示侧方地图,并在“地图主题”中切换为完整地图。更改主题或卡片不会中断 CarPlay 连接。</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">在仪表盘上显示 iPhone 的地图。可在方向盘菜单中选择“小”或“全屏导航”。</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">在仪表盘上显示iPhone地图。通过方向盘操作仪表盘菜单,选择小屏导航或全屏导航。</string>
|
||||
<string name="start_carplay_automatically_after_device_boot">设备启动后自动启动 CarPlay</string>
|
||||
<string name="starting">正在启动</string>
|
||||
<string name="starting_airplay_service">正在启动 AirPlay 服务</string>
|
||||
@@ -411,4 +411,12 @@
|
||||
<string name="hotspot_error_long_name">热点名称不能超过32字节</string>
|
||||
<string name="hotspot_error_invalid_character">名称或密码包含无效字符</string>
|
||||
<string name="hotspot_error_password_length">热点密码长度必须为8至63个字符</string>
|
||||
<string name="dashboard_shows">仪表盘显示内容</string>
|
||||
<string name="dashboard_content_map">地图 · 默认</string>
|
||||
<string name="dashboard_content_turn_card">转向提示卡</string>
|
||||
<string name="dashboard_content_map_with_turn_card">地图和转向提示卡</string>
|
||||
<string name="turn_card_size">转向提示卡大小</string>
|
||||
<string name="turn_card_horizontal">转向提示卡 · 水平位置</string>
|
||||
<string name="turn_card_vertical">转向提示卡 · 垂直位置</string>
|
||||
<string name="reset_turn_card_to_centre">将转向提示卡重置到中央</string>
|
||||
</resources>
|
||||
@@ -126,7 +126,7 @@
|
||||
<string name="carplay_control_running">CarPlay control running</string>
|
||||
<string name="carplay_control_window_ended">CarPlay control window ended</string>
|
||||
<string name="carplay_icon">CarPlay icon</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">CarPlay map on instrument cluster · experimental</string>
|
||||
<string name="carplay_map_on_instrument_cluster_experimental">CarPlay map on dashboard · experimental</string>
|
||||
<string name="carplay_service_already_running">CarPlay service already running</string>
|
||||
<string name="carplay_session_already_running">CarPlay session already running</string>
|
||||
<string name="carplay_session_ended_reconnecting">CarPlay session ended; reconnecting</string>
|
||||
@@ -146,7 +146,7 @@
|
||||
<string name="choose_where_to_save_your_report">Choose where to save your report.\u0020</string>
|
||||
<string name="choose_your_iphone">Choose your iPhone</string>
|
||||
<string name="close">Close</string>
|
||||
<string name="cluster_map_size">Cluster map size</string>
|
||||
<string name="cluster_map_size">Dashboard map size</string>
|
||||
<string name="connect">Connect</string>
|
||||
<string name="connect_phone">Connect phone</string>
|
||||
<string name="connect_when_diplay_opens">Connect when DiPlay opens</string>
|
||||
@@ -242,7 +242,7 @@
|
||||
<string name="model">Model</string>
|
||||
<string name="music_buffer">Music buffer</string>
|
||||
<string name="resolution_native">Native</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">Navigation on HUD and instrument cluster</string>
|
||||
<string name="navigation_on_hud_and_instrument_cluster">Navigation on HUD and dashboard</string>
|
||||
<string name="navigation_stream_type">Navigation stream type</string>
|
||||
<string name="nearby_devices">Nearby devices</string>
|
||||
<string name="nearby_devices_connects_your_iphone_microphone_enables_sir">Nearby devices connects your iPhone. Microphone enables Siri and calls. Older Android versions also require Location for wireless setup. USB mode may ask for a local VPN connection.</string>
|
||||
@@ -341,7 +341,7 @@
|
||||
<string name="show_password">Show password</string>
|
||||
<string name="show_phone_navigation_arrows_distance_and_street_names_on">Show phone navigation arrows, distance and street names on supported BYD displays. Vehicle compatibility varies.</string>
|
||||
<string name="show_the_side_map_only_when_its_card_is_open_and_switch_to">Show the side map only when its card is open, and switch to the full map in Map theme. Theme and card changes keep CarPlay connected.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">Shows the iPhone\'s cluster map on the instrument cluster. Choose Small or Full screen navi in the cluster\'s steering-wheel menu.</string>
|
||||
<string name="shows_the_iphone_s_cluster_map_on_the_instrument_cluster_c">Shows the iPhone\'s map on the dashboard. Choose Small or Full screen navi in the dashboard\'s steering-wheel menu.</string>
|
||||
<string name="start_carplay_automatically_after_device_boot">Start CarPlay automatically after device boot</string>
|
||||
<string name="starting">Starting</string>
|
||||
<string name="starting_airplay_service">Starting AirPlay service</string>
|
||||
@@ -411,4 +411,12 @@
|
||||
<string name="hotspot_error_long_name">The hotspot name must be at most 32 bytes</string>
|
||||
<string name="hotspot_error_invalid_character">The name or password contains an invalid character</string>
|
||||
<string name="hotspot_error_password_length">The hotspot password must be 8–63 characters</string>
|
||||
<string name="dashboard_shows">Dashboard shows</string>
|
||||
<string name="dashboard_content_map">Map · default</string>
|
||||
<string name="dashboard_content_turn_card">Turn card</string>
|
||||
<string name="dashboard_content_map_with_turn_card">Map with turn card</string>
|
||||
<string name="turn_card_size">Turn card size</string>
|
||||
<string name="turn_card_horizontal">Turn card · horizontal</string>
|
||||
<string name="turn_card_vertical">Turn card · vertical</string>
|
||||
<string name="reset_turn_card_to_centre">Reset turn card to centre</string>
|
||||
</resources>
|
||||
@@ -18,11 +18,12 @@ DiPlay can ask the iPhone for CarPlay's second, instrument-cluster screen and sh
|
||||
|
||||
Validated on DiLink5.0 / Android12, firmware `BYD-AUTO/DiLink5.0/DiLink5.0:12/SKQ1.230128.001/eng.build.20251111.182747:user/release-keys`, with Apple Maps on iOS 27:
|
||||
|
||||
- Turn on "CarPlay map on instrument cluster" under BYD navigation. The switch appears only when a cluster projection display is visible to the app.
|
||||
- Turn on "CarPlay map on dashboard" under BYD navigation. The switch appears only when a cluster projection display is visible to the app.
|
||||
- In the cluster's own steering-wheel menu, choose "Full screen navi" or "Small screen navi". "Turn on by navi" shows the map only during stock BYD navigation, so it keeps showing the arrow output instead.
|
||||
- The cluster's speed readout stays visible. "Small screen navi" crops the same picture on the cluster side; Android does not report that crop.
|
||||
- The car marker is placed through CarPlay's safe area: the centre of the panel (x 35–64 %, y 16–75 %), measured with a calibration grid to be clear of BYD's own readouts in both Full and Small screen navi. "Car marker · horizontal" (Left 40 % … Right 40 %) and "Car marker · vertical" (Up 30 % … Down 30 %) move it from there in 10 % steps of the panel. Near a panel edge the safe area shrinks so the marker stays at its centre.
|
||||
- "Cluster map size" sets the stream size, which the cluster scales up to the panel: Standard (100 %, sharpest), Larger (83 %, 1600x600, default) or Largest (67 %). Apple Maps ignores the reported physical size on the cluster, so resolution is the only way to change the map's scale.
|
||||
- "Dashboard shows" picks which of the cluster contents the iPhone offers in `altScreenURLs` DiPlay asks for: Map (`maps:/car/instrumentcluster/map`, default), Turn card (`…/instructioncard`) or Map with turn card (`maps:/car/instrumentcluster`). On the tested car the turn card fit the Small screen navi window well and streamed only 0–5 kbit/s against 0.3–4 Mbit/s for the map. The iPhone lays out the map, the car marker and the turn card inside the same safe area, so the position settings below move whichever is shown; they are labelled "Car marker" or "Turn card" to match.
|
||||
- "Dashboard map size" (or "Turn card size") sets the stream size, which the cluster scales up to the panel: Standard (100 %, sharpest), Larger (83 %, 1600x600, default) or Largest (67 %). Apple Maps ignores the reported physical size on the cluster, so resolution is the only way to change the map's scale.
|
||||
|
||||
How it works: the iPhone lists the cluster content it offers in its `/info` request (`altScreenURLs`). DiPlay declares a second display of the cluster's size with no input devices and `initialURL=maps:/car/instrumentcluster/map`; without an initial URL the iPhone streams only a black frame. BYD exposes the cluster projection area as public presentation displays owned by `com.byd.containerservice`. The stock map's display (`fission_bg_XDJAScreenProjection`) is hidden from third-party apps, but its `shared_…_0` sibling is composited on top of it, so DiPlay shows a `Presentation` there.
|
||||
|
||||
|
||||
@@ -11,6 +11,17 @@ package com.shilapi.xcertplay.airplay
|
||||
object CarPlayClusterDisplay {
|
||||
const val MAP_URL = "maps:/car/instrumentcluster/map"
|
||||
|
||||
/**
|
||||
* What the dashboard shows: one of the cluster contents the iPhone lists in `altScreenURLs`.
|
||||
* On the tested car the turn card needed 0–5 kbit/s against 0.3–4 Mbit/s for the map, and
|
||||
* "instrumentcluster" drew the map with the turn card on it.
|
||||
*/
|
||||
enum class Content(val url: String) {
|
||||
MAP(MAP_URL),
|
||||
TURN_CARD("maps:/car/instrumentcluster/instructioncard"),
|
||||
INSTRUMENTS("maps:/car/instrumentcluster"),
|
||||
}
|
||||
|
||||
/**
|
||||
* Where the car marker goes, as percent of the panel (left, top, right, bottom). Measured on a
|
||||
* DiLink 5.0 cluster with a calibration grid. In "Full screen navi" BYD draws a status row,
|
||||
@@ -51,6 +62,7 @@ object CarPlayClusterDisplay {
|
||||
scalePercent: Int = STREAM_SCALE_PERCENT,
|
||||
horizontalStep: Int = 0,
|
||||
verticalStep: Int = 0,
|
||||
content: Content = Content.MAP,
|
||||
): AirPlayDisplayConfig {
|
||||
// Height rounds to a multiple of 8 and width follows it, so the panel's aspect is kept
|
||||
// (83 % of 1920x720 gives exactly 1600x600). The cluster scales the stream to the panel.
|
||||
@@ -65,7 +77,7 @@ object CarPlayClusterDisplay {
|
||||
fps = FPS,
|
||||
primaryInputDevice = 0,
|
||||
features = 0,
|
||||
initialUrl = MAP_URL,
|
||||
initialUrl = content.url,
|
||||
safeArea = safeArea(width, height, horizontalStep, verticalStep),
|
||||
safeAreaDrawOutside = true,
|
||||
)
|
||||
|
||||
@@ -46,6 +46,18 @@ class CarPlayClusterDisplayTest {
|
||||
assertEquals(0x0A, (displays[0] as Map<*, *>)["features"])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theDashboardCanAskForTheTurnCardInstead() {
|
||||
val card = CarPlayClusterDisplay.config(1920, 720, content = CarPlayClusterDisplay.Content.TURN_CARD)
|
||||
|
||||
assertEquals("maps:/car/instrumentcluster/instructioncard", card.initialUrl)
|
||||
// The three contents the iPhone lists in altScreenURLs.
|
||||
assertEquals(
|
||||
listOf("maps:/car/instrumentcluster/map", "maps:/car/instrumentcluster/instructioncard", "maps:/car/instrumentcluster"),
|
||||
CarPlayClusterDisplay.Content.entries.map { it.url },
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun scaledStreamsKeepThePanelAspect() {
|
||||
val sizes = (CarPlayClusterDisplay.scalePresets + 50).map {
|
||||
|
||||
Reference in new issue
Block a user