Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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.ExtensionsKt" />
- <import type="com.wireguard.android.widget.KeyInputFilter" />
- <import type="com.wireguard.android.widget.NameInputFilter" />
- <import type="com.wireguard.config.Peer" />
- <variable
- name="fragment"
- type="com.wireguard.android.fragment.TunnelEditorFragment" />
- <variable
- name="config"
- type="com.wireguard.config.Config.Observable" />
- </data>
- <androidx.coordinatorlayout.widget.CoordinatorLayout
- android:id="@+id/main_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="?android:attr/colorBackground">
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <androidx.cardview.widget.CardView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginTop="8dp"
- android:layout_marginEnd="8dp"
- android:layout_marginBottom="4dp"
- android:background="?android:attr/colorBackground"
- app:cardCornerRadius="4dp"
- app:cardElevation="2dp"
- app:contentPadding="8dp">
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <TextView
- android:id="@+id/interface_title"
- style="@style/TextAppearance.MaterialComponents.Headline6"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:text="@string/interface_title" />
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/interface_name_layout"
- style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox.Dense"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/interface_title"
- android:layout_alignParentStart="true"
- android:layout_marginTop="8dp">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/interface_name_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/name"
- android:inputType="textNoSuggestions|textVisiblePassword"
- android:text="@={config.name}"
- app:filter="@{NameInputFilter.newInstance()}" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/private_key_text_layout"
- style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox.Dense"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/interface_name_layout"
- android:layout_alignParentStart="true">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/private_key_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:contentDescription="@string/public_key_description"
- android:hint="@string/private_key"
- android:inputType="textNoSuggestions|textVisiblePassword"
- android:text="@={config.interfaceSection.privateKey}"
- app:filter="@{KeyInputFilter.newInstance()}" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/public_key_label_layout"
- style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox.Dense"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/private_key_text_layout"
- android:layout_alignParentStart="true">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/public_key_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:focusable="false"
- android:hint="@string/hint_generated"
- android:maxLines="1"
- android:onClick="@{ExtensionsKt::copyTextView}"
- android:text="@{config.interfaceSection.publicKey}" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/addresses_label_layout"
- style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox.Dense"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/public_key_label_layout"
- android:layout_alignParentStart="true"
- android:layout_toStartOf="@+id/listen_port_label_layout">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/addresses_label_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:hint="@string/addresses"
- android:inputType="textNoSuggestions|textVisiblePassword"
- android:text="@={config.interfaceSection.addresses}" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/listen_port_layout"
- style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox.Dense"
- android:layout_width="96dp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/addresses_label_layout"
- android:layout_alignParentEnd="true">
- <com.google.android.material.textfield.TextInputEditText
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/listen_port"
- android:inputType="number"
- android:text="@={config.interfaceSection.listenPort}"
- android:textAlignment="center" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/dns_servers_label_layout"
- style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox.Dense"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/listen_port_layout"
- android:layout_alignParentStart="true"
- android:layout_toStartOf="@+id/mtu_label_layout">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/dns_servers_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/dns_servers"
- android:inputType="textNoSuggestions|textVisiblePassword"
- android:text="@={config.interfaceSection.dnses}" />
- </com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/mtu_label_layout"
- style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox.Dense"
- android:layout_width="96dp"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@id/dns_servers_label_layout"
- android:layout_alignParentEnd="true">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/mtu_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/mtu"
- android:inputType="number"
- android:text="@={config.interfaceSection.mtu}"
- android:textAlignment="center" />
- </com.google.android.material.textfield.TextInputLayout>
- <Button
- android:id="@+id/set_excluded_applications"
- style="@style/Widget.MaterialComponents.Button.TextButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/dns_servers_label_layout"
- android:layout_margin="8dp"
- android:onClick="@{fragment::onRequestSetExcludedApplications}"
- android:text="@{@plurals/set_excluded_applications(config.interfaceSection.excludedApplicationsCount, config.interfaceSection.excludedApplicationsCount)}" />
- <Button
- android:id="@+id/generate_private_key_button"
- style="@style/Widget.MaterialComponents.Button.TextButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/dns_servers_label_layout"
- android:layout_alignParentEnd="true"
- android:layout_margin="8dp"
- android:onClick="@{() -> config.interfaceSection.generateKeypair()}"
- android:text="@string/generate" />
- </RelativeLayout>
- </androidx.cardview.widget.CardView>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:divider="@null"
- android:orientation="vertical"
- app:items="@{config.peers}"
- app:layout="@{@layout/tunnel_editor_peer}"
- tools:ignore="UselessLeaf" />
- <Button
- style="@style/Widget.MaterialComponents.Button.TextButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="8dp"
- android:onClick="@{() -> config.peers.add(Peer.Observable.newInstance())}"
- android:text="@string/add_peer" />
- </LinearLayout>
- </ScrollView>
- </androidx.coordinatorlayout.widget.CoordinatorLayout>
- </layout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement