Added pixel aspect ratio setting, gh action to build apk#621
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new setting, pixelAspectRatioE4, to configure and manage the pixel aspect ratio of the head unit screen. This setting is integrated across the application, including settings persistence, backup management, UI configuration, and the protocol buffer definition. The review feedback highlights a potential UI issue where entering 0 or negative values could lead to confusing display values, and suggests coercing these values to the default of 10000 (representing square pixels) within the settings dialog.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| items.add(SettingItem.SettingEntry( | ||
| stableId = "pixelAspectRatioE4", | ||
| nameResId = R.string.pixel_aspect_ratio, | ||
| value = (pendingPixelAspectRatioE4 ?: 10000).toString(), | ||
| onClick = { _ -> | ||
| showNumericInputDialog( | ||
| title = getString(R.string.enter_pixel_aspect_ratio_value), | ||
| message = null, | ||
| initialValue = pendingPixelAspectRatioE4 ?: 10000, | ||
| onConfirm = { newVal -> | ||
| pendingPixelAspectRatioE4 = newVal | ||
| checkChanges() | ||
| updateSettingsList() | ||
| } | ||
| ) | ||
| } | ||
| )) |
There was a problem hiding this comment.
If the user clears the input or enters 0 (which is the fallback for empty/invalid input in showNumericInputDialog), pendingPixelAspectRatioE4 will be set to 0. While HeadUnitScreenConfig internally treats 0 as 10000 (square pixels), the UI will confusingly display 0 in the settings list and pass 0 as the initial value when the dialog is opened again.
To improve consistency and prevent storing invalid 0 values in settings, we should coerce 0 or negative values to 10000 (the default for square pixels) both when displaying the value and when confirming the input dialog.
| items.add(SettingItem.SettingEntry( | |
| stableId = "pixelAspectRatioE4", | |
| nameResId = R.string.pixel_aspect_ratio, | |
| value = (pendingPixelAspectRatioE4 ?: 10000).toString(), | |
| onClick = { _ -> | |
| showNumericInputDialog( | |
| title = getString(R.string.enter_pixel_aspect_ratio_value), | |
| message = null, | |
| initialValue = pendingPixelAspectRatioE4 ?: 10000, | |
| onConfirm = { newVal -> | |
| pendingPixelAspectRatioE4 = newVal | |
| checkChanges() | |
| updateSettingsList() | |
| } | |
| ) | |
| } | |
| )) | |
| items.add(SettingItem.SettingEntry( | |
| stableId = "pixelAspectRatioE4", | |
| nameResId = R.string.pixel_aspect_ratio, | |
| value = if ((pendingPixelAspectRatioE4 ?: 10000) <= 0) "10000" else pendingPixelAspectRatioE4.toString(), | |
| onClick = { _ -> | |
| showNumericInputDialog( | |
| title = getString(R.string.enter_pixel_aspect_ratio_value), | |
| message = null, | |
| initialValue = if ((pendingPixelAspectRatioE4 ?: 10000) <= 0) 10000 else pendingPixelAspectRatioE4!!, | |
| onConfirm = { newVal -> | |
| pendingPixelAspectRatioE4 = if (newVal <= 0) 10000 else newVal | |
| checkChanges() | |
| updateSettingsList() | |
| } | |
| ) | |
| } | |
| )) |
There was a problem hiding this comment.
Sound good to me. I would apply that suggestion.
|
Nice thank you very much! :) |
|
My question is, what does the aspect ratio has for an advantage? Just want to know, why this helps and what does it actually? |
|
I used it to fix and experiment with horizontal screen stretching. If you don't see any additional value in it, feel free to close the PR. |
|
Hi, maybe it helps if you can show a before and after result of this ? Hope I'm not bothering with this comment |
Hi @juanesf, take a look here . |




This PR adds GH action to build debug apk(can be removed) and new setting for AA protocol(Pixel aspect ratio). I used it to play with image stretching.(Default value is 10000, which is square pixels)