subtitle_download_item.xml 3.84 KB
Newer Older
Habib Kazemi's avatar
Habib Kazemi committed
1 2 3 4 5 6 7 8 9 10 11
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <data>
        <import type="android.view.View"/>
        <import type="org.videolan.vlc.gui.dialogs.State"/>
        <variable name="subtitleItem"
            type="org.videolan.vlc.gui.dialogs.SubtitleItem"/>
    </data>

12
    <androidx.constraintlayout.widget.ConstraintLayout
Habib Kazemi's avatar
Habib Kazemi committed
13 14
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
15 16 17
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:background="?android:attr/selectableItemBackground"
Habib Kazemi's avatar
Habib Kazemi committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
        android:minHeight="50dp"
        android:focusable="true">

        <TextView
            android:id="@+id/sub_title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="2dp"
            android:layout_marginTop="2dp"
            android:layout_marginEnd="4dp"
            android:text="@{subtitleItem.movieReleaseName.trim()}"
            android:textColor="?attr/font_default"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/language"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="Attack.on.Titan.S02E01.DUBBED.HDTV.x264-W4F" />

        <TextView
            android:id="@+id/language"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_marginEnd="8dp"
            android:text="@{subtitleItem.subLanguageID.trim()}"
            android:textAlignment="center"
            android:gravity="center_vertical"
            android:textColor="?attr/font_light"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/barrier"
            app:layout_constraintHorizontal_bias="0.5"
            app:layout_constraintStart_toEndOf="@+id/sub_title"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="En" />

        <ImageView
            android:id="@+id/download_sub"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginEnd="8dp"
            android:visibility="@{subtitleItem.state == State.Downloading ? View.GONE : View.VISIBLE}"
            android:contentDescription="Download"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
63
            android:src="@{subtitleItem.state == State.Downloaded ? @drawable/ic_ctx_done_normal : @drawable/ic_ctx_download_subtitles_normal }"/>
Habib Kazemi's avatar
Habib Kazemi committed
64 65 66 67 68 69 70 71 72 73 74 75 76 77

        <ProgressBar
            android:id="@+id/loading"
            style="?android:attr/progressBarStyleSmallTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="38dp"
            android:visibility="@{subtitleItem.state == State.Downloading ? View.VISIBLE : View.GONE}"
            android:padding="5dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/download_sub"
            app:layout_constraintTop_toTopOf="parent" />

78
        <androidx.constraintlayout.widget.Barrier
Habib Kazemi's avatar
Habib Kazemi committed
79 80 81 82 83
            android:id="@+id/barrier"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:barrierDirection="start"
            app:constraint_referenced_ids="loading,download_sub" />
84
    </androidx.constraintlayout.widget.ConstraintLayout>
Habib Kazemi's avatar
Habib Kazemi committed
85
</layout>