From 66240394139f8fdb9eb295b574c102bfaff9b489 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Dec 2021 22:44:07 +0100 Subject: [PATCH] Use `@id` and not `@+id` when referencing ids in layouts - RelativeLayout and toolbarId --- tools/check/forbidden_strings_in_layout.txt | 5 +++-- vector/src/main/res/layout/fragment_matrix_profile.xml | 2 +- .../src/main/res/layout/fragment_space_directory.xml | 2 +- .../res/layout/fragment_space_restricted_select.xml | 2 +- .../src/main/res/layout/item_autocomplete_command.xml | 2 +- vector/src/main/res/layout/item_search_result.xml | 2 +- .../src/main/res/layout/item_timeline_event_base.xml | 10 +++++----- .../main/res/layout/item_timeline_event_base_state.xml | 4 ++-- .../item_timeline_event_merged_room_creation_stub.xml | 4 ++-- .../res/layout/item_timeline_event_merged_utd_stub.xml | 2 +- 10 files changed, 18 insertions(+), 17 deletions(-) diff --git a/tools/check/forbidden_strings_in_layout.txt b/tools/check/forbidden_strings_in_layout.txt index 3983adb5a6..545983f844 100644 --- a/tools/check/forbidden_strings_in_layout.txt +++ b/tools/check/forbidden_strings_in_layout.txt @@ -27,5 +27,6 @@ android:textSize===9 ### Use `@id` and not `@+id` when referencing ids in layouts -layout_constraint(.*)="@\+id -accessibilityTraversal(.*)="@\+id \ No newline at end of file +layout_(.*)="@\+id +accessibilityTraversal(.*)="@\+id +toolbarId="@\+id diff --git a/vector/src/main/res/layout/fragment_matrix_profile.xml b/vector/src/main/res/layout/fragment_matrix_profile.xml index ab55edfa29..f6f6af96ea 100644 --- a/vector/src/main/res/layout/fragment_matrix_profile.xml +++ b/vector/src/main/res/layout/fragment_matrix_profile.xml @@ -21,7 +21,7 @@ app:scrimAnimationDuration="250" app:scrimVisibleHeightTrigger="80dp" app:titleEnabled="false" - app:toolbarId="@+id/matrixProfileToolbar"> + app:toolbarId="@id/matrixProfileToolbar"> + app:toolbarId="@id/toolbar"> + app:toolbarId="@id/toolbar"> @@ -46,7 +46,7 @@ style="@style/Widget.Vector.TextView.Caption" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignBaseline="@+id/messageMemberNameView" + android:layout_alignBaseline="@id/messageMemberNameView" android:layout_alignParentEnd="true" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" @@ -145,7 +145,7 @@ android:id="@+id/messageSendStateImageView" android:layout_width="@dimen/item_event_message_state_size" android:layout_height="@dimen/item_event_message_state_size" - android:layout_alignBottom="@+id/viewStubContainer" + android:layout_alignBottom="@id/viewStubContainer" android:layout_alignParentEnd="true" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" @@ -160,7 +160,7 @@ android:id="@+id/eventSendingIndicator" android:layout_width="@dimen/item_event_message_state_size" android:layout_height="@dimen/item_event_message_state_size" - android:layout_alignBottom="@+id/viewStubContainer" + android:layout_alignBottom="@id/viewStubContainer" android:layout_alignParentEnd="true" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" @@ -175,7 +175,7 @@ android:id="@+id/informationBottom" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@+id/viewStubContainer" + android:layout_below="@id/viewStubContainer" android:layout_toEndOf="@id/messageStartGuideline" android:addStatesFromChildren="true" android:orientation="vertical"> diff --git a/vector/src/main/res/layout/item_timeline_event_base_state.xml b/vector/src/main/res/layout/item_timeline_event_base_state.xml index 5d734b442a..13fda00bcd 100644 --- a/vector/src/main/res/layout/item_timeline_event_base_state.xml +++ b/vector/src/main/res/layout/item_timeline_event_base_state.xml @@ -11,7 +11,7 @@ android:id="@+id/messageSelectedBackground" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_alignBottom="@+id/informationBottom" + android:layout_alignBottom="@id/informationBottom" android:layout_alignParentTop="true" android:background="@drawable/highlighted_message_background" /> @@ -84,7 +84,7 @@ android:id="@+id/messageFailToSendIndicator" android:layout_width="14dp" android:layout_height="14dp" - android:layout_alignTop="@+id/viewStubContainer" + android:layout_alignTop="@id/viewStubContainer" android:layout_marginStart="2dp" android:layout_toEndOf="@id/viewStubContainer" android:contentDescription="@string/a11y_error_message_not_sent" diff --git a/vector/src/main/res/layout/item_timeline_event_merged_room_creation_stub.xml b/vector/src/main/res/layout/item_timeline_event_merged_room_creation_stub.xml index 2c9cb691e7..0049cca3f9 100644 --- a/vector/src/main/res/layout/item_timeline_event_merged_room_creation_stub.xml +++ b/vector/src/main/res/layout/item_timeline_event_merged_room_creation_stub.xml @@ -142,7 +142,7 @@ android:id="@+id/mergedSumContainer" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@+id/creationTile" + android:layout_below="@id/creationTile" android:layout_marginTop="8dp"> diff --git a/vector/src/main/res/layout/item_timeline_event_merged_utd_stub.xml b/vector/src/main/res/layout/item_timeline_event_merged_utd_stub.xml index abcd679dea..bf6556b518 100644 --- a/vector/src/main/res/layout/item_timeline_event_merged_utd_stub.xml +++ b/vector/src/main/res/layout/item_timeline_event_merged_utd_stub.xml @@ -72,7 +72,7 @@ android:id="@+id/itemMergedSeparatorView" android:layout_width="match_parent" android:layout_height="1dp" - android:layout_below="@+id/mergedUTDTile" + android:layout_below="@id/mergedUTDTile" android:layout_marginTop="4dp" android:background="?vctr_list_separator" />