importClass(Packages.tornaco.apps.shortx.core.proto.action.ShowListDialog);
importClass(Packages.tornaco.apps.shortx.core.proto.action.ShowListDialogDataType);
importClass(Packages.tornaco.apps.shortx.core.proto.common.DialogUiStyleSettings);
var dataJson = `[
{
"name": "Android",
"version": 16,
"__value": "android",
"__icon": "android-fill"
},
{
"name": "Ubuntu",
"version": 24,
"summary": "Ubuntu is the modern, open source operating system on Linux for the enterprise server, desktop, cloud, and IoT.",
"__value": "ubuntu",
"__icon": "ubuntu-fill"
}
]`;
var action = ShowListDialog.newBuilder()
.setTitle("choose")
.setData(dataJson)
.setDataType(ShowListDialogDataType.ShowListDialogDataType_Json)
.setStyle(
DialogUiStyleSettings.newBuilder()
.setFontScale(1.0)
.build()
)
.setIsMultipleChoice(true)
.setNeedConfirmAction(true)
.setCancelable(true)
.build();
var result = shortx.executeAction(action);
result.contextData.get("selectedListItem");