aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/res/layout/tunnel_list_fragment.xml
blob: 277ecd01b852293fe7b27fe4a2250c9a507b145a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="utf-8"?>
<layout 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">

    <data>

        <import type="com.wireguard.android.model.ObservableTunnel" />

        <variable
            name="fragment"
            type="com.wireguard.android.fragment.TunnelListFragment" />

        <variable
            name="rowConfigurationHandler"
            type="com.wireguard.android.databinding.ObservableKeyedRecyclerViewAdapter.RowConfigurationHandler" />

        <variable
            name="tunnels"
            type="com.wireguard.android.databinding.ObservableKeyedArrayList&lt;String, ObservableTunnel&gt;" />
    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/main_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="?attr/colorBackground"
        android:clipChildren="false">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/tunnel_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:choiceMode="multipleChoiceModal"
            android:clipToPadding="false"
            android:paddingBottom="@{@dimen/design_fab_size_normal * 1.1f}"
            android:visibility="@{tunnels.size() > 0 ? android.view.View.VISIBLE : android.view.View.GONE}"
            app:configurationHandler="@{rowConfigurationHandler}"
            app:items="@{tunnels}"
            app:layout="@{@layout/tunnel_list_item}"
            tools:itemCount="12"
            tools:listitem="@layout/tunnel_list_item" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:orientation="vertical"
            android:visibility="@{tunnels.size() == 0 ? android.view.View.VISIBLE : android.view.View.GONE}"
            tools:visibility="gone">

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/logo_placeholder"
                android:layout_width="140dp"
                android:layout_height="140dp"
                android:layout_gravity="center"
                android:layout_marginBottom="20dp"
                android:alpha="0.3333333"
                android:src="@mipmap/ic_launcher" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:text="@string/tunnel_list_placeholder"
                android:textSize="20sp" />
        </LinearLayout>

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/create_fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="@dimen/fab_margin"
            app:srcCompat="@drawable/ic_action_add_white" />

    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>