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

Commit 52405569 authored by Jacqueline Bronger's avatar Jacqueline Bronger
Browse files

TV: Add PiP content sized views to one FrameLayout

Restructuring of the tv pip menu layout to improve readability. Also
includes some extra comments.

Bug: 241744433
Test: manual - start a PiP and open the menu to see if the views
including the edu text are still shown properly

Change-Id: I2b39b3d251500de4d62d80829affbd8d2b6af42a
parent 3c3be262
Loading
Loading
Loading
Loading
+75 −73
Original line number Diff line number Diff line
@@ -22,24 +22,25 @@
                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"/>

        <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 +48,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 +61,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 +77,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 +98,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 +110,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 +138,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 +146,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"
+6 −2
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
    private final ImageView mArrowLeft;
    private final TvWindowMenuActionButton mA11yDoneButton;

    private final View mPipBackground;

    private final ScrollView mScrollView;
    private final HorizontalScrollView mHorizontalScrollView;
    private View mFocusedButton;
@@ -148,6 +150,8 @@ 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);

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

@@ -231,7 +235,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 +276,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)