Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ef60d73 authored by Jacqueline Bronger's avatar Jacqueline Bronger Committed by Android (Google) Code Review
Browse files

Merge changes I67256421,I2b39b3d2

* changes:
  Add dim layer to PiP menu below buttons
  TV: Add PiP content sized views to one FrameLayout
parents 23d6326b 894e5b95
Loading
Loading
Loading
Loading
+81 −72
Original line number Diff line number Diff line
@@ -22,24 +22,32 @@
                android:gravity="center|top">

    <!-- Matches the PiP app content -->
    <View
    <FrameLayout
        android:id="@+id/tv_pip"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:alpha="0"
        android:background="@color/tv_pip_menu_background"
        android:layout_marginTop="@dimen/pip_menu_outer_space"
        android:layout_marginStart="@dimen/pip_menu_outer_space"
        android:layout_marginEnd="@dimen/pip_menu_outer_space"/>
        android:layout_marginEnd="@dimen/pip_menu_outer_space">

        <View
            android:id="@+id/tv_pip_menu_background"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/tv_pip_menu_background"
            android:alpha="0"/>

        <View
            android:id="@+id/tv_pip_menu_dim_layer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/tv_pip_menu_dim_layer"
            android:alpha="0"/>

        <ScrollView
            android:id="@+id/tv_pip_menu_scroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
        android:layout_alignTop="@+id/tv_pip"
        android:layout_alignStart="@+id/tv_pip"
        android:layout_alignEnd="@+id/tv_pip"
        android:layout_alignBottom="@+id/tv_pip"
            android:scrollbars="none"
            android:visibility="gone"/>

@@ -47,10 +55,6 @@
            android:id="@+id/tv_pip_menu_horizontal_scroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
        android:layout_alignTop="@+id/tv_pip"
        android:layout_alignStart="@+id/tv_pip"
        android:layout_alignEnd="@+id/tv_pip"
        android:layout_alignBottom="@+id/tv_pip"
            android:scrollbars="none">

            <LinearLayout
@@ -64,14 +68,14 @@
                    android:layout_width="@dimen/pip_menu_button_wrapper_margin"
                    android:layout_height="@dimen/pip_menu_button_wrapper_margin"/>

            <com.android.wm.shell.common.TvWindowMenuActionButton
                <com.android.wm.shell.pip.tv.TvPipMenuActionButton
                    android:id="@+id/tv_pip_menu_fullscreen_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/pip_ic_fullscreen_white"
                    android:text="@string/pip_fullscreen" />

            <com.android.wm.shell.common.TvWindowMenuActionButton
                <com.android.wm.shell.pip.tv.TvPipMenuActionButton
                    android:id="@+id/tv_pip_menu_close_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
@@ -80,14 +84,14 @@

                <!-- More TvPipMenuActionButtons may be added here at runtime. -->

            <com.android.wm.shell.common.TvWindowMenuActionButton
                <com.android.wm.shell.pip.tv.TvPipMenuActionButton
                    android:id="@+id/tv_pip_menu_move_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/pip_ic_move_white"
                    android:text="@string/pip_move" />

            <com.android.wm.shell.common.TvWindowMenuActionButton
                <com.android.wm.shell.pip.tv.TvPipMenuActionButton
                    android:id="@+id/tv_pip_menu_expand_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
@@ -101,7 +105,9 @@

            </LinearLayout>
        </HorizontalScrollView>
    </FrameLayout>

    <!-- Frame around the content, just overlapping the corners to make them round -->
    <View
        android:id="@+id/tv_pip_border"
        android:layout_width="0dp"
@@ -111,6 +117,7 @@
        android:layout_marginEnd="@dimen/pip_menu_outer_space_frame"
        android:background="@drawable/tv_pip_menu_border"/>

    <!-- Temporarily extending the background to show an edu text hint for opening the menu -->
    <FrameLayout
        android:id="@+id/tv_pip_menu_edu_text_container"
        android:layout_width="match_parent"
@@ -138,6 +145,7 @@
            android:textAppearance="@style/TvPipEduText"/>
    </FrameLayout>

    <!-- Frame around the PiP content + edu text hint - used to highlight open menu -->
    <View
        android:id="@+id/tv_pip_menu_frame"
        android:layout_width="match_parent"
@@ -145,7 +153,8 @@
        android:layout_margin="@dimen/pip_menu_outer_space_frame"
        android:background="@drawable/tv_pip_menu_border"/>

    <com.android.wm.shell.common.TvWindowMenuActionButton
    <!-- Move menu -->
    <com.android.wm.shell.pip.tv.TvPipMenuActionButton
        android:id="@+id/tv_pip_menu_done_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
    <color name="tv_window_menu_icon_bg_unfocused">#990E0E0F</color>

    <color name="tv_pip_menu_focus_border">#E8EAED</color>
    <color name="tv_pip_menu_dim_layer">#990E0E0F</color>
    <color name="tv_pip_menu_background">#1E232C</color>

    <color name="tv_pip_edu_text">#99D2E3FC</color>
+9 −2
Original line number Diff line number Diff line
@@ -97,6 +97,9 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
    private final ImageView mArrowLeft;
    private final TvWindowMenuActionButton mA11yDoneButton;

    private final View mPipBackground;
    private final View mDimLayer;

    private final ScrollView mScrollView;
    private final HorizontalScrollView mHorizontalScrollView;
    private View mFocusedButton;
@@ -148,6 +151,9 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
        mExpandButton = findViewById(R.id.tv_pip_menu_expand_button);
        mExpandButton.setOnClickListener(this);

        mPipBackground = findViewById(R.id.tv_pip_menu_background);
        mDimLayer = findViewById(R.id.tv_pip_menu_dim_layer);

        mScrollView = findViewById(R.id.tv_pip_menu_scroll);
        mHorizontalScrollView = findViewById(R.id.tv_pip_menu_horizontal_scroll);

@@ -231,7 +237,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
                    mCurrentPipBounds.width() / (float) mCurrentPipBounds.height(),
                    finishBounds.width() / (float) finishBounds.height());
            if (ratioChanged) {
                mPipView.animate()
                mPipBackground.animate()
                        .alpha(1f)
                        .setInterpolator(TvPipInterpolators.EXIT)
                        .setDuration(mResizeAnimationDuration / 2)
@@ -272,7 +278,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
                "%s: onPipTransitionFinished()", TAG);

        // Fade in content by fading out view on top.
        mPipView.animate()
        mPipBackground.animate()
                .alpha(0f)
                .setDuration(mResizeAnimationDuration / 2)
                .setInterpolator(TvPipInterpolators.ENTER)
@@ -770,6 +776,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
            refocusPreviousButton();
        }
        animateAlphaTo(show ? 1 : 0, mActionButtonsContainer);
        animateAlphaTo(show ? 1 : 0, mDimLayer);
    }

    private void setFrameHighlighted(boolean highlighted) {