NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Fix persistent hover overlay when in desktop/DeX mode or using a mouse/non-touch input

Open han-sz opened this issue 2 years ago • 8 comments

What is it?

  • [x] Bugfix (user facing)
  • [ ] Feature (user facing)
  • [ ] Codebase improvement (dev facing)
  • [ ] Meta improvement to the project (dev facing)

Description of the changes in your PR

A non-touch input device that supports hover events results in a persistent transparent overlay on top of the video player. When using an Android device in desktop mode or with a mouse, the content is obscured with said overlay.

The bug was first reported here: https://github.com/TeamNewPipe/NewPipe/issues/4357

This PR adds an isDesktopMode check and removes the hover overlay for the detailThumbnailRootLayout only when in desktop mode (DeX, Android desktop, etc.)

Before/After Screenshots/Screen Record

  • Before: Screenshot_20220501-022300_NewPipe

  • After: Screenshot_20220501-022400_NewPipe fix_video_mouse_hover_overlay

Fixes the following issue(s)

  • Fixes #4357

APK testing

APK for testing: app-debug.apk.zip

Due diligence

han-sz avatar Apr 30 '22 16:04 han-sz

I see the same problem on my random cheap android tv shitbox (X88 Pro 10) so I tried this patch. As it is it doesn't help, because DeviceUtils.isDesktopMode doesn't return true, if I remove the condition it does work. Not sure if there's another way to detect usage as tv box, or an attached mouse (since presumably this would be annoying regardless of platform.)

edit: #4422 says that there are more devices / conditions where this overlay appears unwantedly. Maybe just disabling it unconditionally would be an option, since the player is highlighted by a border as well?

cybersphinx avatar Jul 07 '22 22:07 cybersphinx

I've added a check for devices with cursors: https://github.com/cybersphinx/NewPipe/commit/e86a34b1c4eedead1bc791b7869c03f833f5265a (full branch)

With this it works on my tv box (and phone with attached mouse), I don't have any of the fancy devices mentioned in #4422 with stylus or finger hover detection.

There's an SDK version check around it that can/should be removed if minSdk is raised to 21.

cybersphinx avatar Jul 12 '22 09:07 cybersphinx

There's an SDK version check around it that can/should be removed if minSdk is raised to 21.

The barrier has been lifted.

opusforlife2 avatar Jul 16 '22 07:07 opusforlife2

Updated my branch to remove the check, and fix a silly oversight.

cybersphinx avatar Jul 16 '22 20:07 cybersphinx

@cybersphinx do you want me to add your commits here? Or do you want to open a new PR?

Stypox avatar Jul 18 '22 22:07 Stypox

If you can add them here I guess that's the best place.

cybersphinx avatar Jul 19 '22 15:07 cybersphinx

Done; @litetex could you review again?

Stypox avatar Jul 20 '22 10:07 Stypox

I rebased the PR and pushed a commit to the branch which improves the code added, let me know if it is good for you :)

AudricV avatar Nov 09 '22 15:11 AudricV

Thanks @AudricV, looks good to me!

han-sz avatar Nov 10 '22 04:11 han-sz

Issue solved in v0.25.0.

Andronx avatar Feb 20 '23 10:02 Andronx