Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UUM-91484] UnityProject example: set theme for unity game activity to make it fullscreen on 6.1 #117

Merged

Conversation

TiphaineRousseauU
Copy link
Contributor

@TiphaineRousseauU TiphaineRousseauU commented Dec 19, 2024

Description

Jira link: UUM-91484

On Unity 6.1, the UnityGameActivity example is broken because of the action bar, which shifts all of the input coordinates by the height of the bar. See attached video on UUM-91483

This PR forces the UnityGameActivity from the example to be fullscreen even on Unity 6.1. This is done by using the NoActionBar theme in the Android manifest.

Copy link
Member

@todi1856 todi1856 left a comment

Choose a reason for hiding this comment

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

We probably need to expand our UAAL test here - https://github.cds.internal.unity3d.com/unity/unity/blob/trunk/Tests/Unity.IntegrationTests/Android/AndroidUAAL.cs, by injecting touch event and see that it's being received at the expected position. Since currently we don't validate that, and that's how this bug creeped in.

Anyways, this is optional, I made a memo for myself, unless you want to do it.

Thanks for finding the cause for this issue!

@@ -30,6 +30,7 @@
android:name=".MainUnityGameActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
android:hardwareAccelerated="false"
android:theme="@style/AppTheme.NoActionBar"
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to match Unity themes here. See https://github.cds.internal.unity3d.com/unity/unity/blob/trunk/PlatformDependent/AndroidPlayer/Resources/UnityManifest.xml

Could you set

android:theme="@style/UnityThemeSelector"

for Activity

and

android:theme="@style/BaseUnityGameActivityTheme"

for GameActivity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense!
Done

note: android support starts with 2023.1.7f1, for which the used theme is available
@TiphaineRousseauU
Copy link
Contributor Author

We probably need to expand our UAAL test here - https://github.cds.internal.unity3d.com/unity/unity/blob/trunk/Tests/Unity.IntegrationTests/Android/AndroidUAAL.cs, by injecting touch event and see that it's being received at the expected position. Since currently we don't validate that, and that's how this bug creeped in.

Hi (and thanks for the review!) I probably will not have time to do that before the holidays (aka in the next 2h), but I could take a look next year
Do I read this correctly though: the GameActivity test is currently not run, unless you have access to a physical device? Should that be fixed first?

@todi1856
Copy link
Member

We probably need to expand our UAAL test here - https://github.cds.internal.unity3d.com/unity/unity/blob/trunk/Tests/Unity.IntegrationTests/Android/AndroidUAAL.cs, by injecting touch event and see that it's being received at the expected position. Since currently we don't validate that, and that's how this bug creeped in.

Hi (and thanks for the review!) I probably will not have time to do that before the holidays (aka in the next 2h), but I could take a look next year Do I read this correctly though: the GameActivity test is currently not run, unless you have access to a physical device? Should that be fixed first?

It's up to Lukas to fix - https://jira.unity3d.com/browse/ANT-2623 you can poke him if you want

@TiphaineRousseauU TiphaineRousseauU merged commit 19dad95 into master Jan 14, 2025
2 checks passed
@TiphaineRousseauU TiphaineRousseauU deleted the fix/uaal/uum-91484-android-game-activity-sample branch January 14, 2025 08:34
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.

3 participants