Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Fixes #2948 - Added hover listener for the full media control to hand… #3386

Merged
merged 1 commit into from
May 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,32 @@ public void onSeekPreview(String aText, double aRatio) {
}
mVolumeControl.requestFocusFromTouch();
});


this.setOnHoverListener((v, event) -> {
if (mMedia == null) {
return false;
}
/*this handles the case where the user
holds the volume slider up/down past the volume control
control then hovers, which wont be picked up by the
volume control hover listener. in this case the widget itself
needs to handle this case
*/
if ((event.getX() < 0) || (event.getY() < 0)) {
mHideVolumeSlider = true;
startVolumeCtrlHandler();
}

return false;
});
mMediaVolumeButton.setOnHoverListener((v, event) -> {
float startY = v.getY();
float maxY = startY + v.getHeight();
//for this we only hide on the left side of volume button or outside y area of button
if ((event.getX() <= 0) || (event.getX() >= v.getWidth()) || (!(event.getY() > startY && event.getY() < maxY))) {
mHideVolumeSlider = true;
startVolumeCtrlHandler();

} else {
mVolumeControl.setVisibility(View.VISIBLE);
mHideVolumeSlider = false;
Expand Down