diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-25 18:13:07 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-26 00:49:01 -0600 |
commit | ade8f18a9550b340904cc608029c0fa4fe7186c0 (patch) | |
tree | 6e94a5d6d040aa7c77081e94e511d34a3ccc70db /ui/src/main/res/layout | |
parent | 46e2e29ead6fcd2b2ced46b965bc5e74484dead6 (diff) |
xml: cleanup
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/res/layout')
-rw-r--r-- | ui/src/main/res/layout/add_tunnels_bottom_sheet.xml | 33 | ||||
-rw-r--r-- | ui/src/main/res/layout/app_list_item.xml | 4 | ||||
-rw-r--r-- | ui/src/main/res/layout/log_viewer_activity.xml | 12 | ||||
-rw-r--r-- | ui/src/main/res/layout/log_viewer_entry.xml | 13 | ||||
-rw-r--r-- | ui/src/main/res/layout/main_activity.xml | 6 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_detail_fragment.xml | 4 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_detail_peer.xml | 4 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_editor_fragment.xml | 28 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_editor_peer.xml | 12 | ||||
-rw-r--r-- | ui/src/main/res/layout/tunnel_list_fragment.xml | 7 |
10 files changed, 60 insertions, 63 deletions
diff --git a/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml b/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml index 295a8e40..41cfe8bd 100644 --- a/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml +++ b/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/root" android:layout_width="match_parent" @@ -9,65 +8,65 @@ <com.google.android.material.button.MaterialButton android:id="@+id/create_from_file" + style="@style/Widget.MaterialComponents.Button.TextButton.Icon" android:layout_width="match_parent" android:layout_height="@dimen/bottom_sheet_item_height" - android:layout_marginLeft="@dimen/normal_margin" - android:layout_marginRight="@dimen/normal_margin" android:layout_marginStart="@dimen/normal_margin" + android:layout_marginLeft="@dimen/normal_margin" android:layout_marginEnd="@dimen/normal_margin" + android:layout_marginRight="@dimen/normal_margin" android:text="@string/create_from_file" android:textAlignment="viewStart" android:textColor="?attr/colorOnSurface" app:icon="@drawable/ic_action_open_white" app:iconPadding="@dimen/bottom_sheet_icon_padding" app:iconTint="?attr/colorSecondary" - app:layout_constraintTop_toBottomOf="parent" app:layout_constraintBottom_toTopOf="@+id/create_from_qrcode" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:rippleColor="?attr/colorSecondary" - style="@style/Widget.MaterialComponents.Button.TextButton.Icon"/> + app:layout_constraintTop_toBottomOf="parent" + app:rippleColor="?attr/colorSecondary" /> <com.google.android.material.button.MaterialButton android:id="@+id/create_from_qrcode" + style="@style/Widget.MaterialComponents.Button.TextButton.Icon" android:layout_width="match_parent" android:layout_height="@dimen/bottom_sheet_item_height" - android:layout_marginLeft="@dimen/normal_margin" - android:layout_marginRight="@dimen/normal_margin" android:layout_marginStart="@dimen/normal_margin" + android:layout_marginLeft="@dimen/normal_margin" android:layout_marginEnd="@dimen/normal_margin" + android:layout_marginRight="@dimen/normal_margin" android:text="@string/create_from_qr_code" android:textAlignment="viewStart" android:textColor="?attr/colorOnSurface" app:icon="@drawable/ic_action_scan_qr_code_white" app:iconPadding="@dimen/bottom_sheet_icon_padding" app:iconTint="?attr/colorSecondary" - app:layout_constraintTop_toBottomOf="@+id/create_from_file" app:layout_constraintBottom_toBottomOf="@+id/create_empty" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:rippleColor="?attr/colorSecondary" - style="@style/Widget.MaterialComponents.Button.TextButton.Icon"/> + app:layout_constraintTop_toBottomOf="@+id/create_from_file" + app:rippleColor="?attr/colorSecondary" /> <com.google.android.material.button.MaterialButton android:id="@+id/create_empty" + style="@style/Widget.MaterialComponents.Button.TextButton.Icon" android:layout_width="match_parent" android:layout_height="@dimen/bottom_sheet_item_height" - android:layout_marginLeft="@dimen/normal_margin" - android:layout_marginRight="@dimen/normal_margin" android:layout_marginStart="@dimen/normal_margin" + android:layout_marginLeft="@dimen/normal_margin" android:layout_marginEnd="@dimen/normal_margin" + android:layout_marginRight="@dimen/normal_margin" android:text="@string/create_empty" android:textAlignment="viewStart" android:textColor="?attr/colorOnSurface" app:icon="@drawable/ic_action_edit" app:iconPadding="@dimen/bottom_sheet_icon_padding" app:iconTint="?attr/colorSecondary" - app:layout_constraintTop_toBottomOf="@+id/create_from_qrcode" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:rippleColor="?attr/colorSecondary" - style="@style/Widget.MaterialComponents.Button.TextButton.Icon"/> + app:layout_constraintTop_toBottomOf="@+id/create_from_qrcode" + app:rippleColor="?attr/colorSecondary" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/ui/src/main/res/layout/app_list_item.xml b/ui/src/main/res/layout/app_list_item.xml index 1e81751b..a76073c0 100644 --- a/ui/src/main/res/layout/app_list_item.xml +++ b/ui/src/main/res/layout/app_list_item.xml @@ -42,11 +42,11 @@ style="?android:attr/textAppearanceMedium" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" android:layout_weight="1" android:ellipsize="end" android:maxLines="1" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp" android:text="@{key}" tools:text="@tools:sample/full_names" /> diff --git a/ui/src/main/res/layout/log_viewer_activity.xml b/ui/src/main/res/layout/log_viewer_activity.xml index 7a08bc88..1d4a466e 100644 --- a/ui/src/main/res/layout/log_viewer_activity.xml +++ b/ui/src/main/res/layout/log_viewer_activity.xml @@ -1,11 +1,9 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- +<?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright © 2020 WireGuard LLC. All Rights Reserved. ~ SPDX-License-Identifier: Apache-2.0 --> -<androidx.coordinatorlayout.widget.CoordinatorLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.coordinatorlayout.widget.CoordinatorLayout 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" android:layout_width="match_parent" @@ -15,12 +13,12 @@ android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" - tools:listitem="@layout/log_viewer_entry" - tools:itemCount="20" /> + tools:itemCount="20" + tools:listitem="@layout/log_viewer_entry" /> <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton - style="@style/Widget.MaterialComponents.ExtendedFloatingActionButton.Icon" android:id="@+id/share_fab" + style="@style/Widget.MaterialComponents.ExtendedFloatingActionButton.Icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" diff --git a/ui/src/main/res/layout/log_viewer_entry.xml b/ui/src/main/res/layout/log_viewer_entry.xml index 37f8941d..82a0d7a3 100644 --- a/ui/src/main/res/layout/log_viewer_entry.xml +++ b/ui/src/main/res/layout/log_viewer_entry.xml @@ -1,30 +1,29 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- +<?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright © 2020 WireGuard LLC. All Rights Reserved. ~ SPDX-License-Identifier: Apache-2.0 --> -<androidx.constraintlayout.widget.ConstraintLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.ConstraintLayout 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" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="6dp"> + <com.google.android.material.textview.MaterialTextView - style="@style/TextAppearance.MaterialComponents.Caption" android:id="@+id/log_date" + style="@style/TextAppearance.MaterialComponents.Caption" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="?android:attr/textColorPrimary" android:textSize="10sp" - app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" tools:text="Fri Mar 13 10:17:37 GMT+05:30 2020" /> <com.google.android.material.textview.MaterialTextView - style="@style/TextAppearance.MaterialComponents.Caption" android:id="@+id/log_msg" + style="@style/TextAppearance.MaterialComponents.Caption" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="?android:attr/textColorPrimary" diff --git a/ui/src/main/res/layout/main_activity.xml b/ui/src/main/res/layout/main_activity.xml index cf892e45..89be4fe4 100644 --- a/ui/src/main/res/layout/main_activity.xml +++ b/ui/src/main/res/layout/main_activity.xml @@ -4,13 +4,13 @@ android:id="@+id/master_detail_wrapper" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".activity.MainActivity" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + tools:context=".activity.MainActivity"> <androidx.fragment.app.FragmentContainerView android:id="@+id/detail_container" android:name="com.wireguard.android.fragment.TunnelListFragment" android:layout_width="match_parent" android:layout_height="match_parent" - android:tag="LIST"/> + android:tag="LIST" /> </androidx.coordinatorlayout.widget.CoordinatorLayout> diff --git a/ui/src/main/res/layout/tunnel_detail_fragment.xml b/ui/src/main/res/layout/tunnel_detail_fragment.xml index 463f8b80..134b61e5 100644 --- a/ui/src/main/res/layout/tunnel_detail_fragment.xml +++ b/ui/src/main/res/layout/tunnel_detail_fragment.xml @@ -35,10 +35,10 @@ <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="4dp" android:background="?attr/colorBackground" app:cardCornerRadius="4dp" app:cardElevation="2dp" diff --git a/ui/src/main/res/layout/tunnel_detail_peer.xml b/ui/src/main/res/layout/tunnel_detail_peer.xml index 181a4a21..79a48f38 100644 --- a/ui/src/main/res/layout/tunnel_detail_peer.xml +++ b/ui/src/main/res/layout/tunnel_detail_peer.xml @@ -14,10 +14,10 @@ <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="4dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="4dp" android:background="?attr/colorBackground" app:cardCornerRadius="4dp" app:cardElevation="2dp" diff --git a/ui/src/main/res/layout/tunnel_editor_fragment.xml b/ui/src/main/res/layout/tunnel_editor_fragment.xml index 887b3bb7..1d9d21de 100644 --- a/ui/src/main/res/layout/tunnel_editor_fragment.xml +++ b/ui/src/main/res/layout/tunnel_editor_fragment.xml @@ -42,10 +42,10 @@ <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="4dp" android:background="?attr/colorBackground" app:cardCornerRadius="4dp" app:cardElevation="2dp" @@ -93,8 +93,8 @@ android:id="@+id/private_key_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentStart="true" android:layout_below="@+id/private_key_label" + android:layout_alignParentStart="true" android:layout_toStartOf="@+id/generate_private_key_button" android:contentDescription="@string/public_key_description" android:inputType="textNoSuggestions|textVisiblePassword" @@ -106,9 +106,9 @@ style="@style/Widget.AppCompat.Button.Borderless.Colored" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_below="@+id/private_key_label" android:layout_alignBottom="@id/private_key_text" android:layout_alignParentEnd="true" - android:layout_below="@+id/private_key_label" android:onClick="@{() -> config.interface.generateKeyPair()}" android:text="@string/generate" /> @@ -138,8 +138,8 @@ android:id="@+id/addresses_label" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentStart="true" android:layout_below="@+id/public_key_text" + android:layout_alignParentStart="true" android:layout_toStartOf="@+id/listen_port_label" android:labelFor="@+id/addresses_text" android:text="@string/addresses" /> @@ -148,8 +148,8 @@ android:id="@+id/addresses_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentStart="true" android:layout_below="@+id/addresses_label" + android:layout_alignParentStart="true" android:layout_toStartOf="@+id/listen_port_text" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={config.interface.addresses}" /> @@ -159,8 +159,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/addresses_label" - android:layout_alignParentEnd="true" android:layout_alignStart="@+id/generate_private_key_button" + android:layout_alignParentEnd="true" android:labelFor="@+id/listen_port_text" android:text="@string/listen_port" /> @@ -169,8 +169,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/addresses_text" - android:layout_alignParentEnd="true" android:layout_alignStart="@+id/generate_private_key_button" + android:layout_alignParentEnd="true" android:hint="@string/hint_random" android:inputType="number" android:text="@={config.interface.listenPort}" @@ -180,8 +180,8 @@ android:id="@+id/dns_servers_label" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentStart="true" android:layout_below="@+id/addresses_text" + android:layout_alignParentStart="true" android:layout_toStartOf="@+id/mtu_label" android:labelFor="@+id/dns_servers_text" android:text="@string/dns_servers" /> @@ -190,8 +190,8 @@ android:id="@+id/dns_servers_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentStart="true" android:layout_below="@+id/dns_servers_label" + android:layout_alignParentStart="true" android:layout_toStartOf="@+id/mtu_text" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={config.interface.dnsServers}" /> @@ -201,8 +201,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/dns_servers_label" - android:layout_alignParentEnd="true" android:layout_alignStart="@+id/generate_private_key_button" + android:layout_alignParentEnd="true" android:labelFor="@+id/mtu_text" android:text="@string/mtu" /> @@ -211,8 +211,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/dns_servers_text" - android:layout_alignParentEnd="true" android:layout_alignStart="@+id/generate_private_key_button" + android:layout_alignParentEnd="true" android:hint="@string/hint_automatic" android:inputType="number" android:text="@={config.interface.mtu}" @@ -243,9 +243,9 @@ style="@style/Widget.AppCompat.Button.Colored" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - android:layout_marginEnd="4dp" android:layout_marginStart="4dp" + android:layout_marginEnd="4dp" + android:layout_marginBottom="4dp" android:onClick="@{() -> config.addPeer()}" android:text="@string/add_peer" /> </LinearLayout> diff --git a/ui/src/main/res/layout/tunnel_editor_peer.xml b/ui/src/main/res/layout/tunnel_editor_peer.xml index cf5d6286..98ce4550 100644 --- a/ui/src/main/res/layout/tunnel_editor_peer.xml +++ b/ui/src/main/res/layout/tunnel_editor_peer.xml @@ -20,10 +20,10 @@ <androidx.cardview.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:layout_marginEnd="8dp" + android:layout_marginBottom="4dp" android:background="?attr/colorBackground" app:cardCornerRadius="4dp" app:cardElevation="2dp" @@ -48,8 +48,8 @@ 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:layout_alignParentEnd="true" android:background="@null" android:contentDescription="@string/delete" android:onClick="@{() -> item.unbind()}" @@ -120,8 +120,8 @@ 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_alignParentStart="true" android:layout_toStartOf="@+id/persistent_keepalive_label" android:labelFor="@+id/endpoint_text" android:text="@string/endpoint" /> @@ -130,8 +130,8 @@ 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_alignParentStart="true" android:layout_toStartOf="@+id/persistent_keepalive_text" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={item.endpoint}" /> @@ -150,8 +150,8 @@ 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:layout_alignParentEnd="true" android:hint="@string/hint_optional" android:inputType="number" android:text="@={item.persistentKeepalive}" diff --git a/ui/src/main/res/layout/tunnel_list_fragment.xml b/ui/src/main/res/layout/tunnel_list_fragment.xml index c8144dbb..c790c30c 100644 --- a/ui/src/main/res/layout/tunnel_list_fragment.xml +++ b/ui/src/main/res/layout/tunnel_list_fragment.xml @@ -38,8 +38,8 @@ app:configurationHandler="@{rowConfigurationHandler}" app:items="@{tunnels}" app:layout="@{@layout/tunnel_list_item}" - tools:listitem="@layout/tunnel_list_item" - tools:itemCount="12" /> + tools:itemCount="12" + tools:listitem="@layout/tunnel_list_item" /> <LinearLayout android:layout_width="match_parent" @@ -65,9 +65,10 @@ android:text="@string/tunnel_list_placeholder" android:textSize="20sp" /> </LinearLayout> + <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton - style="@style/Widget.MaterialComponents.ExtendedFloatingActionButton.Icon" android:id="@+id/create_fab" + style="@style/Widget.MaterialComponents.ExtendedFloatingActionButton.Icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" |