|
|
… |
251 unchanged lines |
| 252 |
252 |
|
Text("Sign in to see your runs, inbox and reviews.", style = mute) |
| 253 |
253 |
|
return@Column |
| 254 |
254 |
|
} |
| 255 |
|
- |
if (d.runs.isEmpty()) Text("No runs yet.", style = mute) |
| 256 |
|
- |
d.runs.forEach { r -> |
| 257 |
|
- |
Row(GlanceModifier.fillMaxWidth().padding(vertical = 2.dp), verticalAlignment = Alignment.CenterVertically) { |
| 258 |
|
- |
Box(GlanceModifier.size(10.dp).cornerRadius(5.dp).background(colourOf(r.run.status))) {} |
| 259 |
|
- |
Spacer(GlanceModifier.width(8.dp)) |
| 260 |
|
- |
Text("${r.repository} #${r.run.number}", style = body, maxLines = 1, modifier = GlanceModifier.defaultWeight()) |
| 261 |
|
- |
Text(r.run.status, style = mute) |
|
255 |
+ |
// A widget's column shows ten children at most and drops the rest |
|
256 |
+ |
// without a word: each part is one child of its own (#33). |
|
257 |
+ |
Column(GlanceModifier.fillMaxWidth()) { |
|
258 |
+ |
if (d.runs.isEmpty()) Text("No runs yet.", style = mute) |
|
259 |
+ |
d.runs.forEach { r -> |
|
260 |
+ |
Row(GlanceModifier.fillMaxWidth().padding(vertical = 2.dp), verticalAlignment = Alignment.CenterVertically) { |
|
261 |
+ |
Box(GlanceModifier.size(10.dp).cornerRadius(5.dp).background(colourOf(r.run.status))) {} |
|
262 |
+ |
Spacer(GlanceModifier.width(8.dp)) |
|
263 |
+ |
Text("${r.repository} #${r.run.number}", style = body, maxLines = 1, modifier = GlanceModifier.defaultWeight()) |
|
264 |
+ |
Text(r.run.status, style = mute) |
|
265 |
+ |
} |
| 262 |
266 |
|
} |
| 263 |
267 |
|
} |
| 264 |
268 |
|
NeedsYou(d, body) |
|
|
… |
27 unchanged lines |
| 292 |
296 |
|
@Composable |
| 293 |
297 |
|
private fun Runner(d: WidgetData) { |
| 294 |
298 |
|
val jobs = d.runnerJobs ?: return |
| 295 |
|
- |
Spacer(GlanceModifier.height(4.dp)) |
| 296 |
|
- |
Row(GlanceModifier.fillMaxWidth().clickable(WidgetTaps.action("account")), verticalAlignment = Alignment.CenterVertically) { |
|
299 |
+ |
Row(GlanceModifier.fillMaxWidth().padding(top = 4.dp).clickable(WidgetTaps.action("account")), verticalAlignment = Alignment.CenterVertically) { |
| 297 |
300 |
|
Image(ImageProvider(R.drawable.widget_runner), contentDescription = "This phone runs", colorFilter = ColorFilter.tint(ok), modifier = GlanceModifier.size(13.dp)) |
| 298 |
301 |
|
Spacer(GlanceModifier.width(6.dp)) |
| 299 |
302 |
|
Text(runnerLine(jobs), style = TextStyle(color = GlanceTheme.colors.onSurface, fontSize = 12.sp), maxLines = 1) |
|
|
… |
6 unchanged lines |
| 306 |
309 |
|
val r = d.topReview |
| 307 |
310 |
|
val i = d.topAssigned |
| 308 |
311 |
|
if (r == null && i == null) return |
| 309 |
|
- |
Spacer(GlanceModifier.height(8.dp)) |
| 310 |
|
- |
Text("Needs you", style = TextStyle(color = GlanceTheme.colors.onSurfaceVariant, fontSize = 11.sp, fontWeight = FontWeight.Bold)) |
| 311 |
|
- |
r?.let { NeedLine(R.drawable.widget_proposal, "Review ${it.repository} #${it.number}: ${it.title}", body, WidgetTaps.action("proposal", it.repository, it.number)) } |
| 312 |
|
- |
i?.let { NeedLine(R.drawable.widget_issue, "${it.repository} #${it.number}: ${it.title}", body, WidgetTaps.action("issue", it.repository, it.number)) } |
|
312 |
+ |
Column(GlanceModifier.fillMaxWidth().padding(top = 8.dp)) { |
|
313 |
+ |
Text("Needs you", style = TextStyle(color = GlanceTheme.colors.onSurfaceVariant, fontSize = 11.sp, fontWeight = FontWeight.Bold)) |
|
314 |
+ |
r?.let { NeedLine(R.drawable.widget_proposal, "Review ${it.repository} #${it.number}: ${it.title}", body, WidgetTaps.action("proposal", it.repository, it.number)) } |
|
315 |
+ |
i?.let { NeedLine(R.drawable.widget_issue, "${it.repository} #${it.number}: ${it.title}", body, WidgetTaps.action("issue", it.repository, it.number)) } |
|
316 |
+ |
} |
| 313 |
317 |
|
} |
| 314 |
318 |
|
|
| 315 |
319 |
|
@Composable |
|
|
… |
52 unchanged lines |