aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/app/src/main/res/layout/tunnel_list_fragment.xml
blob: 482931332b9e525cdb4d2d25b57b164296e464e9 (plain) (tree)
1
2
3
4
5
6
7
8





                                                                  

                                                            




                                                                       



                                                                                                                  
                          
                                                                                          

           
                                                    


                                            

                                                          
 
                                               


                                                
                                                                           
                                         
                                                    
                                                                                                           
                                  

                                                                    
 
                                                             
                                         
                                        


                                                
                                                     
                                                 
                                                            
                                                                                                 
 
                                                                         



                                                                    
                                  
                                                              

                                                       
                                                                         



                                                                    
                                                              
                                  
                                                           
                                                               
 
                     

                                                
                                          

                                                                                                            








                                                                        


                                                    



                                                                 
                                                      
         
<?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">

    <data>

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

        <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.util.ObservableKeyedList&lt;String, Tunnel&gt;" />
    </data>

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

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

        <com.wireguard.android.widget.fab.FloatingActionsMenu
            android:id="@+id/create_menu"
            android:clipChildren="false"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="@dimen/fab_margin"
            app:fab_labelStyle="@style/fab_label"
            app:fab_labelsPosition="@integer/label_position"
            app:layout_behavior="com.wireguard.android.widget.fab.FloatingActionButtonBehavior" >

            <com.wireguard.android.widget.fab.LabeledFloatingActionButton
                android:id="@+id/create_empty"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="@{fragment::onRequestCreateConfig}"
                app:fabSize="mini"
                app:srcCompat="@drawable/ic_action_edit_white"
                app:fab_title="@string/create_empty" />

            <com.wireguard.android.widget.fab.LabeledFloatingActionButton
                android:id="@+id/create_from_file"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="@{fragment::onRequestImportConfig}"
                app:srcCompat="@drawable/ic_action_open_white"
                app:fabSize="mini"
                app:fab_title="@string/create_from_file" />
        </com.wireguard.android.widget.fab.FloatingActionsMenu>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:visibility="@{tunnels.size() == 0 ? android.view.View.VISIBLE : android.view.View.GONE}"
            android:layout_gravity="center">
            <android.support.v7.widget.AppCompatImageView
                android:id="@+id/logo_placeholder"
                android:layout_width="140dp"
                android:layout_height="140dp"
                android:layout_gravity="center"
                android:tint="@color/transparent_background_placeholder"
                android:layout_marginTop="-70dp"
                android:layout_marginBottom="20dp"
                android:src="@mipmap/ic_launcher" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:textSize="20sp"
                android:text="@string/tunnel_list_placeholder" />
        </LinearLayout>
    </android.support.design.widget.CoordinatorLayout>
</layout>