<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <FrameLayout
        android:id="@+id/preview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        />
    
    <ImageButton
        android:id="@+id/take_photo"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/take_photo"
        app:srcCompat="@drawable/take_photo_selector"
        android:stateListAnimator="@animator/button_animation"
        android:onClick="clickedTakePhoto"
        android:background="@null"
        />

    <ImageButton
        android:id="@+id/switch_camera"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/switch_to_front_camera"
        app:srcCompat="@drawable/switch_camera"
        android:stateListAnimator="@animator/button_animation"
        android:onClick="clickedSwitchCamera"
        android:background="@drawable/circle_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        />

    <ImageButton
        android:id="@+id/switch_multi_camera"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:paddingLeft="15dp"
        android:paddingRight="15dp"
        android:paddingTop="12dp"
        android:paddingBottom="18dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/switch_multi_camera"
        app:srcCompat="@drawable/baseline_add_a_photo_white_48"
        android:onClick="clickedSwitchMultiCamera"
        android:stateListAnimator="@animator/button_animation"
        android:background="@drawable/circle_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/pause_video"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/pause_video"
        app:srcCompat="@drawable/ic_pause_circle_outline_white_48dp"
        android:onClick="clickedPauseVideo"
        android:background="@null"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/cancel_panorama"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/cancel_panorama"
        app:srcCompat="@drawable/baseline_close_white_48"
        android:onClick="clickedCancelPanorama"
        android:stateListAnimator="@animator/button_animation"
        android:background="@null"
        android:visibility="gone"
        />

    <!-- don't have alpha too low, as otherwise flags up Google Play prelaunch warning about contrast ratio too low (should be at least 3)-->
    <ImageButton
        android:id="@+id/switch_video"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/switch_to_video"
        app:srcCompat="@drawable/take_video"
        android:stateListAnimator="@animator/button_animation"
        android:alpha="0.61"
        android:onClick="clickedSwitchVideo"
        android:background="@null"
        />

    <!-- need large padding than pause_video, to reflect that pause_video icon has padding built into the png image -->
    <ImageButton
        android:id="@+id/take_photo_when_video_recording"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:padding="14dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/take_photo"
        app:srcCompat="@drawable/take_photo_selector"
        android:stateListAnimator="@animator/button_animation"
        android:onClick="clickedTakePhotoVideoSnapshot"
        android:background="@null"
        android:visibility="gone"
        />

    <SeekBar
        android:id="@+id/zoom_seekbar"
        android:contentDescription="@string/zoom"
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:background="@color/seekbar_background"
        />

    <!-- n.b., layout_marginLeft set programmatically in DrawPreview -->
    <SeekBar
        android:id="@+id/focus_seekbar"
        android:contentDescription="@string/focus_distance"
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="0dp"
        android:layout_marginTop="0dp"
        android:layout_marginBottom="0dp"
        android:visibility="gone"
        android:background="@color/seekbar_background"
        />

    <!-- n.b., layout_marginLeft set programmatically in DrawPreview -->
    <SeekBar
        android:id="@+id/focus_bracketing_target_seekbar"
        android:contentDescription="@string/focus_bracketing_target_distance"
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="0dp"
        android:layout_marginTop="0dp"
        android:layout_marginBottom="0dp"
        android:visibility="gone"
        android:background="@color/seekbar_background"
        />

    <View
        android:id="@+id/gui_anchor"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:padding="1dp"
        android:scaleType="fitCenter"
        android:visibility="invisible"
        />

    <!-- padding set to 0 to maximise the size of the thumbnail shown; background is transparent for
        when the thumbnail aspect ratio doesn't match the button aspect ratio, to avoid showing a
        shaded background
        -->
    <ImageButton
        android:id="@+id/gallery"
        android:layout_width="44dp"
        android:layout_height="44dp"
        android:padding="0dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/gallery"
        app:srcCompat="@drawable/baseline_photo_library_white_48"
        android:background="#00000000"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedGallery"
        />

    <ImageButton
        android:id="@+id/settings"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/action_settings"
        app:srcCompat="@drawable/settings"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedSettings"
        />

    <ImageButton
        android:id="@+id/popup"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/action_popup"
        app:srcCompat="@drawable/popup"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedPopupSettings"
        />
    
    <ImageButton
        android:id="@+id/exposure"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/exposure"
        app:srcCompat="@drawable/ic_exposure_white_48dp"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedExposure"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/exposure_lock"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/exposure_lock"
        app:srcCompat="@drawable/exposure_unlocked"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedExposureLock"
        android:visibility="gone"
        />


    <ImageButton
        android:id="@+id/white_balance_lock"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/white_balance_lock"
        app:srcCompat="@drawable/white_balance_unlocked"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedWhiteBalanceLock"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/cycle_raw"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/cycle_raw"
        app:srcCompat="@drawable/raw_off_icon"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedCycleRaw"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/store_location"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/preference_location_enable"
        app:srcCompat="@drawable/ic_gps_fixed_white_48dp"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedStoreLocation"
        android:visibility="gone"
        />

    <!--<ImageButton
        android:id="@+id/switch_video"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/switch_to_video"
        android:src="@drawable/switch_video"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedSwitchVideo"
        />-->

    <!--<ImageButton
        android:id="@+id/switch_camera"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/switch_to_front_camera"
        android:src="@drawable/baseline_switch_camera_white_48"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedSwitchCamera"
        />-->

    <ImageButton
        android:id="@+id/text_stamp"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/preference_textstamp_summary"
        app:srcCompat="@drawable/baseline_text_fields_white_48"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedTextStamp"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/stamp"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/stamp_enable"
        app:srcCompat="@drawable/ic_text_format_white_48dp"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedStamp"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/focus_peaking"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/focus_peaking_enable"
        app:srcCompat="@drawable/key_visualizer"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedFocusPeaking"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/auto_level"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/auto_level_enable"
        app:srcCompat="@drawable/auto_stabilise_icon"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedAutoLevel"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/cycle_flash"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/cycle_flash"
        app:srcCompat="@drawable/flash_off"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedCycleFlash"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/face_detection"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/face_detection_enable"
        app:srcCompat="@drawable/ic_face_white_48dp"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedFaceDetection"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/audio_control"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/audio_control_start"
        app:srcCompat="@drawable/ic_mic_white_48dp"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedAudioControl"
        android:visibility="gone"
        />

    <ImageView
        android:id="@+id/kraken_icon"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/remote_connected"
        app:srcCompat="@drawable/baseline_bluetooth_white_48"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:visibility="gone"
        />

    <!-- should be at left-most -->
    <ImageButton
        android:id="@+id/trash"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/trash"
        app:srcCompat="@drawable/baseline_delete_white_48"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedTrash"
        android:visibility="gone"
        />

    <ImageButton
        android:id="@+id/share"
        android:layout_width="@dimen/onscreen_button_size"
        android:layout_height="@dimen/onscreen_button_size"
        android:padding="10dp"
        android:scaleType="fitCenter"
        android:contentDescription="@string/share"
        app:srcCompat="@drawable/share"
        android:background="@color/icons_background"
        android:backgroundTint="@color/icons_background_tint"
        android:backgroundTintMode="src_in"
        android:onClick="clickedShare"
        android:visibility="gone"
        />

    <LinearLayout
        android:id="@+id/sliders_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:orientation="vertical"
        android:background="@color/seekbar_background"
        android:visibility="gone"
        >

        <RelativeLayout
            android:id="@+id/iso_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone"
            >

            <RelativeLayout
                android:id="@+id/iso_buttons"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                >
            </RelativeLayout>

        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/exposure_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone"
            >

            <ImageView
                android:id="@+id/exposure_seekbar_text"
                android:contentDescription="@string/exposure_compensation"
                android:layout_width="30dp"
                android:layout_height="30dp"
                app:srcCompat="@drawable/ic_exposure_white_48dp"
                />

            <!-- alpha set as workaround for Android 7 bug where seekbar doesn't show when rotated -->
            <SeekBar
                android:id="@+id/exposure_seekbar"
                android:contentDescription="@string/exposure_compensation_seekbar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@+id/exposure_seekbar_text"
                android:layout_alignTop="@+id/exposure_seekbar_text"
                android:layout_alignBottom="@+id/exposure_seekbar_text"
                android:alpha="0.9"
                />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/manual_exposure_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone"
            >

            <ImageView
                android:id="@+id/iso_seekbar_text"
                android:contentDescription="@string/iso"
                android:layout_width="30dp"
                android:layout_height="30dp"
                app:srcCompat="@drawable/iso_icon"
                />

            <!-- alpha set as workaround for Android 7 bug where seekbar doesn't show when rotated -->
            <SeekBar
                android:id="@+id/iso_seekbar"
                android:contentDescription="@string/iso"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@+id/iso_seekbar_text"
                android:layout_alignTop="@+id/iso_seekbar_text"
                android:layout_alignBottom="@+id/iso_seekbar_text"
                android:alpha="0.9"
                />

            <ImageView
                android:id="@+id/exposure_time_seekbar_text"
                android:contentDescription="@string/exposure_shutter_speed"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_below="@+id/iso_seekbar"
                app:srcCompat="@drawable/baseline_shutter_speed_white_48"
                />

            <!-- alpha set as workaround for Android 7 bug where seekbar doesn't show when rotated -->
            <SeekBar
                android:id="@+id/exposure_time_seekbar"
                android:contentDescription="@string/exposure_shutter_speed"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@+id/exposure_time_seekbar_text"
                android:layout_alignTop="@+id/exposure_time_seekbar_text"
                android:layout_alignBottom="@+id/exposure_time_seekbar_text"
                android:alpha="0.9"
                />

        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/manual_white_balance_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone"
            >

            <ImageView
                android:id="@+id/white_balance_seekbar_text"
                android:contentDescription="@string/white_balance"
                android:layout_width="30dp"
                android:layout_height="30dp"
                app:srcCompat="@drawable/ic_colorize_white_48dp"
                />

            <!-- alpha set as workaround for Android 7 bug where seekbar doesn't show when rotated -->
            <SeekBar
                android:id="@+id/white_balance_seekbar"
                android:contentDescription="@string/white_balance"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@+id/white_balance_seekbar_text"
                android:layout_alignTop="@+id/white_balance_seekbar_text"
                android:layout_alignBottom="@+id/white_balance_seekbar_text"
                android:alpha="0.9"
                />

        </RelativeLayout>

    </LinearLayout>

    <FrameLayout
        android:id="@+id/locker"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />

    <ScrollView
        android:id="@+id/popup_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fadeScrollbars="false"
        />
    
    <ScrollView
        android:id="@+id/hide_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/black"
        android:visibility="gone"
        android:importantForAccessibility="no"
        />
    
</RelativeLayout>
