@@ -38,10 +38,7 @@ import androidx.compose.ui.res.painterResource
38
38
import androidx.compose.ui.text.style.TextAlign
39
39
import androidx.compose.ui.tooling.preview.Preview
40
40
import androidx.compose.ui.unit.dp
41
- import com.esri.arcgismaps.kotlin.sampleviewer.model.CodeFile
42
41
import com.esri.arcgismaps.kotlin.sampleviewer.model.Sample
43
- import com.esri.arcgismaps.kotlin.sampleviewer.model.SampleCategory
44
- import com.esri.arcgismaps.kotlin.sampleviewer.model.SampleMetadata
45
42
import com.esri.arcgismaps.kotlin.sampleviewer.model.startSample
46
43
import com.esri.arcgismaps.kotlin.sampleviewer.ui.screens.sampleList.DropdownItemData
47
44
import com.esri.arcgismaps.kotlin.sampleviewer.ui.theme.SampleAppTheme
@@ -70,12 +67,12 @@ private fun TitleAndIconsRow(
70
67
var expandedDescription by rememberSaveable { mutableStateOf(false ) }
71
68
72
69
Row (
73
- verticalAlignment = Alignment .CenterVertically ,
74
- horizontalArrangement = Arrangement .SpaceBetween ,
75
70
modifier = Modifier
76
71
.fillMaxWidth()
77
72
.background(MaterialTheme .colorScheme.surfaceContainer)
78
- .padding(start = 16 .dp)
73
+ .padding(start = 16 .dp),
74
+ verticalAlignment = Alignment .CenterVertically ,
75
+ horizontalArrangement = Arrangement .SpaceBetween
79
76
) {
80
77
Column (
81
78
modifier = Modifier
@@ -125,7 +122,7 @@ private fun TitleAndIconsRow(
125
122
) {
126
123
Icon (
127
124
painter = painterResource(id = option.icon),
128
- contentDescription = null ,
125
+ contentDescription = " ${option.title} Icon " ,
129
126
tint = MaterialTheme .colorScheme.onSurface
130
127
)
131
128
Text (
@@ -139,7 +136,7 @@ private fun TitleAndIconsRow(
139
136
expandedMenu = option.title.lowercase().contains(" favorite" )
140
137
option.onClick()
141
138
},
142
- contentPadding = ExposedDropdownMenuDefaults .ItemContentPadding ,
139
+ contentPadding = ExposedDropdownMenuDefaults .ItemContentPadding
143
140
)
144
141
}
145
142
}
@@ -158,15 +155,17 @@ private fun ExpandedDescriptionAnimation(
158
155
exit = shrinkVertically()
159
156
) {
160
157
Row (
158
+ modifier = Modifier
159
+ .fillMaxWidth()
160
+ .padding(vertical = 8 .dp),
161
161
verticalAlignment = Alignment .CenterVertically ,
162
- horizontalArrangement = Arrangement .Start ,
163
- modifier = Modifier .fillMaxWidth().padding(vertical = 8 .dp)
162
+ horizontalArrangement = Arrangement .Start
164
163
) {
165
164
Text (
166
165
text = sample.metadata.description,
167
166
textAlign = TextAlign .Start ,
168
167
style = MaterialTheme .typography.bodyMedium,
169
- color = Color .Gray ,
168
+ color = Color .Gray
170
169
)
171
170
}
172
171
}
@@ -179,29 +178,8 @@ fun PreviewSampleCardItem() {
179
178
SampleAppTheme {
180
179
val dropdownItemData = listOf<DropdownItemData >()
181
180
SampleCardItem (
182
- Sample (
183
- name = " Analyze hotspots" ,
184
- codeFiles = listOf (CodeFile (" " , " " )),
185
- url = " " ,
186
- readMe = " " ,
187
- screenshotURL = " " ,
188
- metadata = SampleMetadata (
189
- description = " " ,
190
- formalName = " Analyze hotspots" ,
191
- ignore = false ,
192
- imagePaths = listOf (" " ),
193
- keywords = listOf (" " ),
194
- language = " " ,
195
- redirectFrom = listOf (" " ),
196
- relevantApis = listOf (" " ),
197
- sampleCategory = SampleCategory .ANALYSIS ,
198
- snippets = listOf (" " ),
199
- title = " Analyze hotspots"
200
- ),
201
- isFavorite = false ,
202
- mainActivity = " "
203
- ),
204
- dropdownItemData
181
+ sample = Sample .PREVIEW_INSTANCE ,
182
+ dropdownSampleItems = dropdownItemData
205
183
)
206
184
}
207
185
}
0 commit comments