Skip to content

Forced Scale for SurfaceView#331

Draft
andreknieriem wants to merge 8 commits intomainfrom
forcedscale
Draft

Forced Scale for SurfaceView#331
andreknieriem wants to merge 8 commits intomainfrom
forcedscale

Conversation

@andreknieriem
Copy link
Copy Markdown
Owner

Added a new option for surfaceview which forced scale like HUR 7.2.2 and above. This should finally fix wrong surfaceview on older devices.

@andreknieriem andreknieriem self-assigned this Apr 1, 2026
Copy link
Copy Markdown
Contributor

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

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 "Forced Scale" legacy fix for SurfaceView on older devices, refactoring the scaling logic in ProjectionViewScaler and updating AapProjectionActivity and ProjectionView to support this mode. Review feedback indicates that the stretchToFill logic is currently inverted in both ProjectionView and ProjectionViewScaler, leading to behavior opposite to the user's selection. Additionally, suggestions were made to use simple class names for imported types to improve readability and to optimize performance by avoiding redundant layout passes when updating view parameters.

if (lp is FrameLayout.LayoutParams) {
lp.gravity = Gravity.CENTER
}
view.layoutParams = lp
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

Assigning layoutParams back to the view unconditionally triggers a layout pass (requestLayout()). Since updateScale is called during surface and size changes, this can lead to redundant layout cycles. It is recommended to check if the width, height, or gravity have actually changed before re-assigning the layout parameters. This applies to lines 54 and 76 as well.

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.

1 participant