From ade8f18a9550b340904cc608029c0fa4fe7186c0 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 25 Mar 2020 18:13:07 -0600 Subject: [PATCH] xml: cleanup Signed-off-by: Jason A. Donenfeld --- ui/src/main/AndroidManifest.xml | 26 ++++++++++----- .../main/res/drawable/ic_action_add_white.xml | 4 +-- ui/src/main/res/drawable/ic_action_delete.xml | 4 +-- ui/src/main/res/drawable/ic_action_edit.xml | 4 +-- .../res/drawable/ic_action_edit_white.xml | 4 +-- .../res/drawable/ic_action_open_white.xml | 4 +-- ui/src/main/res/drawable/ic_action_save.xml | 4 +-- .../drawable/ic_action_scan_qr_code_white.xml | 6 ++-- .../res/drawable/ic_action_select_all.xml | 4 +-- .../res/drawable/ic_action_share_white.xml | 6 ++-- .../res/drawable/ic_launcher_foreground.xml | 6 ++-- ui/src/main/res/drawable/ic_settings.xml | 4 +-- ui/src/main/res/drawable/ic_tile.xml | 16 ++++----- .../res/drawable/list_item_background.xml | 4 ++- .../main/res/layout-sw600dp/main_activity.xml | 1 + .../res/layout/add_tunnels_bottom_sheet.xml | 33 +++++++++---------- ui/src/main/res/layout/app_list_item.xml | 4 +-- .../main/res/layout/log_viewer_activity.xml | 12 +++---- ui/src/main/res/layout/log_viewer_entry.xml | 13 ++++---- ui/src/main/res/layout/main_activity.xml | 6 ++-- .../res/layout/tunnel_detail_fragment.xml | 4 +-- ui/src/main/res/layout/tunnel_detail_peer.xml | 4 +-- .../res/layout/tunnel_editor_fragment.xml | 28 ++++++++-------- ui/src/main/res/layout/tunnel_editor_peer.xml | 12 +++---- .../main/res/layout/tunnel_list_fragment.xml | 7 ++-- ui/src/main/res/menu/log_viewer.xml | 2 +- ui/src/main/res/values-v21/styles.xml | 1 + ui/src/main/res/values/attrs.xml | 4 +-- ui/src/main/res/values/colors.xml | 4 ++- ui/src/main/res/xml/preferences.xml | 13 +++++--- 30 files changed, 130 insertions(+), 114 deletions(-) diff --git a/ui/src/main/AndroidManifest.xml b/ui/src/main/AndroidManifest.xml index 74bc7a20..47a833e1 100644 --- a/ui/src/main/AndroidManifest.xml +++ b/ui/src/main/AndroidManifest.xml @@ -9,9 +9,15 @@ - - - + + + + android:theme="@style/AppTheme"> - + + @@ -59,10 +68,11 @@ android:screenOrientation="fullSensor" tools:replace="screenOrientation" /> - - + diff --git a/ui/src/main/res/drawable/ic_action_add_white.xml b/ui/src/main/res/drawable/ic_action_add_white.xml index cbb4c4e6..18fe19db 100644 --- a/ui/src/main/res/drawable/ic_action_add_white.xml +++ b/ui/src/main/res/drawable/ic_action_add_white.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24.0" + android:viewportHeight="24.0"> diff --git a/ui/src/main/res/drawable/ic_action_delete.xml b/ui/src/main/res/drawable/ic_action_delete.xml index d4ebd61f..51517c42 100644 --- a/ui/src/main/res/drawable/ic_action_delete.xml +++ b/ui/src/main/res/drawable/ic_action_delete.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/ui/src/main/res/drawable/ic_action_edit.xml b/ui/src/main/res/drawable/ic_action_edit.xml index fc42d2ef..8d8acf85 100644 --- a/ui/src/main/res/drawable/ic_action_edit.xml +++ b/ui/src/main/res/drawable/ic_action_edit.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/ui/src/main/res/drawable/ic_action_edit_white.xml b/ui/src/main/res/drawable/ic_action_edit_white.xml index fa95f54b..212fc72c 100644 --- a/ui/src/main/res/drawable/ic_action_edit_white.xml +++ b/ui/src/main/res/drawable/ic_action_edit_white.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/ui/src/main/res/drawable/ic_action_open_white.xml b/ui/src/main/res/drawable/ic_action_open_white.xml index 01b2815c..91075680 100644 --- a/ui/src/main/res/drawable/ic_action_open_white.xml +++ b/ui/src/main/res/drawable/ic_action_open_white.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/ui/src/main/res/drawable/ic_action_save.xml b/ui/src/main/res/drawable/ic_action_save.xml index 528bd997..ed98e85a 100644 --- a/ui/src/main/res/drawable/ic_action_save.xml +++ b/ui/src/main/res/drawable/ic_action_save.xml @@ -2,8 +2,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/ui/src/main/res/drawable/ic_action_scan_qr_code_white.xml b/ui/src/main/res/drawable/ic_action_scan_qr_code_white.xml index 2383d032..a5ede695 100644 --- a/ui/src/main/res/drawable/ic_action_scan_qr_code_white.xml +++ b/ui/src/main/res/drawable/ic_action_scan_qr_code_white.xml @@ -1,9 +1,9 @@ + android:viewportWidth="24" + android:viewportHeight="24"> - \ No newline at end of file + diff --git a/ui/src/main/res/drawable/ic_action_select_all.xml b/ui/src/main/res/drawable/ic_action_select_all.xml index 28837423..43f5f15e 100644 --- a/ui/src/main/res/drawable/ic_action_select_all.xml +++ b/ui/src/main/res/drawable/ic_action_select_all.xml @@ -2,8 +2,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/ui/src/main/res/drawable/ic_action_share_white.xml b/ui/src/main/res/drawable/ic_action_share_white.xml index 4ada554b..70843cf3 100644 --- a/ui/src/main/res/drawable/ic_action_share_white.xml +++ b/ui/src/main/res/drawable/ic_action_share_white.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/ui/src/main/res/drawable/ic_launcher_foreground.xml b/ui/src/main/res/drawable/ic_launcher_foreground.xml index f9713f37..a3dfe681 100644 --- a/ui/src/main/res/drawable/ic_launcher_foreground.xml +++ b/ui/src/main/res/drawable/ic_launcher_foreground.xml @@ -2,8 +2,8 @@ + android:viewportWidth="2160" + android:viewportHeight="2160"> - \ No newline at end of file + diff --git a/ui/src/main/res/drawable/ic_settings.xml b/ui/src/main/res/drawable/ic_settings.xml index aabfce2a..6d1cfa71 100644 --- a/ui/src/main/res/drawable/ic_settings.xml +++ b/ui/src/main/res/drawable/ic_settings.xml @@ -1,8 +1,8 @@ + android:viewportWidth="24" + android:viewportHeight="24"> diff --git a/ui/src/main/res/drawable/ic_tile.xml b/ui/src/main/res/drawable/ic_tile.xml index eaf784c1..f5774968 100644 --- a/ui/src/main/res/drawable/ic_tile.xml +++ b/ui/src/main/res/drawable/ic_tile.xml @@ -1,24 +1,24 @@ + android:viewportWidth="400.0" + android:viewportHeight="400.0"> + android:strokeWidth="1.33333325" + android:strokeColor="#00000000" /> + android:strokeWidth="1.33333325" + android:strokeColor="#00000000" /> + android:strokeWidth="1.33333325" + android:strokeColor="#00000000" /> diff --git a/ui/src/main/res/drawable/list_item_background.xml b/ui/src/main/res/drawable/list_item_background.xml index f967f700..d517bbb6 100644 --- a/ui/src/main/res/drawable/list_item_background.xml +++ b/ui/src/main/res/drawable/list_item_background.xml @@ -3,7 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - + diff --git a/ui/src/main/res/layout-sw600dp/main_activity.xml b/ui/src/main/res/layout-sw600dp/main_activity.xml index 5104df93..00fa1c49 100644 --- a/ui/src/main/res/layout-sw600dp/main_activity.xml +++ b/ui/src/main/res/layout-sw600dp/main_activity.xml @@ -4,6 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".activity.MainActivity"> + - + app:layout_constraintTop_toBottomOf="parent" + app:rippleColor="?attr/colorSecondary" /> + app:layout_constraintTop_toBottomOf="@+id/create_from_file" + app:rippleColor="?attr/colorSecondary" /> + app:layout_constraintTop_toBottomOf="@+id/create_from_qrcode" + app:rippleColor="?attr/colorSecondary" /> 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 @@ - - - + tools:itemCount="20" + tools:listitem="@layout/log_viewer_entry" /> - - + + android:fitsSystemWindows="true" + tools:context=".activity.MainActivity"> + android:tag="LIST" /> 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 @@ @@ -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" /> 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 @@ @@ -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" /> + + app:showAsAction="ifRoom" /> diff --git a/ui/src/main/res/values-v21/styles.xml b/ui/src/main/res/values-v21/styles.xml index c90c66f7..fd53a5e8 100644 --- a/ui/src/main/res/values-v21/styles.xml +++ b/ui/src/main/res/values-v21/styles.xml @@ -1,5 +1,6 @@ +