Skip to content

Commit 7168fe3

Browse files
authored
[Android] "What’s New" promo message: Add new message type to show a list view (#7072)
Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1211783737656574?focus=true ### Description Added support for a new "What's New" message type in the remote messaging system. This includes: 1. Added a new `REMOTE_WHATS_NEW_MESSAGE` type to the `MessageCta` class. 2. Added new icon assets for AI features, key import, and radar functionality. 3. Implemented a new `CardsList` content type for displaying feature cards. 4. Added support for `UrlInContext` action type to open URLs in a contextual webview. 5. Created placeholder implementations for handling the new message type and actions. ### Steps to test this PR - [x] Tests should pass. - [x] No remote message shown if one containing CardList comes from the server as the feature is not complete. - [x] A remote message not containing CardList is shown. See Asana for more details. ### NO UI changes
1 parent 5aff230 commit 7168fe3

File tree

25 files changed

+927
-41
lines changed

25 files changed

+927
-41
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
xmlns:aapt="http://schemas.android.com/aapt"
19+
android:width="96dp"
20+
android:height="96dp"
21+
android:viewportWidth="96"
22+
android:viewportHeight="96">
23+
<path
24+
android:pathData="M29,69h24.906c0.628,-3.499 1.627,-3.634 3.142,-6.267 2.305,-4.01 5.706,-6.68 10.158,-7.77l1.443,-8.82a7.81,7.81 0,0 1,8.182 -6.534c1.503,0.094 3.169,-0.922 3.169,-2.427V26a6,6 0,0 0,-6 -6H29a6,6 0,0 0,-6 6v40c0,3.314 2.686,3 6,3"
25+
android:fillColor="#ccc"/>
26+
<path
27+
android:pathData="M54,68.5c0,-0.5 1.68,-3.387 3.048,-5.768 2.305,-4.008 5.706,-6.679 10.158,-7.77l1.443,-8.82A7.81,7.81 0,0 1,75 39.716V27a6,6 0,0 0,-6 -6H23a6,6 0,0 0,-6 6v38a6,6 0,0 0,6 6z"
28+
android:fillColor="#7295f6"/>
29+
<path
30+
android:pathData="M68.677,46A7.81,7.81 0,0 1,76 39.602V26a6,6 0,0 0,-6 -6H22a6,6 0,0 0,-6 6v20z"
31+
android:fillColor="#8fabf9"/>
32+
<path
33+
android:pathData="M54.594,68.887c0.602,-2.262 1.404,-4.329 2.454,-6.155 2.305,-4.008 5.706,-6.679 10.158,-7.77l1.443,-8.82a7.8,7.8 0,0 1,0.909 -2.583l-7.123,-7.123a5,5 0,0 0,-6.968 -0.1L21,68.886h33.594Z"
34+
android:fillColor="#b3f1aa"/>
35+
<path
36+
android:pathData="M54.563,69c0.605,-2.306 1.417,-4.411 2.485,-6.268a17.7,17.7 0,0 1,2.406 -3.277l-15.919,-15.92a5,5 0,0 0,-7.07 0L19,61v8z"
37+
android:fillColor="#7bd66d"/>
38+
<path
39+
android:pathData="M34,46h-4v4h4zM30,50h-4v4h4zM26,54h-4v4h4zM22,62v-4h-4v4z"
40+
android:fillColor="#7bd66d"/>
41+
<path
42+
android:pathData="M38,46h-4v4h4zM34,50h-4v4h4zM30,54h-4v4h4zM26,58h-4v4h4zM22,66v-4h-4v4z"
43+
android:fillColor="#96e38a"/>
44+
<path
45+
android:pathData="M54,46h-4v4h4zM58,50h-4v4h4zM61.01,58q0.48,-0.39 0.99,-0.738L62,54h-4v4z"
46+
android:fillColor="#d3ffcc"/>
47+
<path
48+
android:pathData="M50,46h-4v4h4zM54,50h-4v4h4zM58,54h-4v4h4z"
49+
android:fillColor="#b3f1aa"/>
50+
<path
51+
android:pathData="M54.563,69c0.605,-2.306 1.417,-4.411 2.485,-6.268 2.305,-4.008 5.706,-6.679 10.158,-7.77l1.443,-8.82 0.028,-0.142H19v23z"
52+
android:strokeAlpha="0.2"
53+
android:fillColor="#557ff3"
54+
android:fillAlpha="0.2"/>
55+
<path
56+
android:pathData="M68.677,46A7.8,7.8 0,0 1,73 40.355V35H19v11z"
57+
android:strokeAlpha="0.6"
58+
android:fillAlpha="0.6">
59+
<aapt:attr name="android:fillColor">
60+
<gradient
61+
android:startX="46"
62+
android:startY="46"
63+
android:endX="46"
64+
android:endY="35"
65+
android:type="linear">
66+
<item android:offset="0" android:color="#66FFFFFF"/>
67+
<item android:offset="0.648" android:color="#00FFFFFF"/>
68+
</gradient>
69+
</aapt:attr>
70+
</path>
71+
<path
72+
android:pathData="M57.491,62c2.29,-3.602 5.54,-6.015 9.715,-7.037l0.157,-0.963H19v8z"
73+
android:strokeAlpha="0.2"
74+
android:fillColor="#14307e"
75+
android:fillAlpha="0.2"/>
76+
<path
77+
android:pathData="M52.727,70c0.93,0 1.732,-0.644 1.983,-1.54 0.588,-2.095 1.354,-4.017 2.338,-5.728q0.215,-0.374 0.443,-0.732H19v8z"
78+
android:strokeAlpha="0.4"
79+
android:fillColor="#14307e"
80+
android:fillAlpha="0.4"/>
81+
<path
82+
android:pathData="M51.396,72c1.453,0 2.682,-1.045 3.028,-2.456q0.193,-0.788 0.418,-1.544H22a2,2 0,0 1,-2 -2V26a2,2 0,0 1,2 -2h48a2,2 0,0 1,2 2v14.926a7.8,7.8 0,0 1,4 -1.324V26a6,6 0,0 0,-5.691 -5.992L70,20H22a6,6 0,0 0,-6 6v40l0.008,0.309A6,6 0,0 0,22 72z"
83+
android:fillColor="#eee"/>
84+
<path
85+
android:pathData="M39,34a6,6 0,1 1,-12 0,6 6,0 0,1 12,0"
86+
android:fillColor="#ffd65c"/>
87+
<path
88+
android:pathData="m72.597,46.789 l-2.822,17.243a2.557,2.557 0,0 0,4.964 1.181l5.246,-16.666a3.807,3.807 0,1 0,-7.388 -1.758"
89+
android:fillColor="#557ff3"/>
90+
<path
91+
android:pathData="M85.234,84H60.413c-1.885,0 -3.422,-1.533 -3.352,-3.416 0.524,-14.121 4.527,-22.176 15.017,-22.176 7.102,0 10.514,6.825 10.514,11.943 0,3.677 2.006,7.567 4.116,10.469 0.9,1.236 0.055,3.18 -1.474,3.18"
92+
android:fillColor="#ffde7a"/>
93+
<path
94+
android:pathData="M85.234,84H60.413c-1.885,0 -3.422,-1.532 -3.352,-3.416 0.524,-14.121 4.527,-22.176 15.017,-22.176 7.102,0 10.514,6.825 10.514,11.943 0,3.677 2.006,7.567 4.116,10.469 0.9,1.237 0.055,3.18 -1.474,3.18m-17.018,-4h4.924c-0.008,-1.39 0.134,-3.548 0.921,-5.384 0.262,1.836 1.653,3.994 2.686,5.384h4.692c-1.38,-2.468 -2.548,-5.4 -2.798,-8.459L63.07,68.644C61.998,71.37 61.32,75.106 61.09,80h3.52c-0.007,-1.39 0.135,-3.548 0.922,-5.384 0.262,1.836 1.653,3.994 2.685,5.384ZM65.24,64.98c1.522,-1.66 3.625,-2.572 6.839,-2.572 2.092,0 3.599,0.941 4.708,2.436a9.2,9.2 0,0 1,1.295 2.524z"
95+
android:fillColor="#f9be1a"
96+
android:fillType="evenOdd"/>
97+
<path
98+
android:pathData="M92.501,59c0.298,0 0.595,0.12 0.823,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"
99+
android:fillColor="#ccc"/>
100+
</vector>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
xmlns:aapt="http://schemas.android.com/aapt"
19+
android:width="96dp"
20+
android:height="96dp"
21+
android:viewportWidth="96"
22+
android:viewportHeight="96">
23+
<path
24+
android:pathData="M69.225,34.062c0,10.007 -8.112,18.12 -18.12,18.12a18.1,18.1 0,0 1,-5.466 -0.84l-3.026,3.026h-6.327v5.195c0,0.56 -0.453,1.014 -1.013,1.014L29.96,60.577v7.577c0,0.56 -0.453,1.014 -1.013,1.014L16,69.168L16,56.28l17.585,-17.584a18.2,18.2 0,0 1,-0.598 -4.635c0,-10.007 8.112,-18.12 18.119,-18.12s18.12,8.113 18.12,18.12ZM56.202,34.628a5.662,5.662 0,1 0,0 -11.324,5.662 5.662,0 0,0 0,11.324"
25+
android:fillColor="#e2a412"
26+
android:fillType="evenOdd"/>
27+
<path
28+
android:pathData="M72.225,34.062c0,10.007 -8.112,18.12 -18.12,18.12a18.1,18.1 0,0 1,-5.466 -0.84l-3.026,3.026h-6.327v5.195c0,0.56 -0.453,1.014 -1.013,1.014L32.96,60.577v7.577c0,0.56 -0.453,1.014 -1.013,1.014L19,69.168L19,56.28l17.585,-17.584a18.2,18.2 0,0 1,-0.598 -4.635c0,-10.007 8.112,-18.12 18.119,-18.12s18.12,8.113 18.12,18.12ZM59.202,34.628a5.662,5.662 0,1 0,0 -11.324,5.662 5.662,0 0,0 0,11.324"
29+
android:fillColor="#f9be1a"
30+
android:fillType="evenOdd"/>
31+
<path
32+
android:pathData="M68.177,51.198c6.244,-4.424 8.963,-12.662 6.11,-20.143 -3.383,-8.867 -13.313,-13.313 -22.18,-9.93 -8.867,3.382 -13.313,13.312 -9.93,22.18a17.2,17.2 0,0 0,2.096 3.904l-9.638,21.525 4.356,11.419h2.734c0.385,0 0.737,-0.219 0.908,-0.564l5.824,-11.768 3.012,-1.149c0.318,-1.438 0.79,-2.818 1.398,-4.122l-0.903,-2.369 3.01,-1.148a20,20 0,0 1,3.924 -3.957l0.33,-0.737q0.402,-0.024 0.804,-0.066a19.9,19.9 0,0 1,8.145 -3.075m-2.136,-22.17a5.37,5.37 0,1 1,-10.034 3.827,5.37 5.37,0 0,1 10.034,-3.827"
33+
android:fillColor="#e2a412"
34+
android:fillType="evenOdd"/>
35+
<path
36+
android:pathData="M51,71v2.239a5,5 0,0 1,-3.218 4.671l-5.879,2.243 -4.356,-11.419 9.638,-21.525a17.2,17.2 0,0 1,-2.097 -3.905c-3.382,-8.867 1.064,-18.797 9.93,-22.18 8.868,-3.382 18.798,1.064 22.18,9.931 2.606,6.83 0.567,14.291 -4.56,18.904 -0.795,0.716 -1.856,1.021 -2.922,1.107C59.417,51.89 51,60.376 51,71m17.954,-41.972a5.37,5.37 0,1 1,-10.035 3.828,5.37 5.37,0 0,1 10.035,-3.828"
37+
android:fillColor="#fc3"
38+
android:fillType="evenOdd"/>
39+
<path
40+
android:pathData="M61.037,26.42C61.903,27.341 63.273,28 65,28c3.062,0 5,-2.069 5,-4 0,-1.81 -1.703,-3.74 -4.437,-3.976a18.1,18.1 0,0 0,-5.093 -2.932A9.9,9.9 0,0 1,65 16c4.67,0 9,3.304 9,8s-4.33,8 -9,8c-2.355,0 -4.624,-0.84 -6.294,-2.276a5.37,5.37 0,0 1,2.33 -3.303Z"
41+
android:fillColor="#999"
42+
android:fillType="evenOdd"/>
43+
<path
44+
android:pathData="M69,31.161A10,10 0,0 1,65 32c-2.355,0 -4.624,-0.84 -6.294,-2.276a5.37,5.37 0,0 1,2.33 -3.303C61.904,27.34 63.273,28 65,28c1.752,0 3.136,-0.678 4,-1.62z"
45+
android:fillType="evenOdd">
46+
<aapt:attr name="android:fillColor">
47+
<gradient
48+
android:startX="62"
49+
android:startY="29"
50+
android:endX="68"
51+
android:endY="29"
52+
android:type="linear">
53+
<item android:offset="0" android:color="#FF5F5F5F"/>
54+
<item android:offset="1" android:color="#00999999"/>
55+
</gradient>
56+
</aapt:attr>
57+
</path>
58+
<path
59+
android:pathData="M92.501,59c0.298,0 0.595,0.12 0.823,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"
60+
android:fillColor="#ccc"/>
61+
<path
62+
android:pathData="M87,71c0,-8.837 -7.163,-16 -16,-16s-16,7.163 -16,16 7.163,16 16,16 16,-7.163 16,-16"
63+
android:fillColor="#557ff3"/>
64+
<path
65+
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"
66+
android:fillColor="#fff"
67+
android:fillType="evenOdd"/>
68+
</vector>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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="96dp"
19+
android:height="96dp"
20+
android:viewportWidth="96"
21+
android:viewportHeight="96">
22+
<path
23+
android:pathData="M35,20c-8.284,0 -15,6.716 -15,15v26c0,8.284 6.716,15 15,15h16v-5c0,-11.046 8.954,-20 20,-20h5V35c0,-8.284 -6.716,-15 -15,-15z"
24+
android:fillColor="#63c853"/>
25+
<path
26+
android:pathData="M34.75,16C24.257,16 16,24.507 16,35v26c0,10.493 8.257,19 18.75,19H47a4,4 0,0 0,4 -4v-5c0,-5.201 1.986,-9.938 5.24,-13.495L55.75,53h6.523A19.9,19.9 0,0 1,71 51h4.75a4,4 0,0 0,4 -4V35c0,-10.493 -8.507,-19 -19,-19z"
27+
android:fillColor="#999"/>
28+
<path
29+
android:pathData="M30.667,20C24.776,20 20,24.776 20,30.667v30.666C20,67.224 24.776,72 30.667,72H51v-1c0,-11.046 8.954,-20 20,-20h1V30.667C72,24.776 67.224,20 61.333,20z"
30+
android:fillColor="#e5e5e5"/>
31+
<path
32+
android:pathData="M30.667,16C22.567,16 16,22.567 16,30.667v30.666C16,69.433 22.567,76 30.667,76H51v-4H30.667l-0.549,-0.014c-5.454,-0.276 -9.828,-4.65 -10.104,-10.104L20,61.333V30.667c0,-5.707 4.482,-10.368 10.118,-10.653l0.549,-0.014h30.666l0.549,0.014C67.518,20.299 72,24.96 72,30.667V51h4V30.667C76,22.567 69.433,16 61.333,16z"
33+
android:fillColor="#ccc"/>
34+
<path
35+
android:pathData="M46,23c-12.703,0 -23,10.297 -23,23s10.297,23 23,23a23,23 0,0 0,5.167 -0.583c1.158,-8.98 8.27,-16.093 17.251,-17.251 0.381,-1.66 0.582,-3.39 0.582,-5.166 0,-12.703 -10.297,-23 -23,-23"
36+
android:fillColor="#288419"/>
37+
<path
38+
android:pathData="M46,23a22.93,22.93 0,0 1,16.263 6.736L46,46 32.328,27.503A22.9,22.9 0,0 1,46 23"
39+
android:strokeAlpha="0.1"
40+
android:fillColor="#d3ffcc"
41+
android:fillAlpha="0.1"/>
42+
<path
43+
android:pathData="M46,23a22.93,22.93 0,0 1,16.263 6.736L46.001,46l-8.384,-21.424A22.9,22.9 0,0 1,46 23"
44+
android:strokeAlpha="0.2"
45+
android:fillColor="#d3ffcc"
46+
android:fillAlpha="0.2"/>
47+
<path
48+
android:pathData="M46,23a22.93,22.93 0,0 1,16.263 6.736L46,46l-1.992,-22.913A23,23 0,0 1,46 23"
49+
android:strokeAlpha="0.2"
50+
android:fillColor="#d3ffcc"
51+
android:fillAlpha="0.2"/>
52+
<path
53+
android:pathData="M50.886,23.521c4.39,0.95 8.314,3.152 11.378,6.215L46,46z"
54+
android:strokeAlpha="0.2"
55+
android:fillColor="#d3ffcc"
56+
android:fillAlpha="0.2"/>
57+
<path
58+
android:pathData="M57.318,25.974a23,23 0,0 1,4.946 3.762L46,46z"
59+
android:strokeAlpha="0.3"
60+
android:fillColor="#d3ffcc"
61+
android:fillAlpha="0.3"/>
62+
<path
63+
android:pathData="M46,23c5.365,0 10.3,1.837 14.213,4.916A22.9,22.9 0,0 0,49 25c-12.703,0 -23,10.297 -23,23 0,7.337 3.436,13.872 8.786,18.083C27.755,62.148 23,54.63 23,46c0,-12.703 10.297,-23 23,-23"
64+
android:fillColor="#1a690d"/>
65+
<path
66+
android:pathData="M44,33.5a1.5,1.5 0,1 1,-3 0,1.5 1.5,0 0,1 3,0"
67+
android:fillColor="#d3ffcc"/>
68+
<path
69+
android:pathData="M34,44.5a1.5,1.5 0,1 1,-3 0,1.5 1.5,0 0,1 3,0m6,4a1.5,1.5 0,1 1,-3 0,1.5 1.5,0 0,1 3,0m14,6a1.5,1.5 0,1 1,-3 0,1.5 1.5,0 0,1 3,0"
70+
android:fillColor="#96e38a"/>
71+
<path
72+
android:pathData="M33.293,34.293a1,1 0,0 1,1.338 -0.068l0.076,0.068 0.793,0.793 0.793,-0.793 0.076,-0.068a1,1 0,0 1,1.406 1.406l-0.068,0.076 -0.793,0.793 0.793,0.793 0.068,0.076a1,1 0,0 1,-1.406 1.407l-0.076,-0.069 -0.793,-0.793 -0.793,0.793 -0.076,0.069a1,1 0,0 1,-1.407 -1.407l0.069,-0.076 0.793,-0.793 -0.793,-0.793 -0.069,-0.076a1,1 0,0 1,0.069 -1.338"
73+
android:fillColor="#d3ffcc"/>
74+
<path
75+
android:pathData="M59.293,47.293a1,1 0,0 1,1.338 -0.068l0.076,0.068 0.793,0.793 0.793,-0.793 0.076,-0.068a1,1 0,0 1,1.406 1.406l-0.068,0.076 -0.793,0.793 0.793,0.793 0.068,0.076a1,1 0,0 1,-1.406 1.407l-0.076,-0.069 -0.793,-0.793 -0.793,0.793 -0.076,0.069a1,1 0,0 1,-1.407 -1.407l0.069,-0.076 0.793,-0.793 -0.793,-0.793 -0.069,-0.076a1,1 0,0 1,0.069 -1.338m-22,9a1,1 0,0 1,1.338 -0.068l0.076,0.068 0.793,0.793 0.793,-0.793 0.076,-0.068a1,1 0,0 1,1.406 1.406l-0.068,0.076 -0.793,0.793 0.793,0.793 0.068,0.076a1,1 0,0 1,-1.406 1.407l-0.076,-0.069 -0.793,-0.793 -0.793,0.793 -0.076,0.069a1,1 0,0 1,-1.407 -1.407l0.069,-0.076 0.793,-0.793 -0.793,-0.793 -0.069,-0.076a1,1 0,0 1,0.069 -1.338"
76+
android:fillColor="#96e38a"/>
77+
<path
78+
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"
79+
android:fillColor="#21c000"/>
80+
<path
81+
android:pathData="M79.885,68.31c0.52,-0.52 0.52,-1.365 0,-1.885l-1.859,-1.86a1.333,1.333 0,0 0,-1.885 0l-6.538,6.54c-0.52,0.52 -1.365,0.52 -1.885,0l-1.86,-1.86a1.333,1.333 0,0 0,-1.884 0l-1.859,1.86c-0.52,0.52 -0.52,1.364 0,1.884l5.603,5.603c0.52,0.52 1.364,0.52 1.885,0z"
82+
android:fillColor="#fff"/>
83+
<path
84+
android:pathData="M92.501,59c0.298,0 0.595,0.12 0.823,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"
85+
android:fillColor="#ccc"/>
86+
</vector>

app/src/main/java/com/duckduckgo/app/browser/newtab/NewTabLegacyPageView.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,11 @@ class NewTabLegacyPageView @JvmOverloads constructor(
222222
newMessage: Boolean,
223223
) {
224224
val parentVisible = (this.parent as? View)?.isVisible ?: false
225+
val msg = message.asMessage(isLightModeEnabled = appTheme.isLightModeEnabled())
225226
val shouldRender = parentVisible && (newMessage || binding.messageCta.isGone)
226227

227-
if (shouldRender) {
228-
binding.messageCta.setMessage(message.asMessage(isLightModeEnabled = appTheme.isLightModeEnabled()))
228+
if (msg != null && shouldRender) {
229+
binding.messageCta.setMessage(msg)
229230
binding.messageCta.onCloseButtonClicked {
230231
viewModel.onMessageCloseButtonClicked()
231232
}

app/src/main/java/com/duckduckgo/app/browser/newtab/NewTabLegacyPageViewModel.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import com.duckduckgo.common.utils.playstore.PlayStoreUtils
3232
import com.duckduckgo.mobile.android.app.tracking.AppTrackingProtection
3333
import com.duckduckgo.remote.messaging.api.RemoteMessage
3434
import com.duckduckgo.remote.messaging.api.RemoteMessageModel
35+
import com.duckduckgo.remote.messaging.api.Surface
3536
import com.duckduckgo.savedsites.api.SavedSitesRepository
3637
import com.duckduckgo.savedsites.api.models.SavedSite.Favorite
3738
import com.duckduckgo.sync.api.engine.SyncEngine
@@ -47,6 +48,7 @@ import kotlinx.coroutines.flow.asStateFlow
4748
import kotlinx.coroutines.flow.combine
4849
import kotlinx.coroutines.flow.flowOn
4950
import kotlinx.coroutines.flow.launchIn
51+
import kotlinx.coroutines.flow.map
5052
import kotlinx.coroutines.flow.onEach
5153
import kotlinx.coroutines.flow.receiveAsFlow
5254
import kotlinx.coroutines.flow.update
@@ -123,7 +125,12 @@ class NewTabLegacyPageViewModel @AssistedInject constructor(
123125

124126
viewModelScope.launch(dispatchers.io()) {
125127
savedSitesRepository.getFavorites()
126-
.combine(remoteMessagingModel.getActiveMessages()) { favorites, activeMessage ->
128+
.combine(
129+
remoteMessagingModel.getActiveMessages()
130+
.map { message ->
131+
if (message?.surfaces?.contains(Surface.NEW_TAB_PAGE) == true) message else null
132+
},
133+
) { favorites, activeMessage ->
127134
if (favorites.isNotEmpty()) {
128135
syncEngine.triggerSync(FEATURE_READ)
129136
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.duckduckgo.app.browser.remotemessage
1818

19-
import com.duckduckgo.app.browser.commands.Command
20-
import com.duckduckgo.app.browser.commands.Command.*
2119
import com.duckduckgo.app.browser.newtab.NewTabLegacyPageViewModel
2220
import com.duckduckgo.di.scopes.ActivityScope
2321
import com.duckduckgo.remote.messaging.api.Action
@@ -39,6 +37,7 @@ class RealCommandActionMapper @Inject constructor(
3937
is Dismiss -> NewTabLegacyPageViewModel.Command.DismissMessage
4038
is PlayStore -> NewTabLegacyPageViewModel.Command.LaunchPlayStore(action.value)
4139
is Url -> NewTabLegacyPageViewModel.Command.SubmitUrl(action.value)
40+
is UrlInContext -> NewTabLegacyPageViewModel.Command.SubmitUrl(action.value)
4241
is DefaultBrowser -> NewTabLegacyPageViewModel.Command.LaunchDefaultBrowser
4342
is AppTpOnboarding -> NewTabLegacyPageViewModel.Command.LaunchAppTPOnboarding
4443
is Share -> NewTabLegacyPageViewModel.Command.SharePromoLinkRMF(action.value, action.title)

0 commit comments

Comments
 (0)