Код: Выделить всё
class TimerTileRenderer(context: Context): SingleTileLayoutRenderer(context) {
//... code for produce resources for images and stuff omitted.
override fun renderTile(
state: TimerTileState,
deviceParameters: DeviceParametersBuilders.DeviceParameters
): LayoutElementBuilders.LayoutElement {
return timerTileLayout(
context,
deviceParameters,
state,
emptyClick
)
}
}
private fun timerTileLayout(
context: Context,
deviceParameters: DeviceParametersBuilders.DeviceParameters,
state: TimerTileState,
buttonClickable: ModifiersBuilders.Clickable
) = PrimaryLayout.Builder(deviceParameters)
.setContent(
Column.Builder()
.setHeight(expand())
.setWidth(expand())
.addContent(
Text.Builder().setText("Just a TEST").build()
)
.build()
)
.build()
Однако, если я удалю столбец и просто использую там текст, я увижу текст.. .
Код: Выделить всё
private fun timerTileLayout(
context: Context,
deviceParameters: DeviceParameters,
state: TimerTileState,
buttonClickable: ModifiersBuilders.Clickable
) = PrimaryLayout.Builder(deviceParameters)
.setContent(
Text.Builder().setText("Just a TEST").build()
)
.setPrimaryChipContent(...)
.build()
Я знаю, что есть такие вещи, как MultiButtonLayout, но мне это не нужно. стиль, просто текст и кнопка. Что я могу попробовать дальше?
Подробнее здесь: https://stackoverflow.com/questions/764 ... roid-watch
Мобильная версия