Skip to content

Commit 7304996

Browse files
authored
[Android] Add new illustrations for Card list message (#7794)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1201462886803403/task/1213397161359075?focus=true ### Description Added support for two new remote message placeholders: `BOOKMARKS_IMPORT` and `NEW_TAB_OPTIONS`. This includes: - Added new vector drawable resources `bookmarks_import_96.xml` and `newtab_options_96.xml` to the design system - Added `BOOKMARKS_IMPORT` and `NEW_TAB_OPTIONS` enum values to the `Placeholder` class - Updated drawable mapping functions in both the app and remote messaging implementation to handle the new placeholders ### Steps to test this PR Code review only. ### NO UI changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Adds new drawable assets and extends placeholder-to-drawable mappings; risk is limited to incorrect resource wiring or unexpected placeholder values causing UI fallback/crashes. > > **Overview** > Adds support for two new remote message placeholders, `BOOKMARKS_IMPORT` and `NEW_TAB_OPTIONS`, including new 96dp vector illustration resources (`bookmarks_import_96.xml`, `newtab_options_96.xml`). > > Extends the remote messaging API `Placeholder` enum and updates both app and remote-messaging-impl mappers to resolve these placeholders to the new drawables when rendering remote message cards. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cad12ce. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 63e8a9b commit 7304996

File tree

5 files changed

+135
-0
lines changed

5 files changed

+135
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="96dp"
3+
android:height="96dp"
4+
android:viewportWidth="96"
5+
android:viewportHeight="96">
6+
<path
7+
android:pathData="M71,51c-11.046,0 -20,8.954 -20,20v1a8,8 0,0 1,-8 8h-7a8,8 0,0 1,-8 -8V24a8,8 0,0 1,8 -8h32a8,8 0,0 1,8 8v24a3,3 0,0 1,-3 3z"
8+
android:fillColor="#c18010"/>
9+
<path
10+
android:pathData="M71,51c-11.046,0 -20,8.954 -20,20v1a5,5 0,0 1,-5 5H34c-5.523,0 -10,-4.477 -10,-10V29c0,-5.523 4.477,-10 10,-10h34a5,5 0,0 1,5 5v27z"
11+
android:fillColor="#fff0c2"/>
12+
<path
13+
android:pathData="M69,51.099C58.893,52.102 51,60.629 51,71v5a4,4 0,0 1,-4 4H35c-8.284,0 -15,-6.716 -15,-15V31c0,-8.284 6.716,-15 15,-15h26a8,8 0,0 1,8 8z"
14+
android:fillColor="#e2a412"/>
15+
<path
16+
android:pathData="M35,80h-7a8,8 0,0 1,-8 -8V24a8,8 0,0 1,8 -8h7z"
17+
android:fillColor="#c18010"/>
18+
<path
19+
android:pathData="M62,16H48v29.035c0,1.642 1.868,2.584 3.189,1.609l2.622,-1.938a2,2 0,0 1,2.378 0l2.622,1.938c1.32,0.975 3.189,0.033 3.189,-1.609z"
20+
android:fillColor="#3969ef"/>
21+
<path
22+
android:pathData="M71,87c8.837,0 16,-7.163 16,-16s-7.163,-16 -16,-16 -16,7.163 -16,16 7.163,16 16,16"
23+
android:fillColor="#557ff3"/>
24+
<path
25+
android:pathData="M73,62a1,1 0,0 1,1 1v8.978a0.5,0.5 0,0 0,0.807 0.394l2.89,-2.247a1,1 0,0 1,1.414 0.19l1.8,2.399a1,1 0,0 1,-0.187 1.39l-8.271,6.43a2.5,2.5 0,0 1,-2.906 0l-8.271,-6.43a1,1 0,0 1,-0.186 -1.39l1.8,-2.4a1,1 0,0 1,1.413 -0.19l2.89,2.248a0.5,0.5 0,0 0,0.807 -0.394V63a1,1 0,0 1,1 -1z"
26+
android:fillColor="#fff"
27+
android:fillType="evenOdd"/>
28+
<path
29+
android:pathData="M92.502,59c0.297,0 0.594,0.12 0.822,0.354 0.454,0.468 0.454,1.23 0,1.698l-2.333,2.4a1.145,1.145 0,0 1,-1.65 0,1.227 1.227,0 0,1 0,-1.698l2.333,-2.4c0.227,-0.234 0.524,-0.354 0.822,-0.354zM91.335,69.798h3.499c0.641,0 1.166,0.54 1.166,1.2s-0.525,1.2 -1.166,1.2h-3.499c-0.641,0 -1.166,-0.54 -1.166,-1.2s0.525,-1.2 1.166,-1.2m-1.982,8.754c0.227,-0.234 0.525,-0.354 0.822,-0.354h0.006c0.297,0 0.595,0.12 0.822,0.354l2.332,2.4c0.455,0.467 0.455,1.23 0,1.697a1.145,1.145 0,0 1,-1.65 0l-2.332,-2.4a1.227,1.227 0,0 1,0 -1.697"
30+
android:fillColor="#ccc"/>
31+
</vector>
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="96dp"
4+
android:height="96dp"
5+
android:viewportWidth="96"
6+
android:viewportHeight="96">
7+
<path
8+
android:pathData="M46,78a5,5 0,0 0,5 -5v-2c0,-11.046 8.954,-20 20,-20h5a4,4 0,0 0,4 -4V26a8,8 0,0 0,-8 -8H29a8,8 0,0 0,-8 8v44a8,8 0,0 0,8 8z">
9+
<aapt:attr name="android:fillColor">
10+
<gradient
11+
android:startX="50.5"
12+
android:startY="78"
13+
android:endX="50.5"
14+
android:endY="18"
15+
android:type="linear">
16+
<item android:offset="0" android:color="#FFE46F4F"/>
17+
<item android:offset="1" android:color="#FF876ECB"/>
18+
</gradient>
19+
</aapt:attr>
20+
</path>
21+
<path
22+
android:pathData="M47,78a4,4 0,0 0,4 -4v-3c0,-11.046 8.954,-20 20,-20h4V26a8,8 0,0 0,-8 -8H24a8,8 0,0 0,-8 8v44a8,8 0,0 0,8 8z">
23+
<aapt:attr name="android:fillColor">
24+
<gradient
25+
android:startX="27"
26+
android:startY="75.5"
27+
android:endX="67.5"
28+
android:endY="19"
29+
android:type="linear">
30+
<item android:offset="0" android:color="#FFF8BBAA"/>
31+
<item android:offset="1" android:color="#FFA591DC"/>
32+
</gradient>
33+
</aapt:attr>
34+
</path>
35+
<path
36+
android:pathData="M37,32.5a8.5,8.5 0,1 1,17 0,8.5 8.5,0 0,1 -17,0">
37+
<aapt:attr name="android:fillColor">
38+
<gradient
39+
android:startX="42.667"
40+
android:startY="41"
41+
android:endX="49.467"
42+
android:endY="24.567"
43+
android:type="linear">
44+
<item android:offset="0" android:color="#FFEB876C"/>
45+
<item android:offset="1" android:color="#FF6B4EBA"/>
46+
</gradient>
47+
</aapt:attr>
48+
</path>
49+
<path
50+
android:pathData="M43.803,38.342c0.666,0.246 2.106,0.306 2.889,0.03a39,39 0,0 1,-0.439 -1.023c-0.32,0.076 -0.742,0.084 -0.84,-0.08 -0.368,0.319 -1.073,0.78 -1.22,0.683 -0.282,-0.184 -0.548,-1.606 -0.336,-1.907 0.322,-0.293 1.001,0.026 1.477,0.194 0.066,-0.112 0.237,-0.193 0.427,-0.237 -0.23,-0.766 -0.3,-1.384 -0.002,-1.568 -0.894,-0.257 -1.587,-0.775 -1.41,-1.529 0.145,-1.031 2.095,-0.709 2.967,-0.825q0.011,0 0.023,-0.003c0.107,-0.701 -0.213,-3.252 -1.98,-3.638 -1.843,-2.28 -3.598,0.321 -2.708,0.143 0.71,-0.177 1.238,-0.014 1.216,-0.007 -3.904,0.493 -0.71,8.01 -0.48,9.587 0.085,0.116 0.267,0.115 0.413,0.17zM46.803,29.967c-0.325,-0.174 -0.608,-0.085 -0.762,-0.036 -0.087,0.027 -0.133,0.041 -0.122,-0.014 0.128,-0.265 0.788,-0.267 0.918,0.01 0.017,0.024 -0.008,0.051 -0.034,0.04m-4.06,0.388c-0.017,0.028 -0.084,0.024 -0.084,-0.01 0.017,-0.443 0.77,-0.657 1.044,-0.381 0.033,0.041 -0.016,0.038 -0.104,0.031 -0.123,-0.009 -0.323,-0.023 -0.488,0.069 -0.242,0.103 -0.32,0.215 -0.367,0.29m3.858,1.13c-0.506,-0.003 -0.506,-0.783 0,-0.787 0.507,0.003 0.507,0.785 0,0.787m-2.57,-0.12c-0.01,0.602 -0.893,0.602 -0.904,0 0.003,-0.6 0.901,-0.6 0.905,0"
51+
android:fillColor="#fff"/>
52+
<path
53+
android:pathData="M47.964,37.2c-0.02,0.127 -0.064,0.212 -0.142,0.224 -0.15,0.023 -0.815,-0.13 -1.193,-0.273 -0.043,0.198 -1.056,0.385 -1.217,0.12 -0.368,0.317 -1.072,0.778 -1.22,0.682 -0.282,-0.185 -0.547,-1.607 -0.335,-1.908 0.323,-0.293 1.001,0.026 1.477,0.194 0.161,-0.272 0.942,-0.376 1.104,-0.152 0.428,-0.325 1.14,-0.783 1.21,-0.7 0.347,0.418 0.39,1.412 0.316,1.813"
54+
android:strokeAlpha="0.5"
55+
android:fillColor="#fff"
56+
android:fillAlpha="0.5"/>
57+
<path
58+
android:pathData="M44.35,32.905c0.145,-1.032 2.094,-0.709 2.966,-0.825a5.6,5.6 0,0 0,1.42 -0.352c0.721,-0.296 0.844,-0.002 0.491,0.46 -0.995,1.18 -3.208,0.32 -3.605,0.93 -0.115,0.181 -0.026,0.607 0.885,0.74 1.23,0.181 2.24,-0.217 2.365,0.024 -0.28,1.288 -4.95,0.85 -4.523,-0.977"
59+
android:strokeAlpha="0.7"
60+
android:fillColor="#fff"
61+
android:fillType="evenOdd"
62+
android:fillAlpha="0.7"/>
63+
<path
64+
android:pathData="M45.5,26.89a5.61,5.61 0,1 0,0 11.22,5.61 5.61,0 0,0 0,-11.22M39,32.5a6.5,6.5 0,1 1,13 0,6.5 6.5,0 0,1 -13,0"
65+
android:fillColor="#fff"
66+
android:fillType="evenOdd"/>
67+
<path
68+
android:pathData="M62.273,53a19.9,19.9 0,0 1,6.083 -1.825A4,4 0,0 0,65 45H26a4,4 0,0 0,0 8z"
69+
android:fillColor="#000"
70+
android:fillAlpha="0.1"/>
71+
<path
72+
android:pathData="M65,51a4,4 0,0 0,0 -8H26a4,4 0,0 0,0 8z"
73+
android:fillColor="#fff"/>
74+
<path
75+
android:pathData="M31,64a2,2 0,0 0,2 -2v-4a2,2 0,0 0,-2 -2h-4a2,2 0,0 0,-2 2v4a2,2 0,0 0,2 2zM42,64a2,2 0,0 0,2 -2v-4a2,2 0,0 0,-2 -2h-4a2,2 0,0 0,-2 2v4a2,2 0,0 0,2 2zM52.26,64A20,20 0,0 1,55 58.999L55,58a2,2 0,0 0,-2 -2h-4a2,2 0,0 0,-2 2v4a2,2 0,0 0,2 2z"
76+
android:fillColor="#fff"
77+
android:fillAlpha="0.6"/>
78+
<path
79+
android:pathData="M32,68a1,1 0,1 0,0 -2h-6a1,1 0,1 0,0 2zM43,68a1,1 0,1 0,0 -2h-6a1,1 0,1 0,0 2zM51.224,68q0.153,-1.018 0.407,-2L48,66a1,1 0,1 0,0 2z"
80+
android:fillColor="#000"
81+
android:fillAlpha="0.1"/>
82+
<path
83+
android:pathData="M24,47a2,2 0,1 1,4 0,2 2,0 0,1 -4,0"
84+
android:fillColor="#ccc"/>
85+
<path
86+
android:pathData="M71,87c8.837,0 16,-7.163 16,-16s-7.163,-16 -16,-16 -16,7.163 -16,16 7.163,16 16,16"
87+
android:fillColor="#557ff3"/>
88+
<path
89+
android:pathData="M92.502,59c0.297,0 0.594,0.12 0.822,0.354 0.454,0.468 0.454,1.23 0,1.698l-2.333,2.4a1.145,1.145 0,0 1,-1.65 0,1.227 1.227,0 0,1 0,-1.698l2.333,-2.4c0.227,-0.234 0.524,-0.354 0.822,-0.354zM91.335,69.798h3.499c0.641,0 1.166,0.54 1.166,1.2s-0.525,1.2 -1.166,1.2h-3.499c-0.641,0 -1.166,-0.54 -1.166,-1.2s0.525,-1.2 1.166,-1.2m-1.982,8.754c0.227,-0.234 0.525,-0.354 0.822,-0.354h0.006c0.297,0 0.595,0.12 0.822,0.354l2.332,2.4c0.455,0.467 0.455,1.23 0,1.697a1.145,1.145 0,0 1,-1.65 0l-2.332,-2.4a1.227,1.227 0,0 1,0 -1.697"
90+
android:fillColor="#ccc"/>
91+
<path
92+
android:pathData="M75.5,72a4.5,4.5 0,1 1,-4.242 6H62.5a1.5,1.5 0,0 1,0 -3h8.758a4.5,4.5 0,0 1,4.242 -3m-9,-11a4.5,4.5 0,0 1,4.242 3H79.5a1.5,1.5 0,0 1,0 3h-8.758a4.5,4.5 0,1 1,-4.242 -6"
93+
android:fillColor="#fff"/>
94+
</vector>

app/src/main/java/com/duckduckgo/app/browser/remotemessage/RemoteMessageMapper.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import com.duckduckgo.remote.messaging.api.Content.Medium
2525
import com.duckduckgo.remote.messaging.api.Content.Placeholder
2626
import com.duckduckgo.remote.messaging.api.Content.Placeholder.ANNOUNCE
2727
import com.duckduckgo.remote.messaging.api.Content.Placeholder.APP_UPDATE
28+
import com.duckduckgo.remote.messaging.api.Content.Placeholder.BOOKMARKS_IMPORT
2829
import com.duckduckgo.remote.messaging.api.Content.Placeholder.CRITICAL_UPDATE
2930
import com.duckduckgo.remote.messaging.api.Content.Placeholder.DDG_ANNOUNCE
3031
import com.duckduckgo.remote.messaging.api.Content.Placeholder.DUCK_AI
@@ -33,6 +34,7 @@ import com.duckduckgo.remote.messaging.api.Content.Placeholder.IMAGE_AI
3334
import com.duckduckgo.remote.messaging.api.Content.Placeholder.KEY_IMPORT
3435
import com.duckduckgo.remote.messaging.api.Content.Placeholder.MAC_AND_WINDOWS
3536
import com.duckduckgo.remote.messaging.api.Content.Placeholder.MAC_AND_WINDOWS_NEW
37+
import com.duckduckgo.remote.messaging.api.Content.Placeholder.NEW_TAB_OPTIONS
3638
import com.duckduckgo.remote.messaging.api.Content.Placeholder.PRIVACY_SHIELD
3739
import com.duckduckgo.remote.messaging.api.Content.Placeholder.RADAR
3840
import com.duckduckgo.remote.messaging.api.Content.Placeholder.SPLIT_BAR_SETTINGS
@@ -112,5 +114,7 @@ private fun Placeholder.drawable(isLightModeEnabled: Boolean): Int {
112114
RADAR -> R.drawable.ic_radar
113115
KEY_IMPORT -> R.drawable.ic_key_import
114116
SPLIT_BAR_SETTINGS -> R.drawable.ic_split_bar_mobile_settings
117+
BOOKMARKS_IMPORT -> R.drawable.bookmarks_import_96
118+
NEW_TAB_OPTIONS -> R.drawable.newtab_options_96
115119
}
116120
}

remote-messaging/remote-messaging-api/src/main/java/com/duckduckgo/remote/messaging/api/RemoteMessage.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ sealed class Content(val messageType: MessageType) {
119119
RADAR("Radar"),
120120
KEY_IMPORT("KeyImport"),
121121
SPLIT_BAR_SETTINGS("SplitBarSettings"),
122+
BOOKMARKS_IMPORT("BookmarksImport"),
123+
NEW_TAB_OPTIONS("NewTabOptions"),
122124
;
123125

124126
companion object {

remote-messaging/remote-messaging-impl/src/main/java/com/duckduckgo/remote/messaging/impl/mappers/RemoteMessageMapper.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import com.duckduckgo.remote.messaging.api.Content.Medium
2525
import com.duckduckgo.remote.messaging.api.Content.Placeholder
2626
import com.duckduckgo.remote.messaging.api.Content.Placeholder.ANNOUNCE
2727
import com.duckduckgo.remote.messaging.api.Content.Placeholder.APP_UPDATE
28+
import com.duckduckgo.remote.messaging.api.Content.Placeholder.BOOKMARKS_IMPORT
2829
import com.duckduckgo.remote.messaging.api.Content.Placeholder.CRITICAL_UPDATE
2930
import com.duckduckgo.remote.messaging.api.Content.Placeholder.DDG_ANNOUNCE
3031
import com.duckduckgo.remote.messaging.api.Content.Placeholder.DUCK_AI
@@ -33,6 +34,7 @@ import com.duckduckgo.remote.messaging.api.Content.Placeholder.IMAGE_AI
3334
import com.duckduckgo.remote.messaging.api.Content.Placeholder.KEY_IMPORT
3435
import com.duckduckgo.remote.messaging.api.Content.Placeholder.MAC_AND_WINDOWS
3536
import com.duckduckgo.remote.messaging.api.Content.Placeholder.MAC_AND_WINDOWS_NEW
37+
import com.duckduckgo.remote.messaging.api.Content.Placeholder.NEW_TAB_OPTIONS
3638
import com.duckduckgo.remote.messaging.api.Content.Placeholder.PRIVACY_SHIELD
3739
import com.duckduckgo.remote.messaging.api.Content.Placeholder.RADAR
3840
import com.duckduckgo.remote.messaging.api.Content.Placeholder.SPLIT_BAR_SETTINGS
@@ -117,5 +119,7 @@ fun Placeholder.drawable(isLightModeEnabled: Boolean): Int {
117119
RADAR -> R.drawable.ic_radar
118120
KEY_IMPORT -> R.drawable.ic_key_import
119121
SPLIT_BAR_SETTINGS -> R.drawable.ic_split_bar_mobile_settings
122+
BOOKMARKS_IMPORT -> R.drawable.bookmarks_import_96
123+
NEW_TAB_OPTIONS -> R.drawable.newtab_options_96
120124
}
121125
}

0 commit comments

Comments
 (0)