diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-05-02 11:33:03 +0530 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-05-03 23:45:03 -0500 |
commit | 59aa3035a8581a687efc7a3b4df5952dffdfecfe (patch) | |
tree | 2a8c0b9d9450d96c91c1f5eb5c3109abe964c209 /app/src/main/res/layout/tunnel_detail_peer.xml | |
parent | tools: include libmnl paths after system paths for ndk 17 (diff) | |
download | wireguard-android-59aa3035a8581a687efc7a3b4df5952dffdfecfe.tar.xz wireguard-android-59aa3035a8581a687efc7a3b4df5952dffdfecfe.zip |
ui: Use a proper CardView based layout
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/res/layout/tunnel_detail_peer.xml')
-rw-r--r-- | app/src/main/res/layout/tunnel_detail_peer.xml | 127 |
1 files changed, 67 insertions, 60 deletions
diff --git a/app/src/main/res/layout/tunnel_detail_peer.xml b/app/src/main/res/layout/tunnel_detail_peer.xml index d2240e31..91be0011 100644 --- a/app/src/main/res/layout/tunnel_detail_peer.xml +++ b/app/src/main/res/layout/tunnel_detail_peer.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<layout xmlns:android="http://schemas.android.com/apk/res/android"> +<layout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> <data> @@ -10,7 +11,7 @@ type="com.wireguard.config.Peer.Observable" /> </data> - <RelativeLayout + <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="4dp" @@ -18,70 +19,76 @@ android:layout_marginStart="8dp" android:layout_marginTop="4dp" android:background="?android:attr/colorBackground" - android:elevation="2dp" - android:padding="8dp"> + app:cardCornerRadius="4dp" + app:cardElevation="2dp" + app:contentPadding="8dp"> - <TextView - android:id="@+id/peer_title" - style="?android:attr/textAppearanceMedium" + <RelativeLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:text="@string/peer" /> + android:layout_height="wrap_content"> - <TextView - android:id="@+id/public_key_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/peer_title" - android:layout_marginTop="8dp" - android:labelFor="@+id/public_key_text" - android:text="@string/public_key" /> + <TextView + android:id="@+id/peer_title" + style="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:text="@string/peer" /> - <TextView - android:id="@+id/public_key_text" - style="?android:attr/textAppearanceMedium" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/public_key_label" - android:contentDescription="@string/public_key_description" - android:ellipsize="end" - android:maxLines="1" - android:onClick="@{ClipboardUtils::copyTextView}" - android:text="@{item.publicKey}" /> + <TextView + android:id="@+id/public_key_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/peer_title" + android:layout_marginTop="8dp" + android:labelFor="@+id/public_key_text" + android:text="@string/public_key" /> - <TextView - android:id="@+id/allowed_ips_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/public_key_text" - android:layout_marginTop="8dp" - android:labelFor="@+id/allowed_ips_text" - android:text="@string/allowed_ips" /> + <TextView + android:id="@+id/public_key_text" + style="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/public_key_label" + android:contentDescription="@string/public_key_description" + android:ellipsize="end" + android:maxLines="1" + android:onClick="@{ClipboardUtils::copyTextView}" + android:text="@{item.publicKey}" /> - <TextView - android:id="@+id/allowed_ips_text" - style="?android:attr/textAppearanceMedium" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/allowed_ips_label" - android:text="@{item.allowedIPs}" /> + <TextView + android:id="@+id/allowed_ips_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/public_key_text" + android:layout_marginTop="8dp" + android:labelFor="@+id/allowed_ips_text" + android:text="@string/allowed_ips" /> - <TextView - android:id="@+id/endpoint_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/allowed_ips_text" - android:layout_marginTop="8dp" - android:labelFor="@+id/endpoint_text" - android:text="@string/endpoint" /> + <TextView + android:id="@+id/allowed_ips_text" + style="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/allowed_ips_label" + android:text="@{item.allowedIPs}" /> - <TextView - android:id="@+id/endpoint_text" - style="?android:attr/textAppearanceMedium" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/endpoint_label" - android:text="@{item.endpoint}" /> - </RelativeLayout> + <TextView + android:id="@+id/endpoint_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/allowed_ips_text" + android:layout_marginTop="8dp" + android:labelFor="@+id/endpoint_text" + android:text="@string/endpoint" /> + + <TextView + android:id="@+id/endpoint_text" + style="?android:attr/textAppearanceMedium" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/endpoint_label" + android:text="@{item.endpoint}" /> + </RelativeLayout> + </android.support.v7.widget.CardView> </layout> |