Merge "Fix tv pip menu rounded corner artifacts" into udc-dev am: 766ec400f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22356287 Change-Id: I4e93eabcf6220fa8a43e732cbf6420acd2d93786 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
<!-- Temporarily extending the background to show an edu text hint for opening the menu -->
|
<!-- Temporarily extending the background to show an edu text hint for opening the menu -->
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/tv_pip_menu_edu_text_drawer_placeholder"
|
android:id="@+id/tv_pip_menu_edu_text_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@+id/tv_pip"
|
android:layout_below="@+id/tv_pip"
|
||||||
|
|||||||
@@ -260,11 +260,12 @@ class TvPipMenuEduTextDrawer extends FrameLayout {
|
|||||||
});
|
});
|
||||||
heightAnimator.start();
|
heightAnimator.start();
|
||||||
|
|
||||||
mListener.onCloseEduText();
|
mListener.onCloseEduTextAnimationStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCloseEduTextAnimationEnd() {
|
public void onCloseEduTextAnimationEnd() {
|
||||||
setVisibility(GONE);
|
setVisibility(GONE);
|
||||||
|
mListener.onCloseEduTextAnimationEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -295,11 +296,8 @@ class TvPipMenuEduTextDrawer extends FrameLayout {
|
|||||||
* A listener for edu text drawer event states.
|
* A listener for edu text drawer event states.
|
||||||
*/
|
*/
|
||||||
interface Listener {
|
interface Listener {
|
||||||
/**
|
void onCloseEduTextAnimationStart();
|
||||||
* The edu text closing impacts the size of the Picture-in-Picture window and influences
|
void onCloseEduTextAnimationEnd();
|
||||||
* how it is positioned on the screen.
|
|
||||||
*/
|
|
||||||
void onCloseEduText();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ import java.util.List;
|
|||||||
* A View that represents Pip Menu on TV. It's responsible for displaying the Pip menu actions from
|
* A View that represents Pip Menu on TV. It's responsible for displaying the Pip menu actions from
|
||||||
* the TvPipActionsProvider as well as the buttons for manually moving the PiP.
|
* the TvPipActionsProvider as well as the buttons for manually moving the PiP.
|
||||||
*/
|
*/
|
||||||
public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.Listener {
|
public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.Listener,
|
||||||
|
TvPipMenuEduTextDrawer.Listener {
|
||||||
private static final String TAG = "TvPipMenuView";
|
private static final String TAG = "TvPipMenuView";
|
||||||
|
|
||||||
private final TvPipMenuView.Listener mListener;
|
private final TvPipMenuView.Listener mListener;
|
||||||
@@ -76,6 +77,7 @@ public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.L
|
|||||||
private final View mDimLayer;
|
private final View mDimLayer;
|
||||||
|
|
||||||
private final TvPipMenuEduTextDrawer mEduTextDrawer;
|
private final TvPipMenuEduTextDrawer mEduTextDrawer;
|
||||||
|
private final ViewGroup mEduTextContainer;
|
||||||
|
|
||||||
private final int mPipMenuOuterSpace;
|
private final int mPipMenuOuterSpace;
|
||||||
private final int mPipMenuBorderWidth;
|
private final int mPipMenuBorderWidth;
|
||||||
@@ -139,9 +141,9 @@ public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.L
|
|||||||
mPipMenuBorderWidth = context.getResources()
|
mPipMenuBorderWidth = context.getResources()
|
||||||
.getDimensionPixelSize(R.dimen.pip_menu_border_width);
|
.getDimensionPixelSize(R.dimen.pip_menu_border_width);
|
||||||
|
|
||||||
mEduTextDrawer = new TvPipMenuEduTextDrawer(mContext, mainHandler, mListener);
|
mEduTextDrawer = new TvPipMenuEduTextDrawer(mContext, mainHandler, this);
|
||||||
((FrameLayout) findViewById(R.id.tv_pip_menu_edu_text_drawer_placeholder))
|
mEduTextContainer = (ViewGroup) findViewById(R.id.tv_pip_menu_edu_text_container);
|
||||||
.addView(mEduTextDrawer);
|
mEduTextContainer.addView(mEduTextDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onPipTransitionToTargetBoundsStarted(Rect targetBounds) {
|
void onPipTransitionToTargetBoundsStarted(Rect targetBounds) {
|
||||||
@@ -235,12 +237,14 @@ public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.L
|
|||||||
* pip menu when it gains focus.
|
* pip menu when it gains focus.
|
||||||
*/
|
*/
|
||||||
private void updatePipFrameBounds() {
|
private void updatePipFrameBounds() {
|
||||||
|
if (mPipFrameView.getVisibility() == VISIBLE) {
|
||||||
final ViewGroup.LayoutParams pipFrameParams = mPipFrameView.getLayoutParams();
|
final ViewGroup.LayoutParams pipFrameParams = mPipFrameView.getLayoutParams();
|
||||||
if (pipFrameParams != null) {
|
if (pipFrameParams != null) {
|
||||||
pipFrameParams.width = mCurrentPipBounds.width() + 2 * mPipMenuBorderWidth;
|
pipFrameParams.width = mCurrentPipBounds.width() + 2 * mPipMenuBorderWidth;
|
||||||
pipFrameParams.height = mCurrentPipBounds.height() + 2 * mPipMenuBorderWidth;
|
pipFrameParams.height = mCurrentPipBounds.height() + 2 * mPipMenuBorderWidth;
|
||||||
mPipFrameView.setLayoutParams(pipFrameParams);
|
mPipFrameView.setLayoutParams(pipFrameParams);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final ViewGroup.LayoutParams pipViewParams = mPipView.getLayoutParams();
|
final ViewGroup.LayoutParams pipViewParams = mPipView.getLayoutParams();
|
||||||
if (pipViewParams != null) {
|
if (pipViewParams != null) {
|
||||||
@@ -405,6 +409,17 @@ public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.L
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCloseEduTextAnimationStart() {
|
||||||
|
mListener.onCloseEduText();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCloseEduTextAnimationEnd() {
|
||||||
|
mPipFrameView.setVisibility(GONE);
|
||||||
|
mEduTextContainer.setVisibility(GONE);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
if (event.getAction() == ACTION_UP) {
|
if (event.getAction() == ACTION_UP) {
|
||||||
@@ -551,7 +566,7 @@ public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.L
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Listener extends TvPipMenuEduTextDrawer.Listener {
|
interface Listener {
|
||||||
|
|
||||||
void onBackPress();
|
void onBackPress();
|
||||||
|
|
||||||
@@ -573,5 +588,11 @@ public class TvPipMenuView extends FrameLayout implements TvPipActionsProvider.L
|
|||||||
* has lost focus.
|
* has lost focus.
|
||||||
*/
|
*/
|
||||||
void onPipWindowFocusChanged(boolean focused);
|
void onPipWindowFocusChanged(boolean focused);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The edu text closing impacts the size of the Picture-in-Picture window and influences
|
||||||
|
* how it is positioned on the screen.
|
||||||
|
*/
|
||||||
|
void onCloseEduText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user