I'm trying out the Android Slices and found that there is no way to build the Slice Row with setTitleItem only. I want to create the Slice as like the attached screenshot. But it appears that setTitleItem
method not working.
Artifact used implementation 'androidx.slice:slice-builders-ktx:1.0.0-alpha4
return list(context, sliceUri, ListBuilder.INFINITY) {
row {
setTitleItem(createActivityAction(Intent(context, MainActivity::class.java), R.drawable.ic_pizza_slice_24, SliceHints.ICON_IMAGE))
title = "Welcome Android Slice"
subtitle = "It has Start Item"
}
}
I've opened a Google Issue but it's not helpful.
Please let me know if anybody knows what I'm doing wrong here.
The code is here: