Close the TV PiP menu when losing window focus.

Bug: 219885877
Test: manual - open a PiP, then long press HOME -> menu should close
Change-Id: I20b255f78e9e21a05a8138ef09ab00cce3f2521c
This commit is contained in:
Jacqueline Bronger
2022-05-05 10:43:55 +02:00
parent a512a9b955
commit 5996319de6

View File

@@ -494,6 +494,14 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
setFrameHighlighted(false);
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
if (!hasWindowFocus) {
hideAllUserControls();
}
}
private void animateAlphaTo(float alpha, View view) {
if (view.getAlpha() == alpha) {
return;