<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/gallery_background">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="64dp"
        android:gravity="center_vertical"
        android:paddingStart="8dp"
        android:paddingEnd="10dp">
        <ImageButton android:id="@+id/close_button" android:layout_width="48dp" android:layout_height="48dp" android:background="@drawable/bg_header_action" android:padding="13dp" android:src="@drawable/ic_back" android:contentDescription="@string/close"/>
        <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical" android:paddingStart="12dp">
            <TextView style="@style/LemenzoUI.Text.TitleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/editor_title"/>
            <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/photo_editor_hint" android:textColor="@color/gallery_muted" android:maxLines="1" android:ellipsize="end"/>
        </LinearLayout>
        <Button android:id="@+id/undo_button" style="@style/GalleryEditorButton" android:layout_width="wrap_content" android:layout_height="44dp" android:text="@string/undo"/>
        <Button android:id="@+id/redo_button" style="@style/GalleryEditorButton" android:layout_width="wrap_content" android:layout_height="44dp" android:layout_marginStart="4dp" android:text="@string/redo"/>
    </LinearLayout>

    <FrameLayout
        android:id="@+id/editor_canvas"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="10dp"
        android:layout_marginBottom="8dp"
        android:background="@drawable/bg_editor_preview"
        android:padding="6dp">
        <ImageView android:id="@+id/editor_preview" android:layout_width="match_parent" android:layout_height="match_parent" android:contentDescription="@string/editor_preview" android:scaleType="fitCenter"/>
        <com.lemenzo.gallery.editor.AnnotationOverlayView android:id="@+id/annotation_overlay" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone"/>
        <com.lemenzo.gallery.editor.CropOverlayView android:id="@+id/crop_overlay" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone"/>
    </FrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="@drawable/bg_editor_sheet"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:paddingTop="10dp"
        android:paddingBottom="10dp">

        <TextView android:id="@+id/editor_status" android:accessibilityLiveRegion="polite" style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:minHeight="24dp" android:text="@string/editor_loading" android:textColor="@color/gallery_text_secondary"/>

        <HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="none" android:fillViewport="true" android:layout_marginTop="4dp">
            <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center">
                <Button android:id="@+id/editor_tab_adjust" style="@style/GalleryEditorModeTab" android:layout_width="0dp" android:layout_height="48dp" android:layout_weight="1" android:text="@string/editor_adjust" android:background="@drawable/bg_editor_tab_selected" android:textColor="@color/gallery_text"/>
                <Button android:id="@+id/editor_tab_crop" style="@style/GalleryEditorModeTab" android:layout_width="0dp" android:layout_height="48dp" android:layout_weight="1" android:layout_marginStart="6dp" android:text="@string/editor_transform"/>
                <Button android:id="@+id/editor_tab_filters" style="@style/GalleryEditorModeTab" android:layout_width="0dp" android:layout_height="48dp" android:layout_weight="1" android:layout_marginStart="6dp" android:text="@string/filters"/>
                <Button android:id="@+id/editor_tab_markup" style="@style/GalleryEditorModeTab" android:layout_width="0dp" android:layout_height="48dp" android:layout_weight="1" android:layout_marginStart="6dp" android:text="@string/editor_markup"/>
            </LinearLayout>
        </HorizontalScrollView>

        <ScrollView android:id="@+id/editor_panel_scroll" android:layout_width="match_parent" android:layout_height="230dp" android:layout_marginTop="8dp" android:fillViewport="true" android:overScrollMode="ifContentScrolls">
            <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content">

                <LinearLayout android:id="@+id/editor_panel_adjust" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/bg_editor_panel" android:padding="14dp">
                    <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical">
                        <TextView style="@style/GalleryEditorSectionLabel" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/editor_adjustments"/>
                        <Button android:id="@+id/auto_enhance_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="48dp" android:text="@string/auto_enhance" android:contentDescription="@string/auto_enhance_description"/>
                        <Button android:id="@+id/reset_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_marginStart="6dp" android:text="@string/reset"/>
                    </LinearLayout>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:text="@string/exposure"/>
                    <SeekBar android:id="@+id/exposure_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/exposure"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/brightness"/>
                    <SeekBar android:id="@+id/brightness_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/brightness"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/contrast"/>
                    <SeekBar android:id="@+id/contrast_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/contrast"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/highlights"/>
                    <SeekBar android:id="@+id/highlights_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/highlights"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/shadows"/>
                    <SeekBar android:id="@+id/shadows_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/shadows"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/saturation"/>
                    <SeekBar android:id="@+id/saturation_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/saturation"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/warmth"/>
                    <SeekBar android:id="@+id/warmth_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/warmth"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/tint"/>
                    <SeekBar android:id="@+id/tint_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/tint"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/sharpness"/>
                    <SeekBar android:id="@+id/sharpness_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="0" android:contentDescription="@string/sharpness"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/vignette"/>
                    <SeekBar android:id="@+id/vignette_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="0" android:contentDescription="@string/vignette"/>
                </LinearLayout>

                <LinearLayout android:id="@+id/editor_panel_crop" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:visibility="gone" android:background="@drawable/bg_editor_panel" android:padding="14dp">
                    <TextView style="@style/GalleryEditorSectionLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/editor_transform_tools"/>
                    <HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:scrollbars="none">
                        <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal">
                            <Button android:id="@+id/rotate_left_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="48dp" android:text="@string/rotate_left"/>
                            <Button android:id="@+id/rotate_right_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_marginStart="8dp" android:text="@string/rotate_right"/>
                            <Button android:id="@+id/flip_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_marginStart="8dp" android:text="@string/flip"/>
                            <Button android:id="@+id/crop_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_marginStart="8dp" android:text="@string/crop_ratio"/>
                            <Button android:id="@+id/free_crop_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_marginStart="8dp" android:text="@string/free_crop"/>
                        </LinearLayout>
                    </HorizontalScrollView>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="@string/straighten"/>
                    <SeekBar android:id="@+id/straighten_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/straighten"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/perspective_horizontal"/>
                    <SeekBar android:id="@+id/perspective_x_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/perspective_horizontal"/>
                    <TextView style="@style/LemenzoUI.Text.BodySmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/perspective_vertical"/>
                    <SeekBar android:id="@+id/perspective_y_seek" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="100" android:progress="50" android:contentDescription="@string/perspective_vertical"/>
                </LinearLayout>

                <LinearLayout android:id="@+id/editor_panel_filters" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:visibility="gone" android:background="@drawable/bg_editor_panel" android:padding="14dp">
                    <TextView style="@style/GalleryEditorSectionLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/editor_filters_section"/>
                    <HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:scrollbars="none">
                        <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal">
                            <Button android:id="@+id/filter_original_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:text="@string/filter_original"/>
                            <Button android:id="@+id/filter_vivid_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:layout_marginStart="8dp" android:text="@string/filter_vivid"/>
                            <Button android:id="@+id/filter_mono_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:layout_marginStart="8dp" android:text="@string/filter_mono"/>
                            <Button android:id="@+id/filter_cool_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:layout_marginStart="8dp" android:text="@string/filter_cool"/>
                            <Button android:id="@+id/filter_warm_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:layout_marginStart="8dp" android:text="@string/filter_warm"/>
                        </LinearLayout>
                    </HorizontalScrollView>
                </LinearLayout>

                <LinearLayout android:id="@+id/editor_panel_markup" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:visibility="gone" android:background="@drawable/bg_editor_panel" android:padding="14dp">
                    <TextView style="@style/GalleryEditorSectionLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/editor_markup_tools"/>
                    <HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:scrollbars="none">
                        <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal">
                            <Button android:id="@+id/draw_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:text="@string/draw"/>
                            <Button android:id="@+id/redact_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:layout_marginStart="8dp" android:text="@string/redact"/>
                            <Button android:id="@+id/text_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:layout_marginStart="8dp" android:text="@string/add_text"/>
                            <Button android:id="@+id/clear_markup_button" style="@style/GalleryEditorChip" android:layout_width="wrap_content" android:layout_height="52dp" android:layout_marginStart="8dp" android:text="@string/clear_markup"/>
                        </LinearLayout>
                    </HorizontalScrollView>
                </LinearLayout>
            </FrameLayout>
        </ScrollView>

        <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="8dp">
            <Button android:id="@+id/save_private_copy_button" style="@style/GalleryEditorChip" android:layout_width="0dp" android:layout_height="54dp" android:layout_weight="1" android:text="@string/save_private_copy" android:contentDescription="@string/save_private_copy_description"/>
            <Button android:id="@+id/save_copy_button" style="@style/LemenzoUI.Button.Primary" android:layout_width="0dp" android:layout_height="54dp" android:layout_weight="1" android:layout_marginStart="8dp" android:text="@string/save_copy"/>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
