Make surfaceView non-clickable

PiperOrigin-RevId: 368818853
This commit is contained in:
olly 2021-04-16 12:07:03 +01:00 committed by Oliver Woodman
parent 2cc51db54a
commit 33f3e5fca0
2 changed files with 8 additions and 0 deletions

View File

@ -436,7 +436,11 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
break;
}
surfaceView.setLayoutParams(params);
// We don't want surfaceView to be clickable separately to the PlayerView itself, but we do
// want to register as an OnClickListener so that surfaceView implementations can propagate
// click events up to the PlayerView by calling their own performClick method.
surfaceView.setOnClickListener(componentListener);
surfaceView.setClickable(false);
contentFrame.addView(surfaceView, 0);
} else {
surfaceView = null;

View File

@ -443,7 +443,11 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
break;
}
surfaceView.setLayoutParams(params);
// We don't want surfaceView to be clickable separately to the StyledPlayerView itself, but we
// do want to register as an OnClickListener so that surfaceView implementations can propagate
// click events up to the StyledPlayerView by calling their own performClick method.
surfaceView.setOnClickListener(componentListener);
surfaceView.setClickable(false);
contentFrame.addView(surfaceView, 0);
} else {
surfaceView = null;