<?xml version="1.0" encoding="utf-8"?>
<!-- A drop-up over the subtitle button rather than a full-height panel: the film keeps
     playing behind it, so there is no scrim and nothing bigger than the question being
     asked. The margins line the panel up with the transport row's end inset (48dp) and
     clear its 72dp button strip plus the controls' 28dp bottom padding; the top margin is
     what caps how tall the track list can grow before it scrolls.

     The panel holds two screens, not three sections. Choosing a track and fetching one the
     title does not have are separate questions, and at 344dp by a third of a 720p screen
     there is not room to ask both — stacking them squeezed the track list to a single row.
     So `player_subtitle_main_section` and the results half of the download section swap:
     the search row is the way in, Back is the way out, one press per level. -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/player_subtitle_overlay"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent"
    android:clickable="true"
    android:focusable="true"
    android:visibility="gone">

    <LinearLayout
        android:id="@+id/player_subtitle_menu"
        android:layout_width="344dp"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_marginTop="96dp"
        android:layout_marginEnd="44dp"
        android:layout_marginBottom="112dp"
        android:background="@drawable/player_menu_background"
        android:orientation="vertical"
        android:paddingStart="10dp"
        android:paddingTop="14dp"
        android:paddingEnd="10dp"
        android:paddingBottom="12dp">

        <LinearLayout
            android:id="@+id/player_subtitle_main_section"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="14dp"
                android:letterSpacing="0.12"
                android:text="@string/player_subtitle_track"
                android:textColor="#7AFFFFFF"
                android:textSize="11sp"
                android:textStyle="bold" />

            <!-- Why the list under this heading has nothing but Off in it. Without the
                 line, a title carrying no subtitles reads as the menu having failed rather
                 than as the film not having any, and the row that could fix it is below a
                 rule the eye has no reason to travel past. -->
            <TextView
                android:id="@+id/player_subtitle_empty_notice"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="14dp"
                android:layout_marginTop="6dp"
                android:layout_marginEnd="14dp"
                android:text="@string/player_subtitle_none"
                android:textColor="#96FFFFFF"
                android:textSize="12sp"
                android:visibility="gone" />

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:layout_weight="1"
                android:fillViewport="false"
                android:overScrollMode="never"
                android:scrollbars="none">

                <LinearLayout
                    android:id="@+id/player_subtitle_tracks"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" />
            </ScrollView>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginStart="14dp"
                android:layout_marginTop="10dp"
                android:layout_marginEnd="14dp"
                android:background="#14FFFFFF" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="14dp"
                android:layout_marginTop="12dp"
                android:letterSpacing="0.12"
                android:text="@string/player_text_size"
                android:textColor="#7AFFFFFF"
                android:textSize="11sp"
                android:textStyle="bold" />

            <LinearLayout
                android:id="@+id/player_subtitle_sizes"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:orientation="horizontal" />
        </LinearLayout>

        <!-- Fetching a subtitle the title does not have. The whole group is GONE on a
             backend that cannot do it, rather than showing a row that leads nowhere. -->
        <LinearLayout
            android:id="@+id/player_subtitle_download_section"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical"
            android:visibility="gone">

            <!-- Hidden with the section above it: with the menu swapped out this heading is
                 the first thing on the panel, and a rule above the first thing is a line
                 under the panel's own top edge. -->
            <View
                android:id="@+id/player_subtitle_download_rule"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginStart="14dp"
                android:layout_marginTop="12dp"
                android:layout_marginEnd="14dp"
                android:background="#14FFFFFF" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="14dp"
                android:layout_marginTop="12dp"
                android:letterSpacing="0.12"
                android:text="@string/player_subtitle_download"
                android:textColor="#7AFFFFFF"
                android:textSize="11sp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/player_subtitle_download_status"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="14dp"
                android:layout_marginTop="6dp"
                android:layout_marginEnd="14dp"
                android:textColor="#96FFFFFF"
                android:textSize="12sp"
                android:visibility="gone" />

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:layout_weight="1"
                android:fillViewport="false"
                android:overScrollMode="never"
                android:scrollbars="none">

                <LinearLayout
                    android:id="@+id/player_subtitle_downloads"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" />
            </ScrollView>
        </LinearLayout>
    </LinearLayout>
</FrameLayout>
