<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:bind="http://schemas.android.com/apk/res-auto"
    >

  <data>
    <variable
        name="fileSize"
        type="String"
        />
    <variable
        name="speed"
        type="String"
        />
    <variable
        name="progress"
        type="int"
        />
    <variable
        name="stateStr"
        type="String"
        />

    <variable
        name="url"
        type="String"
        />
    <variable
        name="filePath"
        type="String"
        />
    <variable
        name="hint"
        type="String"
        />
    <variable
        name="viewModel"
        type="com.arialyy.simple.core.download.m3u8.M3U8LiveDLoadActivity"
        />
  </data>

  <LinearLayout
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      android:orientation="vertical"
      tools:context=".core.download.SingleTaskActivity"
      >

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

    <com.arialyy.simple.widget.SvgTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="16dp"
        bind:iconClickListener="@{() -> viewModel.chooseUrl()}"
        bind:svg_text_view_icon="@drawable/ic_modify"
        bind:text="@{@string/url(url)}"
        />

    <com.arialyy.simple.widget.SvgTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="8dp"
        bind:iconClickListener="@{() -> viewModel.chooseFilePath()}"
        bind:svg_text_view_icon="@drawable/ic_choose_file"
        bind:text="@{@string/file_path(filePath)}"
        />

    <TextView
        android:id="@+id/hint"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@{hint}"
        android:textColor="@color/black"
        />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
      <TextView
          android:id="@+id/speed"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginLeft="16dp"
          android:layout_weight="1"
          android:text="@{speed}"
          android:textColor="@color/black"
          />

      <Button
          android:id="@+id/start"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:onClick="onClick"
          android:text="@{stateStr ?? @string/start}"
          style="?buttonBarButtonStyle"
          />

    </LinearLayout>


  </LinearLayout>
</layout>