Skip to content

Commit 1c51650

Browse files
committed
styling of duck.ai omnibar
1 parent f86b700 commit 1c51650

File tree

6 files changed

+139
-8
lines changed

6 files changed

+139
-8
lines changed

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/ui/DuckChatOmnibarLayout.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class DuckChatOmnibarLayout @JvmOverloads constructor(
4545
fun onFireButtonPressed()
4646

4747
fun onBrowserMenuPressed()
48+
49+
fun onHistoryMenuPressed()
4850
}
4951

5052
init {

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/ui/DuckChatWebViewFragment.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ open class DuckChatWebViewFragment : DuckDuckGoFragment(R.layout.activity_duck_c
377377
override fun onBrowserMenuPressed() {
378378
Snackbar.make(root, "Menu", Snackbar.LENGTH_SHORT).show()
379379
}
380+
381+
override fun onHistoryMenuPressed() {
382+
Snackbar.make(root, "History", Snackbar.LENGTH_SHORT).show()
383+
}
380384
},
381385
)
382386
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="24dp"
4+
android:height="24dp"
5+
android:viewportWidth="24"
6+
android:viewportHeight="24">
7+
<path
8+
android:pathData="M3.455,20.47C2.903,21.106 3.438,22.074 4.268,21.931C7.587,21.361 13.404,20.259 15.768,19.174C19.423,17.849 22,14.653 22,10.922C22,6.003 17.523,2.015 12,2.015C6.477,2.015 2,6.003 2,10.922C2,13.389 3.127,15.623 4.947,17.236C5.346,17.589 5.422,18.202 5.072,18.605L3.455,20.47Z">
9+
<aapt:attr name="android:fillColor">
10+
<gradient
11+
android:startX="12"
12+
android:startY="2.015"
13+
android:endX="12"
14+
android:endY="21.945"
15+
android:type="linear">
16+
<item android:offset="0" android:color="#FFA7B7FD"/>
17+
<item android:offset="1" android:color="#FF3969EF"/>
18+
</gradient>
19+
</aapt:attr>
20+
</path>
21+
<path
22+
android:pathData="M20.75,10.922C20.75,14.04 18.59,16.821 15.342,17.999L15.293,18.016L15.247,18.038C14.2,18.518 12.277,19.041 10.104,19.525C8.376,19.911 6.566,20.255 5.064,20.523L6.017,19.424C6.868,18.443 6.626,17.052 5.776,16.3C4.218,14.919 3.28,13.052 3.251,11.019L3.25,10.922C3.25,6.825 7.027,3.265 12,3.265V2.015L11.871,2.016C6.45,2.077 2.07,5.979 2.001,10.807L2,10.922C2,13.389 3.127,15.623 4.947,17.236C5.334,17.578 5.417,18.164 5.104,18.567L5.073,18.605L3.455,20.47C2.903,21.106 3.438,22.074 4.268,21.931C7.587,21.361 13.404,20.259 15.768,19.174C19.423,17.849 22,14.653 22,10.922L21.999,10.807C21.93,5.941 17.48,2.015 12,2.015V3.265C16.973,3.265 20.75,6.825 20.75,10.922Z">
23+
<aapt:attr name="android:fillColor">
24+
<gradient
25+
android:startX="12"
26+
android:startY="21.945"
27+
android:endX="12"
28+
android:endY="2.015"
29+
android:type="linear">
30+
<item android:offset="0" android:color="#FF2B55CA"/>
31+
<item android:offset="1" android:color="#FF557FF3"/>
32+
</gradient>
33+
</aapt:attr>
34+
</path>
35+
<path
36+
android:pathData="M11.54,5.499C11.66,5.021 12.34,5.021 12.46,5.499L13.007,7.691C13.262,8.709 14.057,9.504 15.075,9.758L17.266,10.306C17.745,10.426 17.745,11.106 17.266,11.225L15.075,11.773C14.057,12.028 13.262,12.822 13.007,13.84L12.46,16.032C12.34,16.51 11.66,16.51 11.54,16.032L10.993,13.84C10.738,12.822 9.943,12.028 8.925,11.773L6.734,11.225C6.255,11.106 6.255,10.426 6.734,10.306L8.925,9.758C9.943,9.504 10.738,8.709 10.993,7.691L11.54,5.499Z"
37+
android:fillColor="#ffffff"/>
38+
<path
39+
android:pathData="M10.35,5.116C10.84,3.456 13.244,3.483 13.672,5.196L14.22,7.388C14.363,7.958 14.808,8.403 15.378,8.546L17.569,9.094C19.31,9.529 19.31,12.002 17.569,12.438L15.378,12.986C14.808,13.128 14.363,13.573 14.22,14.144L13.672,16.335C13.237,18.076 10.763,18.076 10.328,16.335L9.78,14.144C9.637,13.573 9.192,13.128 8.622,12.986L6.431,12.438C4.69,12.002 4.69,9.529 6.431,9.094L8.622,8.546C9.192,8.403 9.637,7.958 9.78,7.388L10.328,5.196L10.35,5.116ZM12,8.605C11.586,9.577 10.811,10.352 9.84,10.766C10.811,11.179 11.586,11.954 12,12.926C12.414,11.954 13.189,11.179 14.16,10.766C13.189,10.352 12.414,9.577 12,8.605Z">
40+
<aapt:attr name="android:fillColor">
41+
<gradient
42+
android:startX="12"
43+
android:startY="5.141"
44+
android:endX="12"
45+
android:endY="16.391"
46+
android:type="linear">
47+
<item android:offset="0" android:color="#FF839DF9"/>
48+
<item android:offset="1" android:color="#FF3969EF"/>
49+
</gradient>
50+
</aapt:attr>
51+
</path>
52+
<path
53+
android:pathData="M11.54,5.499C11.66,5.021 12.34,5.021 12.46,5.499L13.007,7.691C13.262,8.709 14.057,9.504 15.075,9.758L17.266,10.306C17.745,10.426 17.745,11.106 17.266,11.225L15.075,11.773C14.057,12.028 13.262,12.822 13.007,13.84L12.46,16.032C12.34,16.51 11.66,16.51 11.54,16.032L10.993,13.84C10.738,12.822 9.943,12.028 8.925,11.773L6.734,11.225C6.255,11.106 6.255,10.426 6.734,10.306L8.925,9.758C9.943,9.504 10.738,8.709 10.993,7.691L11.54,5.499Z"
54+
android:fillColor="#ffffff"/>
55+
</vector>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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:pathData="M15.25,16.5C15.664,16.5 16,16.836 16,17.25C16,17.664 15.664,18 15.25,18H3.75C3.336,18 3,17.664 3,17.25C3,16.836 3.336,16.5 3.75,16.5H15.25ZM20.289,6.001C20.685,6.021 21,6.349 21,6.75C21,7.151 20.685,7.479 20.289,7.499L20.25,7.5H3.75C3.336,7.5 3,7.164 3,6.75C3,6.336 3.336,6 3.75,6H20.25L20.289,6.001Z"
24+
android:fillColor="@color/primary_icon_color_selector" />
25+
</vector>

duckchat/duckchat-impl/src/main/res/layout/view_duck_chat_omnibar.xml

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,86 @@
2727
app:layout_constraintStart_toStartOf="parent"
2828
app:layout_constraintTop_toBottomOf="@id/spacer">
2929

30+
<FrameLayout
31+
android:id="@+id/duckAiHistoryButton"
32+
android:layout_width="@dimen/toolbarIcon"
33+
android:layout_height="@dimen/toolbarIcon"
34+
android:background="@drawable/selectable_item_experimental_background"
35+
app:layout_constraintBottom_toBottomOf="@id/inputModeWidgetCard"
36+
app:layout_constraintEnd_toStartOf="@id/inputModeWidgetCard"
37+
app:layout_constraintTop_toTopOf="@id/inputModeWidgetCard"
38+
app:layout_constraintStart_toStartOf="parent">
39+
40+
<ImageView
41+
android:id="@+id/duckAiHistoryImageView"
42+
android:layout_width="@dimen/bottomNavIcon"
43+
android:layout_height="@dimen/bottomNavIcon"
44+
android:layout_gravity="center"
45+
android:scaleType="center"
46+
android:src="@drawable/ic_chat_list_24" />
47+
</FrameLayout>
48+
3049
<com.google.android.material.card.MaterialCardView
3150
android:id="@+id/inputModeWidgetCard"
3251
style="@style/Widget.DuckDuckGo.OmnibarCardView"
3352
android:layout_width="0dp"
3453
android:layout_height="wrap_content"
3554
android:layout_marginTop="2dp"
55+
android:layout_marginStart="@dimen/keyline_4"
3656
app:cardElevation="0dp"
3757
app:layout_constraintEnd_toStartOf="@id/inputModeMainButtonsContainer"
38-
app:layout_constraintStart_toStartOf="parent"
58+
app:layout_constraintStart_toEndOf="@+id/duckAiHistoryButton"
3959
app:layout_constraintTop_toTopOf="parent">
4060

4161
<LinearLayout
4262
android:id="@+id/inputModeWidgetCardContent"
4363
android:layout_width="match_parent"
4464
android:layout_height="wrap_content"
4565
android:orientation="horizontal"
66+
android:layout_marginTop="@dimen/keyline_2"
67+
android:layout_marginBottom="@dimen/keyline_2"
68+
android:gravity="center"
4669
android:padding="@dimen/keyline_0">
4770

4871
<ImageView
4972
android:id="@+id/daxIcon"
50-
android:layout_width="@dimen/toolbarIcon"
51-
android:layout_height="@dimen/toolbarIcon"
73+
android:layout_width="@dimen/toolbarIconSize"
74+
android:layout_height="@dimen/toolbarIconSize"
75+
android:layout_gravity="center"
76+
android:importantForAccessibility="no"
77+
android:scaleType="fitCenter"
78+
app:srcCompat="@drawable/ic_dax_icon"
79+
tools:visibility="visible" />
80+
81+
<ImageView
82+
android:id="@+id/caretIcon"
83+
android:layout_width="@dimen/toolbarIconSize"
84+
android:layout_height="@dimen/toolbarIconSize"
85+
android:layout_gravity="center"
86+
android:importantForAccessibility="no"
87+
android:scaleType="fitCenter"
88+
android:layout_marginStart="@dimen/keyline_1"
89+
app:srcCompat="@drawable/ic_chevron_right_24"
90+
tools:visibility="visible" />
91+
92+
<ImageView
93+
android:id="@+id/aiIcon"
94+
android:layout_width="@dimen/toolbarIconSize"
95+
android:layout_height="@dimen/toolbarIconSize"
5296
android:layout_gravity="center"
5397
android:importantForAccessibility="no"
5498
android:scaleType="fitCenter"
55-
app:srcCompat="@drawable/ic_duckai"
99+
android:layout_marginStart="@dimen/keyline_1"
100+
app:srcCompat="@drawable/ic_ai_chat_omnibar_24"
56101
tools:visibility="visible" />
57102

58103
<com.duckduckgo.common.ui.view.text.DaxTextView
59104
android:id="@+id/inputField"
60-
android:layout_width="0dp"
105+
android:layout_width="wrap_content"
61106
android:layout_height="wrap_content"
62107
android:layout_gravity="center_vertical"
63-
android:layout_marginStart="10dp"
64-
android:layout_weight="1"
65-
android:text="Duck.ai"
108+
android:layout_marginStart="@dimen/keyline_1"
109+
android:text="@string/duckAiFullScreenModeOmnibarHint"
66110
app:textType="primary"
67111
app:typography="body1" />
68112

duckchat/duckchat-impl/src/main/res/values/donottranslate.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<!-- Duck AI Fullscreen Mode -->
2929
<string name="duckAiFullScreenModeTitle">Full Screen Mode</string>
3030
<string name="duckAiFullScreenModeDescription">Internal setting for O-J work</string>
31+
<string name="duckAiFullScreenModeOmnibarHint">Duck.ai</string>
3132

3233
<!-- Duck AI Voice Search Shortcut Setting -->
3334
<string name="duckAiVoiceSearchVisibilitySetting">Voice Search</string>

0 commit comments

Comments
 (0)