Skip to content

Added pixel aspect ratio setting, gh action to build apk#621

Open
axel92b wants to merge 1 commit into
andreknieriem:mainfrom
axel92b:main
Open

Added pixel aspect ratio setting, gh action to build apk#621
axel92b wants to merge 1 commit into
andreknieriem:mainfrom
axel92b:main

Conversation

@axel92b

@axel92b axel92b commented Jun 23, 2026

Copy link
Copy Markdown

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)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +899 to +915
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()
}
)
}
))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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()
}
)
}
))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreknieriem what do you think about that?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sound good to me. I would apply that suggestion.

@andreknieriem

Copy link
Copy Markdown
Owner

Nice thank you very much! :)

@andreknieriem

Copy link
Copy Markdown
Owner

My question is, what does the aspect ratio has for an advantage? Just want to know, why this helps and what does it actually?

@axel92b

axel92b commented Jun 30, 2026

Copy link
Copy Markdown
Author

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.

@DekkerlionTSSF

Copy link
Copy Markdown

Hi, maybe it helps if you can show a before and after result of this ? Hope I'm not bothering with this comment

@juanesf

juanesf commented Jul 11, 2026

Copy link
Copy Markdown

There is a artifact available for testing? I have a large, vertical, "Tesla-type" screen, and the air controls on the bottom bar make the space available for Android Auto rectangular. The solution to avoid distorting the aspect ratio is to add a 100 margin on one side to achieve a more pleasing aspect ratio.
IMG_20260710_230611
IMG_20260710_231134

@axel92b

axel92b commented Jul 11, 2026

Copy link
Copy Markdown
Author

There is a artifact available for testing? I have a large, vertical, "Tesla-type" screen, and the air controls on the bottom bar make the space available for Android Auto rectangular. The solution to avoid distorting the aspect ratio is to add a 100 margin on one side to achieve a more pleasing aspect ratio. IMG_20260710_230611 IMG_20260710_231134

Hi @juanesf, take a look here .
It looks like you need to set pixel aspect ratio to > 10000.(maybe even start with 11000).
@DekkerlionTSSF I will try to find some time and do it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants