Skip to content

Commit b06b1b6

Browse files
committed
Add sparkle drawable and use as fallback icon
Introduce a vector drawable (res/drawable/sparkle.xml) and use it as the fallback prompt icon. Update SuggestedPromptItem to load the drawable via painterResource(R.drawable.sparkle), prefer prompt.imageVector when present, and adjust icon sizing.
1 parent 8c4a68b commit b06b1b6

2 files changed

Lines changed: 48 additions & 9 deletions

File tree

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/components/welcomescreen/SuggestedPromptItem.kt

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
2424
import androidx.compose.foundation.layout.padding
2525
import androidx.compose.foundation.layout.size
2626
import androidx.compose.foundation.layout.width
27-
import androidx.compose.material.icons.Icons
28-
import androidx.compose.material.icons.filled.AutoAwesome
2927
import androidx.compose.material3.Icon
28+
import androidx.compose.ui.res.painterResource
29+
import com.adobe.marketing.mobile.concierge.R
3030
import androidx.compose.material3.Surface
3131
import androidx.compose.material3.Text
3232
import androidx.compose.ui.text.style.TextOverflow
@@ -37,6 +37,7 @@ import androidx.compose.ui.graphics.Color
3737
import androidx.compose.ui.graphics.painter.Painter
3838
import androidx.compose.ui.graphics.vector.ImageVector
3939
import androidx.compose.ui.layout.ContentScale
40+
import androidx.compose.ui.unit.dp
4041
import com.adobe.marketing.mobile.concierge.ui.components.image.AsyncImage
4142
import com.adobe.marketing.mobile.concierge.ui.theme.ConciergeStyles
4243
import com.adobe.marketing.mobile.concierge.ui.theme.ConciergeTheme
@@ -99,12 +100,21 @@ internal fun SuggestedPromptItem(
99100
Spacer(modifier = Modifier.width(style.promptImageSpacing))
100101
} else {
101102
// Compact chip layout: small icon only
102-
Icon(
103-
imageVector = prompt.imageVector ?: Icons.Default.AutoAwesome,
104-
contentDescription = null,
105-
tint = style.promptTextColor.copy(alpha = 0.6f),
106-
modifier = Modifier.size(style.promptImageSize)
107-
)
103+
if (prompt.imageVector != null) {
104+
Icon(
105+
imageVector = prompt.imageVector,
106+
contentDescription = null,
107+
tint = style.promptTextColor.copy(alpha = 0.6f),
108+
modifier = Modifier.size(16.dp)
109+
)
110+
} else {
111+
Icon(
112+
painter = painterResource(R.drawable.sparkle),
113+
contentDescription = null,
114+
tint = style.promptTextColor.copy(alpha = 0.6f),
115+
modifier = Modifier.size(16.dp)
116+
)
117+
}
108118
Spacer(modifier = Modifier.width(style.promptImageSpacing))
109119
}
110120

@@ -147,8 +157,14 @@ private fun PromptImage(
147157
modifier = Modifier.size(style.promptImageSize),
148158
contentScale = ContentScale.Crop
149159
)
160+
prompt.imageVector != null -> Icon(
161+
imageVector = prompt.imageVector,
162+
contentDescription = null,
163+
tint = style.promptTextColor.copy(alpha = 0.6f),
164+
modifier = Modifier.size(style.promptImageSize * 0.6f)
165+
)
150166
else -> Icon(
151-
imageVector = prompt.imageVector ?: Icons.Default.AutoAwesome,
167+
painter = painterResource(R.drawable.sparkle),
152168
contentDescription = null,
153169
tint = style.promptTextColor.copy(alpha = 0.6f),
154170
modifier = Modifier.size(style.promptImageSize * 0.6f)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
Copyright 2026 Adobe. All rights reserved.
3+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License. You may obtain a copy
5+
of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
Unless required by applicable law or agreed to in writing, software distributed under
8+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
OF ANY KIND, either express or implied. See the License for the specific language
10+
governing permissions and limitations under the License.
11+
-->
12+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
13+
android:width="12dp"
14+
android:height="13dp"
15+
android:viewportWidth="12"
16+
android:viewportHeight="13">
17+
<path
18+
android:fillColor="#FF000000"
19+
android:pathData="M8.88958,6.75385C8.87618,6.74905 8.86245,6.74552 8.84845,6.74312L8.84492,6.74045L8.81292,6.71872C8.78605,6.70245 8.75805,6.68799 8.72925,6.67545C8.65138,6.64212 8.57078,6.61539 8.48845,6.59552C7.90345,6.46259 7.35752,6.19499 6.89405,5.81405C5.85398,4.88608 5.18792,3.61068 5.02078,2.22684C4.98558,2.02769 4.96065,1.82688 4.94598,1.62518L4.92572,1.39633L4.92138,1.34857C4.91965,1.32107 4.91492,1.29384 4.90725,1.26739C4.88905,1.20363 4.85218,1.14677 4.80138,1.10418C4.75058,1.06158 4.6882,1.03519 4.62226,1.02843C4.5563,1.02166 4.48984,1.03482 4.43145,1.06621C4.37306,1.0976 4.32542,1.14578 4.29468,1.20452C4.27106,1.25063 4.25736,1.30117 4.25446,1.3529L4.2511,1.38799C4.22285,1.38983 4.21943,1.38973 4.2511,1.38799L4.2508,1.39117L4.22895,1.62118C4.1928,2.03091 4.1243,2.43714 4.02405,2.83607C3.83768,3.60895 3.50278,4.33822 3.038,4.98325C2.62544,5.54479 2.08114,5.99632 1.45304,6.29805L1.13514,6.42319C0.980963,6.47805 0.767916,6.51992 0.652836,6.56939L0.0596962,6.77779C0.0268896,6.79519 0.0441629,6.80432 0.0340295,6.81779L0.00222958,6.92605C0.000656246,6.94059 -0.0000238223,6.95525 0.000189511,6.96985C-0.000523822,6.97905 0.000782937,6.98825 0.00400294,6.99692L0.0423896,7.12619C0.128896,7.19319 0.219729,7.25439 0.314309,7.30939C0.642543,7.34865 0.964649,7.42845 1.27326,7.54692L1.41355,7.60145C1.45274,7.61605 1.49068,7.63385 1.52698,7.65465L1.76748,7.77885C2.14338,8.00039 2.48406,8.27679 2.77823,8.59905C3.46985,9.41079 3.938,10.3887 4.13654,11.4365C4.19529,11.7264 4.23856,12.0193 4.26615,12.3138L4.29089,12.5615C4.29242,12.5857 4.29628,12.6097 4.30243,12.6331C4.31799,12.6928 4.35193,12.7462 4.39947,12.7857C4.44701,12.8251 4.50574,12.8487 4.56738,12.853C4.62901,12.8573 4.69044,12.8421 4.74298,12.8096C4.79552,12.7771 4.83652,12.7289 4.86025,12.6719C4.87418,12.6379 4.88245,12.6019 4.88465,12.5653L4.88585,12.5516L4.89512,12.4419L4.93238,12.0065C4.99918,11.4607 5.12285,10.9235 5.30132,10.4034C5.55225,9.65172 5.97058,8.96685 6.52472,8.40045C6.97878,7.94125 7.53672,7.59819 8.15132,7.40019C8.56598,7.26325 8.80698,7.25032 8.84892,7.20645C8.87405,7.18859 8.82725,7.11399 8.87765,7.11492C8.92325,7.10592 8.96352,7.07952 8.98992,7.04125C9.01632,7.00299 9.02672,6.95599 9.01892,6.91019C9.01285,6.86839 8.99325,6.82979 8.96305,6.80025C8.94212,6.77979 8.91705,6.76392 8.88958,6.75385Z"/>
20+
<path
21+
android:fillColor="#FF000000"
22+
android:pathData="M11.9688,2.60821C11.9449,2.56568 11.9056,2.53387 11.859,2.51929C11.8012,2.50641 11.8403,2.51031 11.826,2.50503L11.8143,2.48666C11.8052,2.47414 11.7949,2.46258 11.7835,2.45216C11.7573,2.42858 11.727,2.40999 11.6942,2.39732C11.5958,2.37037 11.4994,2.33679 11.4055,2.29682C11.1762,2.18656 10.9769,2.02262 10.8243,1.81891C10.774,1.75312 10.7277,1.6843 10.6858,1.61283L10.6214,1.49795L10.5429,1.32857C10.5029,1.22385 10.4701,1.11655 10.4446,1.00741C10.4151,0.886254 10.3801,0.795494 10.355,0.641374C10.3278,0.499074 10.3004,0.355521 10.2727,0.210714C10.2665,0.162101 10.2572,0.166068 10.2487,0.157128L10.2228,0.134294L10.1704,0.088521L10.1198,0.045401L10.0925,0.0334011L10.0422,0.0121011L10.019,0.00273439L10.0131,0.000567641C10.0094,-0.000685692 9.99112,0.000474361 9.99605,0.000841027L9.98432,0.00361431C9.97738,0.00364765 9.93705,0.0160344 9.89725,0.0275744C9.86118,0.0502344 9.82685,0.0755411 9.79452,0.103288C9.77372,0.117221 9.75478,0.133854 9.73832,0.152754L9.67478,0.329254C9.64765,0.655921 9.57778,0.977615 9.46685,1.28607C9.40252,1.43261 9.39298,1.44946 9.36405,1.5047L9.28072,1.64676C9.17272,1.8187 9.03478,1.96993 8.87352,2.09329C8.85585,2.10827 8.83692,2.12171 8.81692,2.13349L8.72745,2.19257C8.61045,2.24767 8.48792,2.29018 8.36198,2.31939C8.30038,2.33508 8.23985,2.35466 8.18072,2.37802L8.02245,2.4397C7.94012,2.48642 7.87998,2.54395 7.89625,2.56875L7.86572,2.65295L7.86225,2.68814C7.86072,2.71434 7.86205,2.74063 7.86625,2.76654L7.89345,2.83859L7.91078,2.88339L7.95305,2.90994C8.01332,2.94723 8.08465,2.99149 8.17045,3.04467C8.30178,3.07391 8.42925,3.11761 8.58865,3.16214C8.65918,3.18219 8.72552,3.21467 8.78465,3.25805L8.86272,3.30819C8.98398,3.39841 9.09352,3.5033 9.18898,3.62045C9.24398,3.68993 9.29438,3.76291 9.33992,3.83893C9.40998,3.95065 9.46792,4.06956 9.51265,4.19363C9.65165,4.54709 9.68858,5.22725 9.88032,5.30292C9.89185,5.32665 9.91005,5.34665 9.93258,5.36045C9.95518,5.37425 9.98118,5.38125 10.0077,5.38072C10.0803,5.38072 10.2084,5.41592 10.3046,4.95852C10.3899,4.55293 10.4211,4.33803 10.4932,4.10397C10.5447,3.98087 10.565,3.94586 10.5853,3.90047L10.6582,3.77318C10.735,3.64539 10.8283,3.5283 10.9358,3.42497C11.2011,3.20841 11.5053,3.04447 11.8321,2.94197C11.8413,2.92677 11.8118,2.84875 11.8542,2.85253C11.8807,2.84869 11.9058,2.83834 11.9273,2.8224C11.9488,2.80647 11.966,2.78545 11.9773,2.76123C11.9887,2.73701 11.9939,2.71035 11.9924,2.68365C11.9909,2.65694 11.9828,2.63102 11.9688,2.60821Z"/>
23+
</vector>

0 commit comments

Comments
 (0)