Skip to content

Commit 4fbeb8f

Browse files
0nkojoshliebe
andauthored
Add pictogram ripple effect to AI settings (#7077)
Task/Issue URL: https://app.asana.com/1/137249556945/project/715106103902962/task/1211861383768919?focus=true ### Description This PR adds a ripple effect to the AI settings pictograms. ### Steps to test this PR - [x] Go to Settings -> AI Features - [x] Tap on the pictograms to select the AI mode - [x] Notice the ripple effect is applied, matching the pictogram bounds ### UI changes [Screen_recording_20251107_100953.webm](https://github.com/user-attachments/assets/0816015b-6c55-4fd8-ab74-99e8cc40c802) --------- Co-authored-by: Josh Leibstein <joshliebe@gmail.com>
1 parent e7c6d56 commit 4fbeb8f

File tree

5 files changed

+56
-4
lines changed

5 files changed

+56
-4
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
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+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
17+
<solid android:color="@android:color/transparent" />
18+
<corners android:radius="@dimen/extraLargeShapeCornerRadius" />
19+
</shape>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright (c) 2024 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+
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:color="?android:attr/colorControlHighlight">
18+
<item android:id="@android:id/mask">
19+
<shape android:shape="rectangle">
20+
<solid android:color="?attr/daxColorBlack" />
21+
<corners android:radius="@dimen/extraLargeShapeCornerRadius" />
22+
</shape>
23+
</item>
24+
<item android:drawable="@drawable/background_large_rounded_transparent" />
25+
</ripple>

android-design-system/design-system/src/main/res/values/design-system-dimensions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<dimen name="smallShapeCornerRadius">8dp</dimen>
3333
<dimen name="mediumShapeCornerRadius">12dp</dimen>
3434
<dimen name="largeShapeCornerRadius">16dp</dimen>
35+
<dimen name="extraLargeShapeCornerRadius">24dp</dimen>
3536

3637
<!-- App Components -->
3738
<dimen name="changeAppIconSize">75dp</dimen>

browser/browser-ui/src/main/res/values/styles-input-mode.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
<item name="tabGravity">center</item>
3131
<item name="tabInlineLabel">true</item>
3232
</style>
33+
34+
<style name="Widget.DuckDuckGo.SettingsPictogram">
35+
<item name="cornerFamily">rounded</item>
36+
<item name="cornerSize">@dimen/extraLargeShapeCornerRadius</item>
37+
</style>
3338
</resources>

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@
105105

106106
<ImageView
107107
android:id="@+id/duckAiInputScreenToggleWithoutAiImage"
108-
android:layout_width="match_parent"
108+
android:layout_width="wrap_content"
109109
android:layout_height="wrap_content"
110-
android:scaleType="fitCenter"
110+
android:scaleType="fitXY"
111+
android:foreground="@drawable/selectable_large_rounded_ripple"
111112
android:src="@drawable/searchbox_withoutai_active" />
112113

113114
<com.duckduckgo.common.ui.view.text.DaxTextView
@@ -144,9 +145,10 @@
144145

145146
<ImageView
146147
android:id="@+id/duckAiInputScreenToggleWithAiImage"
147-
android:layout_width="match_parent"
148+
android:layout_width="wrap_content"
148149
android:layout_height="wrap_content"
149-
android:scaleType="fitCenter"
150+
android:scaleType="fitXY"
151+
android:foreground="@drawable/selectable_large_rounded_ripple"
150152
android:src="@drawable/searchbox_withai_inactive" />
151153

152154
<LinearLayout

0 commit comments

Comments
 (0)