<!--
  Copyright (C) 2022 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<!-- Scrollview is necessary to fit everything in landscape layout -->
<ScrollView  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:id="@+id/screen_share_permission_dialog"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/dialog_side_padding"
        android:paddingEnd="@dimen/dialog_side_padding"
        android:paddingTop="@dimen/dialog_top_padding"
        android:paddingBottom="@dimen/dialog_bottom_padding"
        android:orientation="vertical"
        android:gravity="center_horizontal">

        <ImageView
            android:id="@+id/screen_share_dialog_icon"
            android:layout_width="@dimen/screenrecord_logo_size"
            android:layout_height="@dimen/screenrecord_logo_size"
            android:src="@drawable/ic_media_projection_permission"
            android:tint="?androidprv:attr/materialColorPrimary"
            android:importantForAccessibility="no"/>
        <TextView
            android:id="@+id/screen_share_dialog_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="@style/TextAppearance.Dialog.Title"
            android:layout_marginTop="@dimen/screenrecord_title_margin_top"
            android:gravity="center"/>
        <Spinner
            android:id="@+id/screen_share_mode_options"
            android:layout_width="match_parent"
            android:layout_height="@dimen/screenrecord_spinner_height"
            android:layout_marginTop="@dimen/screenrecord_spinner_margin"
            android:layout_marginBottom="@dimen/screenrecord_spinner_margin"
            android:gravity="center_vertical"
            android:background="@drawable/screenshare_options_spinner_background"
            android:popupBackground="@drawable/screenrecord_options_spinner_popup_background"/>
        <ViewStub
            android:id="@+id/options_stub"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
        <TextView
            android:id="@+id/text_warning"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/screenrecord_permission_dialog_warning_entire_screen"
            style="@style/TextAppearance.Dialog.Body.Message"
            android:gravity="start"/>

        <!-- Buttons -->
        <com.android.internal.widget.ButtonBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="@dimen/screenrecord_buttons_margin_top">
            <Button
                android:id="@android:id/button2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:text="@string/cancel"
                style="@style/Widget.Dialog.Button.BorderButton" />
            <Space
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"/>
            <Button
                android:id="@android:id/button1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:text="@string/screenrecord_continue"
                style="@style/Widget.Dialog.Button" />
        </com.android.internal.widget.ButtonBarLayout>
    </LinearLayout>
</ScrollView>