@@ -198,13 +198,24 @@ private fun TriggerScreenVertical(
198198 textAlign = TextAlign .Center ,
199199 )
200200
201- ShortcutRow (
202- modifier = Modifier
203- .padding(16 .dp)
204- .fillMaxWidth(),
205- shortcuts = configState.shortcuts,
206- onClick = onClickShortcut,
207- )
201+ if (configState.shortcuts.isNotEmpty()) {
202+ Column (horizontalAlignment = Alignment .CenterHorizontally ) {
203+ Text (
204+ text = stringResource(R .string.trigger_shortcuts_header),
205+ style = MaterialTheme .typography.titleSmall,
206+ )
207+
208+ Spacer (Modifier .height(8 .dp))
209+
210+ ShortcutRow (
211+ modifier = Modifier
212+ .padding(horizontal = 16 .dp)
213+ .fillMaxWidth(),
214+ shortcuts = configState.shortcuts,
215+ onClick = onClickShortcut,
216+ )
217+ }
218+ }
208219 }
209220 }
210221
@@ -285,15 +296,30 @@ private fun TriggerScreenHorizontal(
285296 textAlign = TextAlign .Center ,
286297 )
287298 Column {
288- ShortcutRow (
289- modifier = Modifier
290- .padding(16 .dp)
291- .fillMaxWidth()
292- .weight(1f )
293- .verticalScroll(state = rememberScrollState()),
294- shortcuts = configState.shortcuts,
295- onClick = onClickShortcut,
296- )
299+ if (configState.shortcuts.isNotEmpty()) {
300+ Column (
301+ modifier = Modifier
302+ .weight(1f )
303+ .verticalScroll(state = rememberScrollState()),
304+ horizontalAlignment = Alignment .CenterHorizontally ,
305+ verticalArrangement = Arrangement .Center ,
306+ ) {
307+ Text (
308+ text = stringResource(R .string.trigger_shortcuts_header),
309+ style = MaterialTheme .typography.titleSmall,
310+ )
311+
312+ Spacer (Modifier .height(8 .dp))
313+
314+ ShortcutRow (
315+ modifier = Modifier
316+ .padding(horizontal = 16 .dp)
317+ .fillMaxWidth(),
318+ shortcuts = configState.shortcuts,
319+ onClick = onClickShortcut,
320+ )
321+ }
322+ }
297323
298324 RecordTriggerButtonRow (
299325 modifier = Modifier .padding(start = 8 .dp, end = 8 .dp, bottom = 8 .dp),
@@ -419,12 +445,23 @@ private fun TriggerList(
419445 }
420446 }
421447
422- item(key = " shortcuts" , contentType = " shortcuts" ) {
423- ShortcutRow (
424- modifier = Modifier .fillMaxWidth(),
425- shortcuts = shortcuts,
426- onClick = { onClickShortcut(it) },
427- )
448+ if (shortcuts.isNotEmpty()) {
449+ item(key = " shortcuts" , contentType = " shortcuts" ) {
450+ Column (horizontalAlignment = Alignment .CenterHorizontally ) {
451+ Text (
452+ text = stringResource(R .string.trigger_shortcuts_header),
453+ style = MaterialTheme .typography.titleSmall,
454+ )
455+
456+ Spacer (Modifier .height(8 .dp))
457+
458+ ShortcutRow (
459+ modifier = Modifier .fillMaxWidth(),
460+ shortcuts = shortcuts,
461+ onClick = { onClickShortcut(it) },
462+ )
463+ }
464+ }
428465 }
429466 }
430467}
@@ -521,7 +558,7 @@ private val sampleList = listOf(
521558 id = " id3" ,
522559 assistantType = AssistantTriggerType .DEVICE ,
523560 clickType = ClickType .DOUBLE_PRESS ,
524- linkType = LinkType .ARROW ,
561+ linkType = LinkType .HIDDEN ,
525562 error = null ,
526563 ),
527564)
0 commit comments