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

Android: Fix controller input causing screen highlight #1259

Merged
merged 4 commits into from Jun 27, 2023
Merged

Android: Fix controller input causing screen highlight #1259

merged 4 commits into from Jun 27, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jun 26, 2023

Fixes: #1089

Fix an issue on Android where input from a controller would cause the SurfaceView to become highlighted

@ghost
Copy link
Author

ghost commented Jun 26, 2023

@jpd002 not sure if this is how you want to ultimately implement this fix. The issue is that the SurfaceView is becoming highlighted as Android is, by default, focusing on the view when a user uses a controllers D-pad. The option to disable this behaviour is only available since API 26. There might be a better way to fix this so it works for all API level's? But I'm not an Android dev!

@jpd002
Copy link
Owner

jpd002 commented Jun 26, 2023

Would it work if we applied this on the SurfaceView only instead of applying it broadly on the theme? I'm not sure if there's gonna be side effects of applying it globally like that.

Thanks!

- Change from overriding the entire style to adding an override for the specific view
@Zer0xFF
Copy link
Contributor

Zer0xFF commented Jun 26, 2023

why not add that directly to the emulator.xml? (yes im aware this was only added for api 26, but wouldnt it just be ignored on older versions?)

@ghost
Copy link
Author

ghost commented Jun 26, 2023

Will give it a try and update :)

@ghost
Copy link
Author

ghost commented Jun 26, 2023

@jpd002 @Zer0xFF changed to just add attibute in required view.

Android does indeed ignore unsupported XML attributes

@@ -37,7 +38,7 @@
android:id="@+id/emulator_profile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_gravity="end"
Copy link
Owner

Choose a reason for hiding this comment

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

Is this an intentional change? If not, probably best to leave it out.

Copy link
Author

Choose a reason for hiding this comment

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

Argh sorry about that! Changed it back now

@jpd002
Copy link
Owner

jpd002 commented Jun 27, 2023

Thanks for this!

@jpd002 jpd002 merged commit e634f31 into jpd002:master Jun 27, 2023
@ghost ghost deleted the fix-controller-highlight branch June 27, 2023 18:23
@ghost
Copy link
Author

ghost commented Jun 27, 2023

Just tried the latest build and working perfectly! Thank you for merging it!

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.

Input from controllers highlights entire screen on OxygenOS
2 participants