Skip to content

Commit b2f0770

Browse files
committed
The search widget layouts and were updated to use instead of as the latter is not supported in widgets.
1 parent fb89fac commit b2f0770

File tree

2 files changed

+32
-82
lines changed

2 files changed

+32
-82
lines changed
Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?><!--
2-
~ Copyright (c) 2018 DuckDuckGo
2+
~ Copyright (c) 2025 DuckDuckGo
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
55
~ you may not use this file except in compliance with the License.
@@ -14,81 +14,56 @@
1414
~ limitations under the License.
1515
-->
1616

17-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
18-
xmlns:app="http://schemas.android.com/apk/res-auto"
17+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
1918
xmlns:tools="http://schemas.android.com/tools"
2019
android:id="@+id/widgetContainer"
2120
style="@style/Widget.DuckDuckGo.SearchWidgetSearchBarContainer"
22-
android:background="@drawable/search_widget_background_black">
21+
android:background="@drawable/search_widget_background_black"
22+
android:gravity="center_vertical"
23+
android:orientation="horizontal">
2324

2425
<ImageView
2526
android:id="@+id/logo"
2627
style="@style/Widget.DuckDuckGo.SearchWidgetDDGLogo"
28+
android:layout_gravity="center_vertical"
2729
android:src="@drawable/ic_ddg_logo"
28-
app:layout_constraintBottom_toBottomOf="parent"
29-
app:layout_constraintStart_toStartOf="parent"
30-
app:layout_constraintTop_toTopOf="parent"
3130
tools:ignore="ContentDescription" />
3231

33-
<androidx.constraintlayout.widget.Barrier
34-
android:id="@+id/barrier"
35-
android:layout_width="wrap_content"
36-
android:layout_height="wrap_content"
37-
app:barrierDirection="start"
38-
app:constraint_referenced_ids="voiceSearch,search" />
39-
4032
<TextView
4133
android:id="@+id/searchInputBox"
4234
style="@style/Widget.DuckDuckGo.SearchWidgetInputBox"
35+
android:layout_width="0dp"
36+
android:layout_weight="1"
4337
android:text="@string/searchWidgetTextHint"
4438
android:textColor="@color/white60"
45-
app:layout_constraintBottom_toBottomOf="parent"
46-
app:layout_constraintEnd_toStartOf="@id/barrier"
47-
app:layout_constraintStart_toEndOf="@id/logo"
48-
app:layout_constraintTop_toTopOf="parent"
4939
tools:ignore="ContentDescription" />
5040

5141
<ImageView
5242
android:id="@+id/voiceSearch"
5343
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
5444
android:src="@drawable/ic_microphone_dark"
5545
android:visibility="gone"
56-
app:layout_constraintBottom_toBottomOf="parent"
57-
app:layout_constraintEnd_toStartOf="@id/separator"
58-
app:layout_constraintStart_toEndOf="@id/searchInputBox"
59-
app:layout_constraintTop_toTopOf="parent"
60-
tools:ignore="ContentDescription" />
61-
62-
<ImageView
63-
android:id="@+id/search"
64-
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
65-
android:src="@drawable/ic_find_search_24_dark"
66-
android:visibility="visible"
67-
app:layout_constraintBottom_toBottomOf="parent"
68-
app:layout_constraintEnd_toEndOf="parent"
69-
app:layout_constraintTop_toTopOf="parent"
7046
tools:ignore="ContentDescription" />
7147

7248
<ImageView
7349
android:id="@+id/separator"
7450
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
7551
android:src="@drawable/ic_vertical_separator"
7652
android:visibility="gone"
77-
app:layout_constraintBottom_toBottomOf="parent"
78-
app:layout_constraintEnd_toStartOf="@id/duckAi"
79-
app:layout_constraintStart_toEndOf="@id/voiceSearch"
80-
app:layout_constraintTop_toTopOf="parent"
8153
tools:ignore="ContentDescription" />
8254

8355
<ImageView
8456
android:id="@+id/duckAi"
8557
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
8658
android:src="@drawable/ic_duck_ai_24_dark"
8759
android:visibility="gone"
88-
app:layout_constraintBottom_toBottomOf="parent"
89-
app:layout_constraintEnd_toEndOf="parent"
90-
app:layout_constraintStart_toEndOf="@id/separator"
91-
app:layout_constraintTop_toTopOf="parent"
9260
tools:ignore="ContentDescription" />
9361

94-
</androidx.constraintlayout.widget.ConstraintLayout>
62+
<ImageView
63+
android:id="@+id/search"
64+
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
65+
android:src="@drawable/ic_find_search_24_dark"
66+
android:visibility="visible"
67+
tools:ignore="ContentDescription" />
68+
69+
</LinearLayout>
Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?><!--
2-
~ Copyright (c) 2018 DuckDuckGo
2+
~ Copyright (c) 2025 DuckDuckGo
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
55
~ you may not use this file except in compliance with the License.
@@ -14,81 +14,56 @@
1414
~ limitations under the License.
1515
-->
1616

17-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
18-
xmlns:app="http://schemas.android.com/apk/res-auto"
17+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
1918
xmlns:tools="http://schemas.android.com/tools"
2019
android:id="@+id/widgetContainer"
2120
style="@style/Widget.DuckDuckGo.SearchWidgetSearchBarContainer"
22-
android:background="@drawable/search_widget_background_white">
21+
android:background="@drawable/search_widget_background_white"
22+
android:gravity="center_vertical"
23+
android:orientation="horizontal">
2324

2425
<ImageView
2526
android:id="@+id/logo"
2627
style="@style/Widget.DuckDuckGo.SearchWidgetDDGLogo"
28+
android:layout_gravity="center_vertical"
2729
android:src="@drawable/ic_ddg_logo"
28-
app:layout_constraintBottom_toBottomOf="parent"
29-
app:layout_constraintStart_toStartOf="parent"
30-
app:layout_constraintTop_toTopOf="parent"
3130
tools:ignore="ContentDescription" />
3231

33-
<androidx.constraintlayout.widget.Barrier
34-
android:id="@+id/barrier"
35-
android:layout_width="wrap_content"
36-
android:layout_height="wrap_content"
37-
app:barrierDirection="start"
38-
app:constraint_referenced_ids="voiceSearch,search" />
39-
4032
<TextView
4133
android:id="@+id/searchInputBox"
4234
style="@style/Widget.DuckDuckGo.SearchWidgetInputBox"
35+
android:layout_width="0dp"
36+
android:layout_weight="1"
4337
android:text="@string/searchWidgetTextHint"
4438
android:textColor="@color/black60"
45-
app:layout_constraintBottom_toBottomOf="parent"
46-
app:layout_constraintEnd_toStartOf="@id/barrier"
47-
app:layout_constraintStart_toEndOf="@id/logo"
48-
app:layout_constraintTop_toTopOf="parent"
4939
tools:ignore="ContentDescription" />
5040

5141
<ImageView
5242
android:id="@+id/voiceSearch"
5343
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
5444
android:src="@drawable/ic_microphone_light"
5545
android:visibility="gone"
56-
app:layout_constraintBottom_toBottomOf="parent"
57-
app:layout_constraintEnd_toStartOf="@id/separator"
58-
app:layout_constraintStart_toEndOf="@id/searchInputBox"
59-
app:layout_constraintTop_toTopOf="parent"
60-
tools:ignore="ContentDescription" />
61-
62-
<ImageView
63-
android:id="@+id/search"
64-
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
65-
android:src="@drawable/ic_find_search_24_light"
66-
android:visibility="visible"
67-
app:layout_constraintBottom_toBottomOf="parent"
68-
app:layout_constraintEnd_toEndOf="parent"
69-
app:layout_constraintTop_toTopOf="parent"
7046
tools:ignore="ContentDescription" />
7147

7248
<ImageView
7349
android:id="@+id/separator"
7450
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
7551
android:src="@drawable/ic_vertical_separator"
7652
android:visibility="gone"
77-
app:layout_constraintBottom_toBottomOf="parent"
78-
app:layout_constraintEnd_toStartOf="@id/duckAi"
79-
app:layout_constraintStart_toEndOf="@id/voiceSearch"
80-
app:layout_constraintTop_toTopOf="parent"
8153
tools:ignore="ContentDescription" />
8254

8355
<ImageView
8456
android:id="@+id/duckAi"
8557
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
8658
android:src="@drawable/ic_duck_ai_24_light"
8759
android:visibility="gone"
88-
app:layout_constraintBottom_toBottomOf="parent"
89-
app:layout_constraintEnd_toEndOf="parent"
90-
app:layout_constraintStart_toEndOf="@id/separator"
91-
app:layout_constraintTop_toTopOf="parent"
9260
tools:ignore="ContentDescription" />
9361

94-
</androidx.constraintlayout.widget.ConstraintLayout>
62+
<ImageView
63+
android:id="@+id/search"
64+
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
65+
android:src="@drawable/ic_find_search_24_light"
66+
android:visibility="visible"
67+
tools:ignore="ContentDescription" />
68+
69+
</LinearLayout>

0 commit comments

Comments
 (0)