82 lines
3.5 KiB
XML
82 lines
3.5 KiB
XML
<?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="android.view.View" />
|
|
|
|
<import type="com.wireguard.android.model.ObservableTunnel" />
|
|
|
|
<variable
|
|
name="isDeleting"
|
|
type="androidx.databinding.ObservableBoolean" />
|
|
|
|
<variable
|
|
name="tunnels"
|
|
type="com.wireguard.android.databinding.ObservableKeyedArrayList<String, ObservableTunnel>" />
|
|
|
|
<variable
|
|
name="rowConfigurationHandler"
|
|
type="com.wireguard.android.databinding.ObservableKeyedRecyclerViewAdapter.RowConfigurationHandler" />
|
|
</data>
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<!-- TODO: Make into a neat square above the selection squares -->
|
|
<ImageView
|
|
android:id="@+id/banner_logo"
|
|
android:layout_width="240dp"
|
|
android:layout_height="50dp"
|
|
android:contentDescription="@string/app_name"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:srcCompat="@drawable/tv_logo_banner" />
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/tunnel_list"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:layout_marginTop="16dp"
|
|
android:orientation="horizontal"
|
|
app:configurationHandler="@{rowConfigurationHandler}"
|
|
app:items="@{tunnels}"
|
|
app:layout="@{@layout/tv_tunnel_list_item}"
|
|
app:layout_constraintBottom_toTopOf="@id/import_button"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@id/banner_logo"
|
|
tools:itemCount="10"
|
|
tools:listitem="@layout/tv_tunnel_list_item" />
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/import_button"
|
|
style="@style/Widget.MaterialComponents.Button"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_margin="16dp"
|
|
android:text="@string/create_from_file"
|
|
android:textColor="?attr/colorOnPrimary"
|
|
android:visibility="@{isDeleting ? View.GONE : View.VISIBLE}"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent" />
|
|
|
|
<!-- TODO: ic_action_generate is wrong. this should instead be a "return"/"back" icon -->
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/delete_button"
|
|
style="@style/Widget.MaterialComponents.Button"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_margin="16dp"
|
|
android:minWidth="0dp"
|
|
android:visibility="@{tunnels.isEmpty && !isDeleting ? View.GONE : View.VISIBLE}"
|
|
app:icon="@{isDeleting ? @drawable/ic_arrow_back : @drawable/ic_action_delete}"
|
|
app:iconPadding="0dp"
|
|
app:iconTint="?attr/colorOnPrimary"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent" />
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
</layout>
|