<androidx.coordinatorlayout.widget.CoordinatorLayout 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="com.castlabs.sdk.demos.AbrPlaybackDemo">

	<androidx.constraintlayout.widget.ConstraintLayout
		android:layout_width="match_parent"
		android:layout_height="match_parent">

		<FrameLayout
			android:id="@+id/frameLayout"
			android:layout_width="600dp"
			android:layout_height="0dp"
			android:background="#000000"
			app:layout_constraintDimensionRatio="H,16:9"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toTopOf="parent">

			<com.castlabs.android.player.PlayerView
				android:id="@+id/player_view"
				android:layout_width="match_parent"
				android:layout_height="match_parent"
				android:layout_gravity="center" />

			<com.castlabs.sdk.playerui.PlayerControllerProgressBar
				android:id="@+id/progress_bar"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_gravity="center"
				android:visibility="gone"
				tools:visibility="visible" />

			<com.castlabs.sdk.playerui.PlayerControllerView
				android:id="@+id/player_controls"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:layout_gravity="bottom"
				android:background="#55000000"
				app:animation_view_position="bottom"
				app:controller_layout_id="@layout/cl_player_controller_view" />
		</FrameLayout>

		<Button
			android:id="@+id/reloadBtn"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginStart="8dp"
			android:layout_marginLeft="8dp"
			android:layout_marginEnd="8dp"
			android:layout_marginRight="8dp"
			android:background="?attr/selectableItemBackgroundBorderless"
			android:src="@drawable/cl_ic_autorenew_black_24dp"
			android:text="Restart"
			app:layout_constraintBottom_toBottomOf="parent"
			app:layout_constraintEnd_toStartOf="@+id/rateLimitLabel"
			app:layout_constraintHorizontal_bias="0.0"
			app:layout_constraintHorizontal_chainStyle="packed"
			app:layout_constraintStart_toStartOf="parent" />


		<TextView
			android:id="@+id/rateLimitLabel"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginStart="8dp"
			android:layout_marginLeft="8dp"
			android:layout_marginEnd="8dp"
			android:layout_marginRight="8dp"
			android:text="Rate Limit: disabled"
			app:layout_constraintBottom_toBottomOf="@+id/reloadBtn"
			app:layout_constraintEnd_toStartOf="@+id/rateLimitBar"
			app:layout_constraintHorizontal_bias="0.5"
			app:layout_constraintStart_toEndOf="@+id/reloadBtn"
			app:layout_constraintTop_toTopOf="@+id/reloadBtn" />

		<SeekBar
			android:id="@+id/rateLimitBar"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginEnd="8dp"
			android:layout_marginRight="8dp"
			app:layout_constraintBottom_toBottomOf="@+id/rateLimitLabel"
			app:layout_constraintEnd_toStartOf="@+id/enableTracesSwitch"
			app:layout_constraintStart_toEndOf="@+id/rateLimitLabel"
			app:layout_constraintTop_toTopOf="@+id/rateLimitLabel" />

		<androidx.viewpager.widget.ViewPager
			android:id="@+id/viewPager"
			android:layout_width="0dp"
			android:layout_height="0dp"
			android:layout_marginStart="8dp"
			android:layout_marginLeft="8dp"
			android:layout_marginTop="4dp"
			android:layout_marginEnd="8dp"
			android:layout_marginRight="8dp"
			app:layout_constraintBottom_toTopOf="@+id/reloadBtn"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@+id/tabLayout" />

		<com.google.android.material.tabs.TabLayout
			android:id="@+id/tabLayout"
			android:layout_width="0dp"
			android:layout_height="wrap_content"
			android:layout_marginTop="8dp"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toStartOf="parent"
			app:layout_constraintTop_toBottomOf="@+id/frameLayout"
			app:tabMode="scrollable">

			<com.google.android.material.tabs.TabItem
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:text="Left" />

			<com.google.android.material.tabs.TabItem
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:text="Center" />

			<com.google.android.material.tabs.TabItem
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:text="Right" />
		</com.google.android.material.tabs.TabLayout>

		<fragment
			android:id="@+id/plotsFragment"
			android:name="com.castlabs.sdk.debug.view.AbrPlotsFragment"
			android:layout_width="0dp"
			android:layout_height="0dp"
			app:layout_constraintBottom_toBottomOf="@+id/frameLayout"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintStart_toEndOf="@+id/frameLayout"
			app:layout_constraintTop_toTopOf="parent" />

		<Button
			android:id="@+id/showTracesBtn"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginEnd="8dp"
			android:layout_marginRight="8dp"
			android:background="?attr/selectableItemBackgroundBorderless"
			android:text="Traces"
			app:layout_constraintBottom_toBottomOf="@+id/reloadBtn"
			app:layout_constraintEnd_toEndOf="parent"
			app:layout_constraintTop_toTopOf="@+id/reloadBtn" />

		<com.google.android.material.switchmaterial.SwitchMaterial
			android:id="@+id/enableTracesSwitch"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_marginEnd="8dp"
			android:layout_marginRight="8dp"
			android:text="Use Traces"
			app:layout_constraintBaseline_toBaselineOf="@+id/showTracesBtn"
			app:layout_constraintEnd_toStartOf="@+id/showTracesBtn" />

		<com.github.mikephil.charting.charts.LineChart
			android:id="@+id/currentTraceChart"
			android:layout_width="0dp"
			android:layout_height="0dp"
			android:layout_marginStart="8dp"
			android:layout_marginLeft="8dp"
			android:layout_marginEnd="8dp"
			android:layout_marginRight="8dp"
			android:visibility="gone"
			app:layout_constraintBottom_toBottomOf="parent"
			app:layout_constraintEnd_toStartOf="@+id/enableTracesSwitch"
			app:layout_constraintStart_toEndOf="@+id/reloadBtn"
			app:layout_constraintTop_toTopOf="@+id/reloadBtn"
			tools:visibility="visible" />

	</androidx.constraintlayout.widget.ConstraintLayout>

	<LinearLayout
		android:id="@+id/tracesSheet"
		android:layout_width="match_parent"
		android:layout_height="350dp"
		android:background="@color/cl_white"
		android:orientation="vertical"
		app:behavior_hideable="true"
		app:behavior_peekHeight="0dp"
		app:behavior_skipCollapsed="true"
		app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

		<TextView
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:text="Traces" />

		<include layout="@layout/cl_traces" />

	</LinearLayout>


</androidx.coordinatorlayout.widget.CoordinatorLayout>

