Skip to content

Commit fb89fac

Browse files
committed
Added Duck.ai entry points to search widget and updated UI. No logic implemented yet.
1 parent 4f9b5e7 commit fb89fac

12 files changed

+262
-39
lines changed

app/src/main/java/com/duckduckgo/widget/SearchWidget.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ open class SearchWidget(val layoutId: Int = R.layout.search_widget_dark) : AppWi
9595
appWidgetId: Int,
9696
newOptions: Bundle?,
9797
) {
98-
// TODO ANA: Add Duck.ai entry point.
9998
val appWidgetOptions = appWidgetManager.getAppWidgetOptions(appWidgetId)
10099
var portraitWidth = appWidgetOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH)
101100

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!--
2+
~ Copyright (c) 2025 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="24dp"
19+
android:height="24dp"
20+
android:viewportWidth="24"
21+
android:viewportHeight="24">
22+
<path
23+
android:fillColor="@color/white84"
24+
android:pathData="M12.382,6.284C12.282,5.886 11.717,5.886 11.618,6.284L11.247,7.767C10.953,8.942 10.036,9.86 8.861,10.154L7.377,10.524C6.98,10.624 6.98,11.189 7.377,11.288L8.861,11.659C10.036,11.953 10.953,12.87 11.247,14.046L11.618,15.529C11.717,15.927 12.282,15.927 12.382,15.529L12.753,14.046C13.047,12.87 13.964,11.953 15.139,11.659L16.623,11.288C17.02,11.189 17.02,10.624 16.623,10.524L15.139,10.154C13.964,9.86 13.047,8.942 12.753,7.767L12.382,6.284Z" />
25+
<path
26+
android:fillColor="@color/white84"
27+
android:fillType="evenOdd"
28+
android:pathData="M4.268,21.916C7.588,21.346 13.405,20.243 15.769,19.158C19.424,17.833 22,14.638 22,10.906C22,5.987 17.523,2 12,2C6.477,2 2,5.987 2,10.906C2,13.374 3.127,15.607 4.947,17.22C5.346,17.574 5.422,18.187 5.072,18.59L3.455,20.454C2.903,21.091 3.438,22.058 4.268,21.916ZM15.143,17.795L15.199,17.769L15.257,17.748C18.424,16.6 20.5,13.901 20.5,10.906C20.5,6.974 16.862,3.5 12,3.5C7.137,3.5 3.5,6.974 3.5,10.906C3.5,12.898 4.406,14.737 5.942,16.098C6.881,16.93 7.157,18.475 6.206,19.572L5.717,20.136C7.062,19.89 8.586,19.592 10.05,19.266C12.225,18.781 14.124,18.263 15.143,17.795Z" />
29+
</vector>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!--
2+
~ Copyright (c) 2025 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="24dp"
19+
android:height="24dp"
20+
android:viewportWidth="24"
21+
android:viewportHeight="24">
22+
<path
23+
android:fillColor="@color/black84"
24+
android:pathData="M12.382,6.284C12.282,5.886 11.717,5.886 11.618,6.284L11.247,7.767C10.953,8.942 10.036,9.86 8.861,10.154L7.377,10.524C6.98,10.624 6.98,11.189 7.377,11.288L8.861,11.659C10.036,11.953 10.953,12.87 11.247,14.046L11.618,15.529C11.717,15.927 12.282,15.927 12.382,15.529L12.753,14.046C13.047,12.87 13.964,11.953 15.139,11.659L16.623,11.288C17.02,11.189 17.02,10.624 16.623,10.524L15.139,10.154C13.964,9.86 13.047,8.942 12.753,7.767L12.382,6.284Z" />
25+
<path
26+
android:fillColor="@color/black84"
27+
android:fillType="evenOdd"
28+
android:pathData="M4.268,21.916C7.588,21.346 13.405,20.243 15.769,19.158C19.424,17.833 22,14.638 22,10.906C22,5.987 17.523,2 12,2C6.477,2 2,5.987 2,10.906C2,13.374 3.127,15.607 4.947,17.22C5.346,17.574 5.422,18.187 5.072,18.59L3.455,20.454C2.903,21.091 3.438,22.058 4.268,21.916ZM15.143,17.795L15.199,17.769L15.257,17.748C18.424,16.6 20.5,13.901 20.5,10.906C20.5,6.974 16.862,3.5 12,3.5C7.137,3.5 3.5,6.974 3.5,10.906C3.5,12.898 4.406,14.737 5.942,16.098C6.881,16.93 7.157,18.475 6.206,19.572L5.717,20.136C7.062,19.89 8.586,19.592 10.05,19.266C12.225,18.781 14.124,18.263 15.143,17.795Z" />
29+
</vector>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
~ Copyright (c) 2025 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="2dp"
19+
android:height="20dp"
20+
android:viewportWidth="2"
21+
android:viewportHeight="20">
22+
<path
23+
android:fillAlpha="0.09"
24+
android:fillColor="#000000"
25+
android:pathData="M0.5,0.5C0.5,0.224 0.724,0 1,0C1.276,0 1.5,0.224 1.5,0.5V19.5C1.5,19.776 1.276,20 1,20C0.724,20 0.5,19.776 0.5,19.5V0.5Z" />
26+
</vector>

app/src/main/res/drawable/search_widget_background_black.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
<shape xmlns:android="http://schemas.android.com/apk/res/android">
1818
<solid android:color="@color/gray90" />
19-
<corners android:radius="@dimen/smallShapeCornerRadius" />
19+
<corners android:radius="@dimen/largeShapeCornerRadius" />
2020
</shape>

app/src/main/res/drawable/search_widget_background_white.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
<shape xmlns:android="http://schemas.android.com/apk/res/android">
1818
<solid android:color="@color/white" />
19-
<corners android:radius="@dimen/smallShapeCornerRadius" />
19+
<corners android:radius="@dimen/largeShapeCornerRadius" />
2020
</shape>
Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
22
~ Copyright (c) 2018 DuckDuckGo
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,36 +14,81 @@
1414
~ limitations under the License.
1515
-->
1616

17-
18-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
17+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
1919
xmlns:tools="http://schemas.android.com/tools"
2020
android:id="@+id/widgetContainer"
2121
style="@style/Widget.DuckDuckGo.SearchWidgetSearchBarContainer"
22-
android:background="@drawable/search_widget_background_black"
23-
tools:ignore="DeprecatedWidgetInXml">
22+
android:background="@drawable/search_widget_background_black">
2423

2524
<ImageView
2625
android:id="@+id/logo"
2726
style="@style/Widget.DuckDuckGo.SearchWidgetDDGLogo"
28-
android:src="@drawable/logo_mini" />
27+
android:src="@drawable/ic_ddg_logo"
28+
app:layout_constraintBottom_toBottomOf="parent"
29+
app:layout_constraintStart_toStartOf="parent"
30+
app:layout_constraintTop_toTopOf="parent"
31+
tools:ignore="ContentDescription" />
32+
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" />
2939

3040
<TextView
3141
android:id="@+id/searchInputBox"
3242
style="@style/Widget.DuckDuckGo.SearchWidgetInputBox"
33-
android:layout_toStartOf="@+id/search"
34-
android:layout_toEndOf="@+id/logo"
3543
android:text="@string/searchWidgetTextHint"
36-
android:textColor="@color/white60" />
44+
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"
49+
tools:ignore="ContentDescription" />
3750

3851
<ImageView
3952
android:id="@+id/voiceSearch"
4053
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
4154
android:src="@drawable/ic_microphone_dark"
42-
android:visibility="gone" />
55+
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" />
4361

4462
<ImageView
4563
android:id="@+id/search"
4664
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
47-
android:src="@drawable/ic_find_search_20_dark" />
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"
70+
tools:ignore="ContentDescription" />
71+
72+
<ImageView
73+
android:id="@+id/separator"
74+
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
75+
android:src="@drawable/ic_vertical_separator"
76+
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"
81+
tools:ignore="ContentDescription" />
82+
83+
<ImageView
84+
android:id="@+id/duckAi"
85+
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
86+
android:src="@drawable/ic_duck_ai_24_dark"
87+
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"
92+
tools:ignore="ContentDescription" />
4893

49-
</RelativeLayout>
94+
</androidx.constraintlayout.widget.ConstraintLayout>
Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
22
~ Copyright (c) 2018 DuckDuckGo
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,36 +14,81 @@
1414
~ limitations under the License.
1515
-->
1616

17-
18-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
17+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
1919
xmlns:tools="http://schemas.android.com/tools"
2020
android:id="@+id/widgetContainer"
2121
style="@style/Widget.DuckDuckGo.SearchWidgetSearchBarContainer"
22-
android:background="@drawable/search_widget_background_white"
23-
tools:ignore="DeprecatedWidgetInXml">
22+
android:background="@drawable/search_widget_background_white">
2423

2524
<ImageView
2625
android:id="@+id/logo"
2726
style="@style/Widget.DuckDuckGo.SearchWidgetDDGLogo"
28-
android:src="@drawable/logo_mini" />
27+
android:src="@drawable/ic_ddg_logo"
28+
app:layout_constraintBottom_toBottomOf="parent"
29+
app:layout_constraintStart_toStartOf="parent"
30+
app:layout_constraintTop_toTopOf="parent"
31+
tools:ignore="ContentDescription" />
32+
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" />
2939

3040
<TextView
3141
android:id="@+id/searchInputBox"
3242
style="@style/Widget.DuckDuckGo.SearchWidgetInputBox"
33-
android:layout_toStartOf="@+id/search"
34-
android:layout_toEndOf="@+id/logo"
3543
android:text="@string/searchWidgetTextHint"
36-
android:textColor="@color/black60" />
44+
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"
49+
tools:ignore="ContentDescription" />
3750

3851
<ImageView
3952
android:id="@+id/voiceSearch"
4053
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
4154
android:src="@drawable/ic_microphone_light"
42-
android:visibility="gone" />
55+
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" />
4361

4462
<ImageView
4563
android:id="@+id/search"
4664
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
47-
android:src="@drawable/ic_find_search_20_light" />
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"
70+
tools:ignore="ContentDescription" />
71+
72+
<ImageView
73+
android:id="@+id/separator"
74+
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
75+
android:src="@drawable/ic_vertical_separator"
76+
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"
81+
tools:ignore="ContentDescription" />
82+
83+
<ImageView
84+
android:id="@+id/duckAi"
85+
style="@style/Widget.DuckDuckGo.SearchWidgetSearchIcon"
86+
android:src="@drawable/ic_duck_ai_24_light"
87+
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"
92+
tools:ignore="ContentDescription" />
4893

49-
</RelativeLayout>
94+
</androidx.constraintlayout.widget.ConstraintLayout>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
~ Copyright (c) 2025 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="24dp"
19+
android:height="24dp"
20+
android:viewportWidth="24"
21+
android:viewportHeight="24">
22+
<path
23+
android:fillColor="@color/white84"
24+
android:fillType="evenOdd"
25+
android:pathData="M10.625,3C6.414,3 3,6.414 3,10.625C3,14.836 6.414,18.25 10.625,18.25C12.46,18.25 14.144,17.601 15.46,16.521L19.72,20.78C20.013,21.073 20.487,21.073 20.78,20.78C21.073,20.487 21.073,20.013 20.78,19.72L16.521,15.46C17.601,14.144 18.25,12.46 18.25,10.625C18.25,6.414 14.836,3 10.625,3ZM4.5,10.625C4.5,7.242 7.242,4.5 10.625,4.5C14.008,4.5 16.75,7.242 16.75,10.625C16.75,14.008 14.008,16.75 10.625,16.75C7.242,16.75 4.5,14.008 4.5,10.625Z" />
26+
</vector>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
~ Copyright (c) 2025 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:width="24dp"
19+
android:height="24dp"
20+
android:viewportWidth="24"
21+
android:viewportHeight="24">
22+
<path
23+
android:fillColor="@color/black84"
24+
android:fillType="evenOdd"
25+
android:pathData="M10.625,3C6.414,3 3,6.414 3,10.625C3,14.836 6.414,18.25 10.625,18.25C12.46,18.25 14.144,17.601 15.46,16.521L19.72,20.78C20.013,21.073 20.487,21.073 20.78,20.78C21.073,20.487 21.073,20.013 20.78,19.72L16.521,15.46C17.601,14.144 18.25,12.46 18.25,10.625C18.25,6.414 14.836,3 10.625,3ZM4.5,10.625C4.5,7.242 7.242,4.5 10.625,4.5C14.008,4.5 16.75,7.242 16.75,10.625C16.75,14.008 14.008,16.75 10.625,16.75C7.242,16.75 4.5,14.008 4.5,10.625Z" />
26+
</vector>

0 commit comments

Comments
 (0)