129 lines
5.6 KiB
XML
129 lines
5.6 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="com.wireguard.android.util.ClipboardUtils" />
|
|
|
|
<variable
|
|
name="item"
|
|
type="com.wireguard.config.Peer" />
|
|
</data>
|
|
|
|
<com.google.android.material.card.MaterialCardView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_margin="8dp"
|
|
app:cardBackgroundColor="?attr/elevationOverlayColor"
|
|
app:cardCornerRadius="0dp"
|
|
app:cardElevation="2dp"
|
|
app:contentPadding="8dp">
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<com.google.android.material.textview.MaterialTextView
|
|
android:id="@+id/peer_title"
|
|
style="@style/SectionText"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@string/peer"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"/>
|
|
|
|
<TextView
|
|
android:id="@+id/public_key_label"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="8dp"
|
|
android:labelFor="@+id/public_key_text"
|
|
android:text="@string/public_key"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@id/peer_title"/>
|
|
|
|
<TextView
|
|
android:id="@+id/public_key_text"
|
|
style="@style/DetailText"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:contentDescription="@string/public_key_description"
|
|
android:ellipsize="end"
|
|
android:singleLine="true"
|
|
android:maxLines="1"
|
|
android:onClick="@{ClipboardUtils::copyTextView}"
|
|
android:text="@{item.publicKey.toBase64}"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/public_key_label"
|
|
tools:text="wOs2eguFEohqIZxlSJ1CAT9584tc6ejj9hfGFsoBVkA="/>
|
|
|
|
<TextView
|
|
android:id="@+id/allowed_ips_label"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="8dp"
|
|
android:labelFor="@+id/allowed_ips_text"
|
|
android:text="@string/allowed_ips"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/public_key_text"/>
|
|
|
|
<TextView
|
|
android:id="@+id/allowed_ips_text"
|
|
style="@style/DetailText"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@{item.allowedIps}"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/allowed_ips_label"
|
|
tools:text="0.0.0.0/5, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3"/>
|
|
|
|
<TextView
|
|
android:id="@+id/endpoint_label"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="8dp"
|
|
android:labelFor="@+id/endpoint_text"
|
|
android:text="@string/endpoint"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/allowed_ips_text"/>
|
|
|
|
<TextView
|
|
android:id="@+id/endpoint_text"
|
|
style="@style/DetailText"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="@{item.endpoint}"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/endpoint_label"
|
|
tools:text="192.168.0.1:51820" />
|
|
|
|
<TextView
|
|
android:id="@+id/transfer_label"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_below="@+id/endpoint_text"
|
|
android:layout_marginTop="8dp"
|
|
android:labelFor="@+id/transfer_text"
|
|
android:text="@string/transfer"
|
|
android:visibility="gone"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/endpoint_text"
|
|
tools:visibility="visible" />
|
|
|
|
<TextView
|
|
android:id="@+id/transfer_text"
|
|
style="@style/DetailText"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_below="@+id/transfer_label"
|
|
android:visibility="gone"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/transfer_label"
|
|
tools:visibility="visible"
|
|
tools:text="1024 MB" />
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
</com.google.android.material.card.MaterialCardView>
|
|
</layout>
|