<?xml version="1.0" encoding="utf-8"?>
<!--
  ~             Twidere - Twitter client for Android
  ~
  ~  Copyright (C) 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
  ~
  ~  This program is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation, either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~  This program is distributed in the hope that it will be useful,
  ~  but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~  GNU General Public License for more details.
  ~
  ~  You should have received a copy of the GNU General Public License
  ~  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/videoControl"
    android:layout_width="match_parent"
    android:layout_height="?actionBarSize"
    android:layout_gravity="bottom"
    android:background="@drawable/bg_viewer_actionbar"
    android:clickable="true"
    android:focusable="true">

    <FrameLayout
        android:id="@+id/playPauseContainer"
        android:layout_width="@dimen/element_size_normal"
        android:layout_height="@dimen/element_size_normal"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_centerVertical="true">

        <ImageButton
            android:id="@id/exo_play"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="?selectableItemBackgroundBorderless"
            android:clickable="true"
            android:contentDescription="@string/exo_controls_play_description"
            android:focusable="true"
            android:src="@drawable/ic_action_play_arrow"
            tools:visibility="visible"/>

        <ImageButton
            android:id="@id/exo_pause"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="?selectableItemBackgroundBorderless"
            android:clickable="true"
            android:contentDescription="@string/exo_controls_pause_description"
            android:focusable="true"
            android:src="@drawable/ic_action_pause"
            tools:visibility="gone"/>
    </FrameLayout>

    <org.mariotaku.twidere.view.FixedTextView
        android:id="@id/exo_position"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@id/exo_progress"
        android:layout_alignParentBottom="true"
        android:layout_alignStart="@id/exo_progress"
        android:layout_marginBottom="@dimen/element_spacing_xsmall"
        android:layout_marginLeft="@dimen/element_spacing_small"
        android:layout_marginStart="@dimen/element_spacing_small"
        android:gravity="center"
        android:textColor="?android:textColorPrimary"
        android:textSize="@dimen/text_size_extra_small"
        tools:text="--:--"/>

    <SeekBar
        android:id="@id/exo_progress"
        style="?android:progressBarStyleHorizontal"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_toEndOf="@+id/playPauseContainer"
        android:layout_toLeftOf="@+id/volumeButton"
        android:layout_toRightOf="@+id/playPauseContainer"
        android:layout_toStartOf="@+id/volumeButton"/>

    <org.mariotaku.twidere.view.FixedTextView
        android:id="@id/exo_duration"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignEnd="@id/exo_progress"
        android:layout_alignParentBottom="true"
        android:layout_alignRight="@id/exo_progress"
        android:layout_marginBottom="@dimen/element_spacing_xsmall"
        android:layout_marginEnd="@dimen/element_spacing_small"
        android:layout_marginRight="@dimen/element_spacing_small"
        android:gravity="center"
        android:textColor="?android:textColorPrimary"
        android:textSize="@dimen/text_size_extra_small"
        tools:text="--:--"/>

    <ImageButton
        android:id="@+id/volumeButton"
        android:layout_width="@dimen/element_size_normal"
        android:layout_height="@dimen/element_size_normal"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:background="?selectableItemBackgroundBorderless"
        android:clickable="true"
        android:contentDescription="@string/action_mute"
        android:focusable="true"
        android:minWidth="@dimen/element_size_normal"
        android:src="@drawable/ic_action_speaker_max"/>

</RelativeLayout>