directory_view_item.xml 4.68 KB
Newer Older
Edward Wang's avatar
Edward Wang committed
1
<?xml version="1.0" encoding="utf-8"?>
2 3
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:vlc="http://schemas.android.com/apk/res-auto">
4 5 6
    <data>
        <import type="android.view.View"/>
        <variable
7 8
            name="holder"
            type="org.videolan.vlc.gui.browser.BaseBrowserAdapter.ViewHolder"/>
9 10
        <variable
            name="media"
11
            type="org.videolan.vlc.media.MediaWrapper"/>
12 13 14 15 16 17 18 19 20 21
        <variable
            name="storage"
            type="org.videolan.vlc.gui.browser.BaseBrowserAdapter.Storage"/>
        <variable
            name="type"
            type="int"/>
        <variable
            name="hasContextMenu"
            type="boolean"/>
        <variable
22
            name="checkEnabled"
23 24 25 26
            type="boolean"/>
        <variable
            name="checked"
            type="boolean"/>
27
        <variable
Geoffrey Métais's avatar
Geoffrey Métais committed
28
            name="protocol"
29
            type="String"/>
30 31 32
        <variable
            name="image"
            type="android.graphics.drawable.BitmapDrawable"/>
33
    </data>
Edward Wang's avatar
Edward Wang committed
34
    <LinearLayout
35
        android:id="@+id/layout_item"
36 37
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
38 39
        android:orientation="horizontal"
        android:focusable="true"
40
        android:clickable="@{holder != null}"
41
        android:longClickable="@{hasContextMenu || storage != null}"
42
        android:onClick="@{holder.onClick}"
43
        android:background="@drawable/background_item">
Edward Wang's avatar
Edward Wang committed
44

45 46
        <CheckBox
            android:id="@+id/browser_checkbox"
Edward Wang's avatar
Edward Wang committed
47 48
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
49
            android:layout_gravity="center_vertical"
50 51
            android:layout_marginLeft="15dp"
            android:visibility="@{type == 2 ? View.VISIBLE : View.GONE}"
52
            android:focusable="false"
53
            android:enabled="@{checkEnabled}"
54
            android:checked="@{checked}"
55
            android:onClick="@{holder.onCheckBoxClick}"/>
Edward Wang's avatar
Edward Wang committed
56

57
        <!-- Image downloading is handled by org.videolan.vlc.gui.helpers.AsyncImageLoader.downloadIcon() -->
58
        <TextView
59 60 61 62
            android:id="@+id/dvi_icon"
            android:layout_width="@dimen/directory_browser_item_size"
            android:layout_height="@dimen/directory_browser_item_size"
            android:layout_gravity="center"
63
            android:gravity="center"
64 65 66
            android:layout_marginLeft="15dp"
            android:contentDescription="@string/cover_art"
            android:visibility="@{type != 2 ? View.VISIBLE : View.GONE}"
Geoffrey Métais's avatar
Geoffrey Métais committed
67
            android:text="@{protocol}"
68
            android:textSize="11sp"
69
            android:textColor="@color/whitetransparent"
70 71
            android:background="@{image}"
            vlc:mediaWithArt="@{media}" />
72

73
        <LinearLayout
74
            android:layout_width="0dp"
75
            android:layout_height="wrap_content"
Geoffrey Métais's avatar
Geoffrey Métais committed
76 77
            android:layout_marginBottom="2dp"
            android:layout_marginTop="2dp"
78
            android:layout_weight="1"
Geoffrey Métais's avatar
Geoffrey Métais committed
79
            android:minHeight="52dp"
80 81 82
            android:gravity="center_vertical"
            android:orientation="vertical"
            android:paddingLeft="15dp" >
83

84 85 86
            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
87
                android:layout_height="wrap_content"
88 89 90 91 92 93
                android:ellipsize="marquee"
                android:marqueeRepeatLimit="marquee_forever"
                android:singleLine="true"
                android:text="@{storage.name ?? media.title}"
                android:fontFamily="sans-serif-light"
                android:textColor="?attr/list_title"
94
                android:textSize="16sp"/>
95 96 97 98 99 100 101 102 103

            <TextView
                android:id="@+id/text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="marquee"
                android:maxLines="1"
                android:text="@{media.description}"
                android:fontFamily="sans-serif-light"
104
                android:visibility="@{media.description != null ? View.VISIBLE : View.GONE}"
105
                android:textColor="?attr/list_subtitle"/>
106
        </LinearLayout>
107 108 109 110 111 112 113 114 115 116

        <ImageView
            android:id="@+id/item_more"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:paddingRight="10dp"
            android:paddingLeft="10dp"
            android:background="@drawable/ic_more"
            android:visibility="@{hasContextMenu ? View.VISIBLE : View.GONE}"
117
            android:onClick="@{holder.onMoreClick}"
118
            android:clickable="@{hasContextMenu}" />
119

120 121
    </LinearLayout>
</layout>