diff options
author | Harsh Shandilya <harsh@prjkt.io> | 2018-05-02 11:33:03 +0530 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-05-03 23:45:03 -0500 |
commit | 0b098fb2ccacfcd34b65233da3dc96e6c2f3c99a (patch) | |
tree | 2a8c0b9d9450d96c91c1f5eb5c3109abe964c209 /app/src/main/res/layout/tunnel_editor_peer.xml | |
parent | tools: include libmnl paths after system paths for ndk 17 (diff) | |
download | wireguard-android-0b098fb2ccacfcd34b65233da3dc96e6c2f3c99a.tar.xz wireguard-android-0b098fb2ccacfcd34b65233da3dc96e6c2f3c99a.zip |
ui: Use a proper CardView based layout
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
Diffstat (limited to '')
-rw-r--r-- | app/src/main/res/layout/tunnel_editor_peer.xml | 238 |
1 files changed, 122 insertions, 116 deletions
diff --git a/app/src/main/res/layout/tunnel_editor_peer.xml b/app/src/main/res/layout/tunnel_editor_peer.xml index b6caab8a..40e16136 100644 --- a/app/src/main/res/layout/tunnel_editor_peer.xml +++ b/app/src/main/res/layout/tunnel_editor_peer.xml @@ -15,128 +15,134 @@ type="com.wireguard.config.Peer.Observable" /> </data> - <RelativeLayout - android:layout_width="match_parent" + <android.support.v7.widget.CardView + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="4dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="4dp" android:background="?android:attr/colorBackground" - android:elevation="2dp" - android:padding="8dp"> - - <TextView - android:id="@+id/peer_title" - style="?android:attr/textAppearanceMedium" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_alignParentTop="true" - android:layout_marginBottom="8dp" - android:layout_toStartOf="@+id/peer_action_delete" - android:text="@string/peer" /> - - <ImageButton - android:id="@+id/peer_action_delete" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentEnd="true" - android:layout_alignParentTop="true" - android:background="@null" - android:contentDescription="@string/delete" - android:onClick="@{() -> collection.remove(item)}" - android:src="@drawable/ic_action_delete_black" /> - - <TextView - android:id="@+id/public_key_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/peer_title" - android:labelFor="@+id/public_key_text" - android:text="@string/public_key" /> - - <EditText - android:id="@+id/public_key_text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/public_key_label" - android:inputType="textNoSuggestions|textVisiblePassword" - android:text="@={item.publicKey}" - app:filter="@{KeyInputFilter.newInstance()}" /> - - <TextView - android:id="@+id/pre_shared_key_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/public_key_text" - android:labelFor="@+id/pre_shared_key_text" - android:text="@string/pre_shared_key" /> - - <EditText - android:id="@+id/pre_shared_key_text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/pre_shared_key_label" - android:hint="@string/hint_optional" - android:inputType="textNoSuggestions|textVisiblePassword" - android:text="@={item.preSharedKey}" /> - - <TextView - android:id="@+id/allowed_ips_label" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/pre_shared_key_text" - android:labelFor="@+id/allowed_ips_text" - android:text="@string/allowed_ips" /> + app:cardCornerRadius="4dp" + app:cardElevation="2dp" + app:contentPadding="8dp"> - <EditText - android:id="@+id/allowed_ips_text" + <RelativeLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/allowed_ips_label" - android:inputType="textNoSuggestions|textVisiblePassword" - android:text="@={item.allowedIPs}" /> - - <TextView - android:id="@+id/endpoint_label" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_below="@+id/allowed_ips_text" - android:layout_toStartOf="@+id/persistent_keepalive_label" - android:labelFor="@+id/endpoint_text" - android:text="@string/endpoint" /> - - <EditText - android:id="@+id/endpoint_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_below="@+id/endpoint_label" - android:layout_toStartOf="@+id/persistent_keepalive_text" - android:inputType="textNoSuggestions|textVisiblePassword" - android:text="@={item.endpoint}" /> - - <TextView - android:id="@+id/persistent_keepalive_label" - android:layout_width="96dp" - android:layout_height="wrap_content" - android:layout_alignBaseline="@+id/endpoint_label" - android:layout_alignParentEnd="true" - android:labelFor="@+id/persistent_keepalive_text" - android:text="@string/persistent_keepalive" /> - - <EditText - android:id="@+id/persistent_keepalive_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignBaseline="@+id/endpoint_text" - android:layout_alignParentEnd="true" - android:layout_alignStart="@+id/persistent_keepalive_label" - android:hint="@string/hint_optional" - android:inputType="number" - android:text="@={item.persistentKeepalive}" - android:textAlignment="center" /> - </RelativeLayout> + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/peer_title" + style="?android:attr/textAppearanceMedium" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_marginBottom="8dp" + android:layout_toStartOf="@+id/peer_action_delete" + android:text="@string/peer" /> + + <ImageButton + android:id="@+id/peer_action_delete" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentEnd="true" + android:layout_alignParentTop="true" + android:background="@null" + android:contentDescription="@string/delete" + android:onClick="@{() -> collection.remove(item)}" + android:src="@drawable/ic_action_delete_black" /> + + <TextView + android:id="@+id/public_key_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/peer_title" + android:labelFor="@+id/public_key_text" + android:text="@string/public_key" /> + + <EditText + android:id="@+id/public_key_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/public_key_label" + android:inputType="textNoSuggestions|textVisiblePassword" + android:text="@={item.publicKey}" + app:filter="@{KeyInputFilter.newInstance()}" /> + + <TextView + android:id="@+id/pre_shared_key_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/public_key_text" + android:labelFor="@+id/pre_shared_key_text" + android:text="@string/pre_shared_key" /> + + <EditText + android:id="@+id/pre_shared_key_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/pre_shared_key_label" + android:hint="@string/hint_optional" + android:inputType="textNoSuggestions|textVisiblePassword" + android:text="@={item.preSharedKey}" /> + + <TextView + android:id="@+id/allowed_ips_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/pre_shared_key_text" + android:labelFor="@+id/allowed_ips_text" + android:text="@string/allowed_ips" /> + + <EditText + android:id="@+id/allowed_ips_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/allowed_ips_label" + android:inputType="textNoSuggestions|textVisiblePassword" + android:text="@={item.allowedIPs}" /> + + <TextView + android:id="@+id/endpoint_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@+id/allowed_ips_text" + android:layout_toStartOf="@+id/persistent_keepalive_label" + android:labelFor="@+id/endpoint_text" + android:text="@string/endpoint" /> + + <EditText + android:id="@+id/endpoint_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_below="@+id/endpoint_label" + android:layout_toStartOf="@+id/persistent_keepalive_text" + android:inputType="textNoSuggestions|textVisiblePassword" + android:text="@={item.endpoint}" /> + + <TextView + android:id="@+id/persistent_keepalive_label" + android:layout_width="96dp" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/endpoint_label" + android:layout_alignParentEnd="true" + android:labelFor="@+id/persistent_keepalive_text" + android:text="@string/persistent_keepalive" /> + + <EditText + android:id="@+id/persistent_keepalive_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/endpoint_text" + android:layout_alignParentEnd="true" + android:layout_alignStart="@+id/persistent_keepalive_label" + android:hint="@string/hint_optional" + android:inputType="number" + android:text="@={item.persistentKeepalive}" + android:textAlignment="center" /> + </RelativeLayout> + </android.support.v7.widget.CardView> </layout> |