Skip to content

Commit 1d1bed7

Browse files
authored
Merge pull request #11 from rushhiii/test2
Update MyToyota.js
2 parents 742cffd + 291eadf commit 1d1bed7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Toyota Widget/MyToyota.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ function addDetailsGrid(widget) {
6565
addDetailBlock(row2, "Status", carInfo.status)
6666
}
6767

68+
// Toyota Car Widget - Part 6: Text-only layout for small/medium
69+
function buildCompactWidget(widget) {
70+
widget.setPadding(12, 14, 12, 14)
71+
72+
const title = widget.addText(`${carInfo.brand} ${carInfo.model}`)
73+
title.font = Font.boldSystemFont(16)
74+
title.textColor = textColor
75+
widget.addSpacer(6)
76+
77+
addDetailText(widget, "Year", carInfo.year)
78+
addDetailText(widget, "Mileage", carInfo.mileage)
79+
addDetailText(widget, "Fuel", carInfo.fuel)
80+
addDetailText(widget, "Status", carInfo.status)
81+
}
82+
6883

6984
// Toyota Car Widget - Part 5: Add key-value detail box
7085
function addDetailBlock(stack, label, value) {

0 commit comments

Comments
 (0)