mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
feat(native): a flight widget and a boarding-pass Live Activity
A new Flight widget on iOS (small to large and the lock screen) and Android shows the trip's next flight or the one in the air: both airports, the arc with the aircraft, a countdown the system keeps running, and the delay. It follows the feed's phase, so a late departure is not flown along the arc. Around a flight the travel day's Live Activity becomes a boarding pass with a running bar and countdown, in the Dynamic Island too.
This commit is contained in:
@@ -15,6 +15,7 @@ import androidx.glance.appwidget.GlanceRemoteViews
|
||||
import com.liketrek.trek.tripday.TripDayNotification
|
||||
import com.liketrek.trek.widget.AtlasWidget
|
||||
import com.liketrek.trek.widget.BookingsWidget
|
||||
import com.liketrek.trek.widget.FlightWidget
|
||||
import com.liketrek.trek.widget.CollabWidget
|
||||
import com.liketrek.trek.widget.PackingWidget
|
||||
import com.liketrek.trek.widget.TodayWidget
|
||||
@@ -74,6 +75,7 @@ class WidgetGalleryActivity : Activity() {
|
||||
"trip" to TripWidget(),
|
||||
"today" to TodayWidget(),
|
||||
"bookings" to BookingsWidget(),
|
||||
"flight" to FlightWidget(),
|
||||
"todos" to TodosWidget(),
|
||||
"packing" to PackingWidget(),
|
||||
"atlas" to AtlasWidget(),
|
||||
|
||||
@@ -142,6 +142,15 @@
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_bookings" />
|
||||
</receiver>
|
||||
<receiver
|
||||
android:name=".widget.FlightWidgetReceiver"
|
||||
android:label="@string/widget_flight_name"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_flight" />
|
||||
</receiver>
|
||||
<receiver
|
||||
android:name=".widget.TodosWidgetReceiver"
|
||||
android:label="@string/widget_todos_name"
|
||||
|
||||
@@ -32,6 +32,10 @@ class BookingsWidgetReceiver : TrekWidgetReceiver() {
|
||||
override val glanceAppWidget: GlanceAppWidget = BookingsWidget()
|
||||
}
|
||||
|
||||
class FlightWidgetReceiver : TrekWidgetReceiver() {
|
||||
override val glanceAppWidget: GlanceAppWidget = FlightWidget()
|
||||
}
|
||||
|
||||
class TodosWidgetReceiver : TrekWidgetReceiver() {
|
||||
override val glanceAppWidget: GlanceAppWidget = TodosWidget()
|
||||
}
|
||||
@@ -56,6 +60,7 @@ object TrekWidgetUpdater {
|
||||
TripWidgetReceiver::class,
|
||||
TodayWidgetReceiver::class,
|
||||
BookingsWidgetReceiver::class,
|
||||
FlightWidgetReceiver::class,
|
||||
TodosWidgetReceiver::class,
|
||||
PackingWidgetReceiver::class,
|
||||
AtlasWidgetReceiver::class,
|
||||
|
||||
@@ -448,6 +448,170 @@ private fun BookingRow(booking: WidgetSnapshot.Booking, labels: WidgetSnapshot.L
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Flight ----
|
||||
|
||||
/**
|
||||
* Where a flight stands now (as FlightMoment on iOS). What the feed saw wins: a
|
||||
* flight still at the gate past its planned departure is not flown along the
|
||||
* arc, and it is only landed once confirmed. Only a flight the feed never heard
|
||||
* of moves on by its schedule alone; a lost one stops two hours after arrival.
|
||||
*/
|
||||
private class FlightMoment(f: WidgetSnapshot.Flight, nowSeconds: Long) {
|
||||
val start: Long = f.depActual ?: f.depExpected ?: f.dep
|
||||
val end: Long = maxOf(f.arrExpected ?: f.arr, start + 60)
|
||||
private val heard = f.seen != null
|
||||
val landed = f.landed || (!heard && nowSeconds >= end) || nowSeconds >= end + 7200
|
||||
val airborne = !landed && (f.airborne || f.depActual != null || (!heard && nowSeconds >= start))
|
||||
val ready = !landed && !airborne && nowSeconds >= start
|
||||
val progress: Float = when {
|
||||
landed -> 1f
|
||||
airborne -> ((nowSeconds - start).toFloat() / (end - start)).coerceIn(0f, 0.98f)
|
||||
else -> 0f
|
||||
}
|
||||
}
|
||||
|
||||
/** A duration in the app's words: "2 d 4 h", "1 h 5 min", "12 min". */
|
||||
private fun durationText(seconds: Long, labels: WidgetSnapshot.Labels): String {
|
||||
val minutes = ((seconds + 59) / 60).coerceAtLeast(1)
|
||||
val days = minutes / 1440
|
||||
val hours = (minutes % 1440) / 60
|
||||
val rest = minutes % 60
|
||||
return when {
|
||||
days > 0 -> labels.durDaysHours.replace("{d}", "$days").replace("{h}", "$hours")
|
||||
hours > 0 -> labels.durHoursMinutes.replace("{h}", "$hours").replace("{m}", "$rest")
|
||||
else -> labels.durMinutes.replace("{m}", "$rest")
|
||||
}
|
||||
}
|
||||
|
||||
/** "Departs in 2 h 10 min", "Lands in 1 h 5 min", "Landed". */
|
||||
private fun momentText(m: FlightMoment, labels: WidgetSnapshot.Labels, nowSeconds: Long): String = when {
|
||||
m.landed -> labels.flightLanded
|
||||
m.ready -> labels.flightReady
|
||||
m.airborne -> labels.flightLands.replace("{time}", durationText(m.end - nowSeconds, labels))
|
||||
else -> labels.flightDeparts.replace("{time}", durationText(m.start - nowSeconds, labels))
|
||||
}
|
||||
|
||||
/** The delay as a chip's text and colour; nothing to say without data. */
|
||||
private fun delayChip(delay: Int?, labels: WidgetSnapshot.Labels): Pair<String, ColorProvider>? = when {
|
||||
delay == null -> null
|
||||
delay > 5 -> labels.flightLate.replace("{m}", "$delay") to (if (delay >= 30) TrekStatus.danger else TrekStatus.pending)
|
||||
delay < -5 -> labels.flightEarly.replace("{m}", "${-delay}") to TrekStatus.confirmed
|
||||
else -> labels.flightOnTime to TrekStatus.confirmed
|
||||
}
|
||||
|
||||
private const val FLIGHT_BLUE = 0xFF4A7DDB.toInt()
|
||||
|
||||
/**
|
||||
* The trip's next flight, or the one in the air: both airports large, the
|
||||
* route as an arc with the aircraft on it, the moment in words and the delay.
|
||||
* The arc and the words follow the clock each time the widget is drawn.
|
||||
*/
|
||||
class FlightWidget : TrekWidget() {
|
||||
@Composable
|
||||
override fun Content(snapshot: WidgetSnapshot?) {
|
||||
val context = LocalContext.current
|
||||
val size = LocalSize.current
|
||||
val labels = snapshot?.labels ?: return EmptyWidget(WidgetSamples.emptyText(context))
|
||||
val flight = snapshot.flight
|
||||
WidgetFrame(onClick = openPath(context, flight?.path ?: snapshot.trip?.path ?: "/")) {
|
||||
Column(modifier = GlanceModifier.fillMaxSize()) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = GlanceModifier.fillMaxWidth()) {
|
||||
Icon(Icons.Rounded.Flight, GlanceTheme.colors.primary, 14.dp)
|
||||
Spacer(GlanceModifier.width(5.dp))
|
||||
Eyebrow(flight?.number ?: labels.flight, GlanceTheme.colors.primary, GlanceModifier.defaultWeight())
|
||||
flight?.let { f ->
|
||||
delayChip(f.delay, labels)?.let { (text, color) ->
|
||||
if (size.isWide || (f.delay ?: 0) > 5) Chip(text, GlanceTheme.colors.surfaceVariant, color)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flight == null) {
|
||||
Spacer(GlanceModifier.defaultWeight())
|
||||
Line(labels.noFlight, 14.sp, GlanceTheme.colors.onSurfaceVariant, FontWeight.Medium, maxLines = 2)
|
||||
Spacer(GlanceModifier.defaultWeight())
|
||||
} else {
|
||||
FlightBody(flight, labels, size.isWide, size.isTall)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** The origin stands on the right in a right-to-left layout, so the drawn arc is mirrored with it. */
|
||||
@Composable
|
||||
private fun isRtl(): Boolean =
|
||||
LocalContext.current.resources.configuration.layoutDirection == android.view.View.LAYOUT_DIRECTION_RTL
|
||||
|
||||
@Composable
|
||||
private fun ColumnScope.FlightBody(f: WidgetSnapshot.Flight, labels: WidgetSnapshot.Labels, wide: Boolean, tall: Boolean) {
|
||||
val now = System.currentTimeMillis() / 1000
|
||||
val m = FlightMoment(f, now)
|
||||
val arrival = f.arrTimeExpected ?: f.arrTime
|
||||
val momentColor = if (m.airborne) GlanceTheme.colors.primary else GlanceTheme.colors.onSurface
|
||||
Spacer(GlanceModifier.defaultWeight())
|
||||
if (!wide) Line(momentText(m, labels, now), 13.sp, momentColor, FontWeight.Bold, maxLines = 2)
|
||||
Spacer(GlanceModifier.height(6.dp))
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = GlanceModifier.fillMaxWidth()) {
|
||||
Column(modifier = GlanceModifier.defaultWeight()) {
|
||||
Line(f.from, if (wide) 26.sp else 22.sp, weight = FontWeight.Bold)
|
||||
if (wide) f.fromCity?.let { Line(it, 11.sp, GlanceTheme.colors.onSurfaceVariant) }
|
||||
}
|
||||
if (wide) {
|
||||
Image(
|
||||
provider = ImageProvider(WidgetArt.flightArc(m.progress, FLIGHT_BLUE, android.graphics.Color.argb(90, 120, 120, 130), rtl = isRtl())),
|
||||
contentDescription = null,
|
||||
contentScale = ContentScale.Fit,
|
||||
modifier = GlanceModifier.width(120.dp).height(26.dp),
|
||||
)
|
||||
}
|
||||
Column(modifier = GlanceModifier.defaultWeight(), horizontalAlignment = Alignment.End) {
|
||||
Line(f.to, if (wide) 26.sp else 22.sp, weight = FontWeight.Bold)
|
||||
if (wide) f.toCity?.let { Line(it, 11.sp, GlanceTheme.colors.onSurfaceVariant) }
|
||||
}
|
||||
}
|
||||
if (!wide) {
|
||||
Image(
|
||||
provider = ImageProvider(WidgetArt.flightArc(m.progress, FLIGHT_BLUE, android.graphics.Color.argb(90, 120, 120, 130), rtl = isRtl())),
|
||||
contentDescription = null,
|
||||
contentScale = ContentScale.FillBounds,
|
||||
modifier = GlanceModifier.fillMaxWidth().height(22.dp),
|
||||
)
|
||||
}
|
||||
Spacer(GlanceModifier.height(4.dp))
|
||||
Row(modifier = GlanceModifier.fillMaxWidth()) {
|
||||
Line(f.depTime, 12.sp, GlanceTheme.colors.onSurfaceVariant, FontWeight.Bold, modifier = GlanceModifier.defaultWeight())
|
||||
Line(arrival, 12.sp, GlanceTheme.colors.onSurfaceVariant, FontWeight.Bold)
|
||||
}
|
||||
if (wide) {
|
||||
Spacer(GlanceModifier.height(8.dp))
|
||||
Line(momentText(m, labels, now), 13.sp, momentColor, FontWeight.Bold)
|
||||
if (m.airborne) {
|
||||
Spacer(GlanceModifier.height(5.dp))
|
||||
Bar(m.progress, GlanceTheme.colors.primary, GlanceTheme.colors.surfaceVariant, 5.dp)
|
||||
}
|
||||
}
|
||||
if (tall) {
|
||||
Spacer(GlanceModifier.height(10.dp))
|
||||
f.aircraft?.let { FlightFact(it) }
|
||||
f.fromCity?.let { from -> f.toCity?.let { to -> FlightFact("$from \u2192 $to") } }
|
||||
}
|
||||
Spacer(GlanceModifier.defaultWeight())
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun FlightFact(text: String) {
|
||||
Row(
|
||||
modifier = GlanceModifier.fillMaxWidth().background(GlanceTheme.colors.surfaceVariant).cornerRadius(12.dp)
|
||||
.padding(horizontal = 10.dp, vertical = 7.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Icon(Icons.Rounded.Flight, GlanceTheme.colors.primary, 13.dp)
|
||||
Spacer(GlanceModifier.width(7.dp))
|
||||
Line(text, 12.sp, GlanceTheme.colors.onSurfaceVariant, FontWeight.Medium)
|
||||
}
|
||||
Spacer(GlanceModifier.height(5.dp))
|
||||
}
|
||||
|
||||
// ---- To-dos ----
|
||||
|
||||
/** What is still open for the trip, and how far the packing has come. */
|
||||
|
||||
@@ -149,4 +149,100 @@ object WidgetArt {
|
||||
}
|
||||
return bitmap
|
||||
}
|
||||
|
||||
/**
|
||||
* A flight's route as an arc: dashed ahead, solid where it has flown, a dot
|
||||
* at either airport and an airliner riding the curve at its heading. White
|
||||
* on a translucent track, like the ring; the widget tints nothing, so the
|
||||
* caller passes the flight colour.
|
||||
*/
|
||||
fun flightArc(
|
||||
progress: Float,
|
||||
color: Int,
|
||||
track: Int,
|
||||
width: Int = 600,
|
||||
height: Int = 120,
|
||||
showPlane: Boolean = true,
|
||||
rtl: Boolean = false,
|
||||
): Bitmap {
|
||||
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
|
||||
val canvas = Canvas(bitmap)
|
||||
// Right to left the origin stands on the right: the whole drawing is mirrored.
|
||||
if (rtl) canvas.scale(-1f, 1f, width / 2f, height / 2f)
|
||||
val p = progress.coerceIn(0f, 1f)
|
||||
val inset = height * 0.14f
|
||||
val sx = inset
|
||||
val sy = height - inset
|
||||
val ex = width - inset
|
||||
val ey = height - inset
|
||||
val cx = width / 2f
|
||||
val cy = -height * 0.45f
|
||||
val path = android.graphics.Path().apply {
|
||||
moveTo(sx, sy)
|
||||
quadTo(cx, cy, ex, ey)
|
||||
}
|
||||
val line = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
style = Paint.Style.STROKE
|
||||
strokeCap = Paint.Cap.ROUND
|
||||
strokeWidth = height * 0.035f
|
||||
this.color = track
|
||||
pathEffect = android.graphics.DashPathEffect(floatArrayOf(height * 0.02f, height * 0.07f), 0f)
|
||||
}
|
||||
canvas.drawPath(path, line)
|
||||
val measure = android.graphics.PathMeasure(path, false)
|
||||
if (p > 0f) {
|
||||
val flown = android.graphics.Path()
|
||||
measure.getSegment(0f, measure.length * p, flown, true)
|
||||
line.pathEffect = null
|
||||
line.strokeWidth = height * 0.045f
|
||||
line.color = color
|
||||
canvas.drawPath(flown, line)
|
||||
}
|
||||
val dot = Paint(Paint.ANTI_ALIAS_FLAG).apply { this.color = color }
|
||||
canvas.drawCircle(sx, sy, height * 0.05f, dot)
|
||||
val ring = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
style = if (p >= 1f) Paint.Style.FILL else Paint.Style.STROKE
|
||||
strokeWidth = height * 0.03f
|
||||
this.color = color
|
||||
}
|
||||
canvas.drawCircle(ex, ey, height * 0.06f, ring)
|
||||
if (showPlane) {
|
||||
val pos = FloatArray(2)
|
||||
val tan = FloatArray(2)
|
||||
measure.getPosTan(measure.length * p, pos, tan)
|
||||
canvas.save()
|
||||
canvas.translate(pos[0], pos[1])
|
||||
canvas.rotate(Math.toDegrees(kotlin.math.atan2(tan[1].toDouble(), tan[0].toDouble())).toFloat())
|
||||
val scale = height * 0.012f
|
||||
canvas.scale(scale, scale)
|
||||
canvas.drawCircle(0f, 0f, 13f, Paint(Paint.ANTI_ALIAS_FLAG).apply { this.color = Color.WHITE })
|
||||
canvas.drawPath(airliner(), Paint(Paint.ANTI_ALIAS_FLAG).apply { this.color = color })
|
||||
canvas.restore()
|
||||
}
|
||||
return bitmap
|
||||
}
|
||||
|
||||
/** An airliner seen from above, nose along +x, about 18 units long, centred. */
|
||||
private fun airliner(): android.graphics.Path = android.graphics.Path().apply {
|
||||
moveTo(9f, 0f)
|
||||
cubicTo(9f, -0.9f, 8.3f, -1.3f, 7.4f, -1.3f)
|
||||
lineTo(3.2f, -1.3f)
|
||||
lineTo(-1.6f, -7.6f)
|
||||
lineTo(-3.7f, -7.6f)
|
||||
lineTo(-1.4f, -1.3f)
|
||||
lineTo(-5.5f, -1.3f)
|
||||
lineTo(-7.2f, -3.7f)
|
||||
lineTo(-8.8f, -3.7f)
|
||||
lineTo(-7.8f, 0f)
|
||||
lineTo(-8.8f, 3.7f)
|
||||
lineTo(-7.2f, 3.7f)
|
||||
lineTo(-5.5f, 1.3f)
|
||||
lineTo(-1.4f, 1.3f)
|
||||
lineTo(-3.7f, 7.6f)
|
||||
lineTo(-1.6f, 7.6f)
|
||||
lineTo(3.2f, 1.3f)
|
||||
lineTo(7.4f, 1.3f)
|
||||
cubicTo(8.3f, 1.3f, 9f, 0.9f, 9f, 0f)
|
||||
close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,19 @@ import org.json.JSONObject
|
||||
* (WidgetSnapshot.sample in TrekFamily.swift).
|
||||
*/
|
||||
object WidgetSamples {
|
||||
/** In the air on a running trip, two days ahead before one: the same LH 716 as the iOS sample. */
|
||||
private fun flightJson(running: Boolean): String {
|
||||
val now = System.currentTimeMillis() / 1000
|
||||
val dep = if (running) now - 4 * 3600 else now + 2 * 86_400 + 5 * 3600
|
||||
val live = if (running) {
|
||||
""""depActual": ${dep + 18 * 60}, "arrExpected": ${dep + 12 * 3600 + 41 * 60}, "arrTimeExpected": "08:46", "delay": 16, "aircraft": "A359 D-AIXA","""
|
||||
} else {
|
||||
""
|
||||
}
|
||||
return """{"number": "LH 716", "from": "FRA", "to": "HND", "fromCity": "Frankfurt", "toCity": "Tokyo Haneda",
|
||||
"dep": $dep, "arr": ${dep + 12 * 3600 + 25 * 60}, $live "depTime": "13:05", "arrTime": "08:30", "path": "/trips/1?booking=1"}"""
|
||||
}
|
||||
|
||||
fun emptyText(context: Context): String = context.getString(R.string.widget_empty)
|
||||
|
||||
fun snapshot(running: Boolean, now: LocalDate = LocalDate.now()): WidgetSnapshot = WidgetSnapshot.fromJson(JSONObject(json(running, now)))
|
||||
@@ -37,6 +50,7 @@ object WidgetSamples {
|
||||
"place": "Kyoto, Japan", "dayCount": 9, "placeCount": 34, "memberCount": 3},
|
||||
$today
|
||||
"weather": {"temp": 18, "high": 21, "low": 11, "main": "${if (running) "Clear" else "Clouds"}", "label": "Mostly sunny", "place": "Kyoto", "rain": 10},
|
||||
"flight": ${flightJson(running)},
|
||||
"bookings": [
|
||||
{"title": "LH 716", "kind": "flight", "date": "${iso(if (running) 6 else 12)}", "time": "13:05", "detail": "FRA → HND", "confirmed": true, "path": "/trips/1"},
|
||||
{"title": "Shinkansen Nozomi 21", "kind": "train", "date": "${iso(if (running) 0 else 13)}", "time": "09:12", "detail": "Tokyo → Kyoto", "confirmed": true, "path": "/trips/1"},
|
||||
|
||||
@@ -25,6 +25,8 @@ data class WidgetSnapshot(
|
||||
val atlas: Atlas?,
|
||||
val collab: Collab?,
|
||||
val labels: Labels,
|
||||
/** The trip's next flight or the one in the air; last and defaulted, so older callers keep compiling. */
|
||||
val flight: Flight? = null,
|
||||
) {
|
||||
data class Trip(
|
||||
val title: String,
|
||||
@@ -105,6 +107,39 @@ data class WidgetSnapshot(
|
||||
|
||||
data class Collab(val members: List<Member>, val messages: List<Message>, val poll: Poll?, val path: String)
|
||||
|
||||
/**
|
||||
* The flight widget's flight. Times are epoch seconds, so the widget moves on
|
||||
* with the clock between two snapshots; the clock times at either airport
|
||||
* come formatted, since the widget has no zone data.
|
||||
*/
|
||||
data class Flight(
|
||||
val number: String,
|
||||
val from: String,
|
||||
val to: String,
|
||||
val fromCity: String?,
|
||||
val toCity: String?,
|
||||
val dep: Long,
|
||||
val arr: Long,
|
||||
/** Observed take-off. */
|
||||
val depActual: Long?,
|
||||
/** Before take-off: the planned departure plus the delay seen so far. */
|
||||
val depExpected: Long?,
|
||||
/** The feed saw the aircraft in the air when the app last looked. */
|
||||
val airborne: Boolean,
|
||||
/** Touchdown once landed, else the estimate while in the air. */
|
||||
val arrExpected: Long?,
|
||||
val landed: Boolean,
|
||||
val depTime: String,
|
||||
val arrTime: String,
|
||||
val arrTimeExpected: String?,
|
||||
/** Minutes late against the schedule, negative when early. */
|
||||
val delay: Int?,
|
||||
val aircraft: String?,
|
||||
/** When the feed last heard the aircraft; null for a flight it never heard of. */
|
||||
val seen: Long?,
|
||||
val path: String,
|
||||
)
|
||||
|
||||
/** The labels, translated by the app. The optional ones fall back to English. */
|
||||
data class Labels(private val raw: JSONObject) {
|
||||
val nextTrip get() = text("nextTrip", "Next trip")
|
||||
@@ -137,6 +172,23 @@ data class WidgetSnapshot(
|
||||
val votes get() = text("votes", "votes")
|
||||
val noMessages get() = text("noMessages", "No messages yet")
|
||||
val departure get() = text("departure", "Departure")
|
||||
val flight get() = text("flight", "Flight")
|
||||
/** Contains "{time}". */
|
||||
val flightDeparts get() = text("flightDeparts", "Departs in {time}")
|
||||
/** Contains "{time}". */
|
||||
val flightLands get() = text("flightLands", "Lands in {time}")
|
||||
val flightLanded get() = text("flightLanded", "Landed")
|
||||
val flightReady get() = text("flightReady", "Ready for departure")
|
||||
val noFlight get() = text("noFlight", "No flight ahead")
|
||||
val flightOnTime get() = text("flightOnTime", "On time")
|
||||
/** Contains "{m}". */
|
||||
val flightLate get() = text("flightLate", "+{m} min")
|
||||
/** Contains "{m}". */
|
||||
val flightEarly get() = text("flightEarly", "{m} min early")
|
||||
/** Contain "{d}" and "{h}", "{h}" and "{m}", and "{m}". */
|
||||
val durDaysHours get() = text("durDaysHours", "{d} d {h} h")
|
||||
val durHoursMinutes get() = text("durHoursMinutes", "{h} h {m} min")
|
||||
val durMinutes get() = text("durMinutes", "{m} min")
|
||||
|
||||
private fun text(key: String, fallback: String): String = raw.optString(key).ifBlank { fallback }
|
||||
}
|
||||
@@ -240,6 +292,29 @@ data class WidgetSnapshot(
|
||||
)
|
||||
},
|
||||
labels = Labels(o.optJSONObject("labels") ?: JSONObject()),
|
||||
flight = o.optJSONObject("flight")?.let { f ->
|
||||
Flight(
|
||||
number = f.optString("number"),
|
||||
from = f.optString("from"),
|
||||
to = f.optString("to"),
|
||||
fromCity = f.str("fromCity"),
|
||||
toCity = f.str("toCity"),
|
||||
dep = f.optLong("dep"),
|
||||
arr = f.optLong("arr"),
|
||||
depActual = f.long("depActual"),
|
||||
depExpected = f.long("depExpected"),
|
||||
airborne = f.optBoolean("airborne"),
|
||||
arrExpected = f.long("arrExpected"),
|
||||
landed = f.optBoolean("landed"),
|
||||
depTime = f.optString("depTime"),
|
||||
arrTime = f.optString("arrTime"),
|
||||
arrTimeExpected = f.str("arrTimeExpected"),
|
||||
delay = f.int("delay"),
|
||||
aircraft = f.str("aircraft"),
|
||||
seen = f.long("seen"),
|
||||
path = f.optString("path", "/"),
|
||||
)
|
||||
}?.takeIf { it.dep > 0 && it.arr > 0 },
|
||||
)
|
||||
|
||||
fun day(iso: String?): LocalDate? {
|
||||
@@ -258,6 +333,8 @@ data class WidgetSnapshot(
|
||||
|
||||
private fun JSONObject.int(key: String): Int? = if (has(key) && !isNull(key)) optInt(key) else null
|
||||
|
||||
private fun JSONObject.long(key: String): Long? = if (has(key) && !isNull(key)) optLong(key) else null
|
||||
|
||||
private fun JSONArray?.objects(): List<JSONObject> =
|
||||
if (this == null) emptyList() else (0 until length()).mapNotNull { optJSONObject(it) }
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">خطة اليوم كخط زمني، مع الطقس والمحطة التالية.</string>
|
||||
<string name="widget_bookings_name">الحجوزات</string>
|
||||
<string name="widget_bookings_description">رحلاتك وقطاراتك وفنادقك وحجوزات المطاعم القادمة ومواعيدها.</string>
|
||||
<string name="widget_flight_name">الرحلة</string>
|
||||
<string name="widget_flight_description">رحلتك القادمة مباشرة: عد تنازلي للإقلاع، والطائرة في طريقها، والتأخير والوصول.</string>
|
||||
<string name="widget_todos_name">المهام</string>
|
||||
<string name="widget_todos_description">ما تبقى للرحلة، ومدى تقدم تجهيز الأمتعة.</string>
|
||||
<string name="widget_packing_name">قائمة الأمتعة</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Günün planı zaman xətti kimi, hava və növbəti dayanacaqla.</string>
|
||||
<string name="widget_bookings_name">Bronlar</string>
|
||||
<string name="widget_bookings_description">Növbəti uçuşlar, qatarlar, otellər və restoranlar, nə vaxt olduqları ilə.</string>
|
||||
<string name="widget_flight_name">Uçuş</string>
|
||||
<string name="widget_flight_description">Növbəti uçuşun canlı: uçuşa qədər geri sayım, yolda olan təyyarə, gecikmə və gəliş.</string>
|
||||
<string name="widget_todos_name">Tapşırıqlar</string>
|
||||
<string name="widget_todos_description">Səyahət üçün hələ nəyin qaldığı və yığışmağın nə yerdə olduğu.</string>
|
||||
<string name="widget_packing_name">Yük siyahısı</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">以时间线显示今天的计划,附带天气和下一站。</string>
|
||||
<string name="widget_bookings_name">预订</string>
|
||||
<string name="widget_bookings_description">你接下来的航班、火车、酒店和餐厅,以及时间。</string>
|
||||
<string name="widget_flight_name">航班</string>
|
||||
<string name="widget_flight_description">实时查看下一班航班:起飞倒计时、飞行中的飞机、延误和到达。</string>
|
||||
<string name="widget_todos_name">待办</string>
|
||||
<string name="widget_todos_description">旅行还剩哪些事没做,以及行李收拾到哪一步。</string>
|
||||
<string name="widget_packing_name">行李</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">以時間軸顯示今天的計畫,附上天氣與下一站。</string>
|
||||
<string name="widget_bookings_name">預訂</string>
|
||||
<string name="widget_bookings_description">你接下來的航班、火車、飯店與餐廳,以及時間。</string>
|
||||
<string name="widget_flight_name">航班</string>
|
||||
<string name="widget_flight_description">即時查看下一班航班:起飛倒數、飛行中的飛機、延誤和抵達。</string>
|
||||
<string name="widget_todos_name">待辦</string>
|
||||
<string name="widget_todos_description">旅行還剩哪些事沒做,以及行李整理到哪一步。</string>
|
||||
<string name="widget_packing_name">行李</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">El pla del dia com a línia de temps, amb el temps i la propera parada.</string>
|
||||
<string name="widget_bookings_name">Reserves</string>
|
||||
<string name="widget_bookings_description">Els teus propers vols, trens, hotels i taules, i quan toquen.</string>
|
||||
<string name="widget_flight_name">Vol</string>
|
||||
<string name="widget_flight_description">El teu proper vol en directe: compte enrere de la sortida, l’avió en camí, retard i arribada.</string>
|
||||
<string name="widget_todos_name">Tasques</string>
|
||||
<string name="widget_todos_description">El que encara queda per al viatge i com va l\'equipatge.</string>
|
||||
<string name="widget_packing_name">Equipatge</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Plán dne jako časová osa, s počasím a další zastávkou.</string>
|
||||
<string name="widget_bookings_name">Rezervace</string>
|
||||
<string name="widget_bookings_description">Tvoje další lety, vlaky, hotely a stoly, a kdy tě čekají.</string>
|
||||
<string name="widget_flight_name">Let</string>
|
||||
<string name="widget_flight_description">Tvůj další let živě: odpočet do odletu, letadlo na cestě, zpoždění a přílet.</string>
|
||||
<string name="widget_todos_name">Úkoly</string>
|
||||
<string name="widget_todos_description">Co ještě zbývá k cestě a jak daleko je balení.</string>
|
||||
<string name="widget_packing_name">Balení</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Der Tagesplan als Zeitleiste, mit dem Wetter und dem nächsten Stopp.</string>
|
||||
<string name="widget_bookings_name">Buchungen</string>
|
||||
<string name="widget_bookings_description">Deine nächsten Flüge, Züge, Hotels und Tische, und wann sie anstehen.</string>
|
||||
<string name="widget_flight_name">Flug</string>
|
||||
<string name="widget_flight_description">Dein nächster Flug live: Countdown bis zum Abflug, die Maschine unterwegs, Verspätung und Ankunft.</string>
|
||||
<string name="widget_todos_name">To-dos</string>
|
||||
<string name="widget_todos_description">Was für die Reise noch offen ist und wie weit das Packen ist.</string>
|
||||
<string name="widget_packing_name">Packliste</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Το πρόγραμμα της ημέρας ως χρονολόγιο, με τον καιρό και την επόμενη στάση.</string>
|
||||
<string name="widget_bookings_name">Κρατήσεις</string>
|
||||
<string name="widget_bookings_description">Οι επόμενες πτήσεις, τα τρένα, τα ξενοδοχεία και τα τραπέζια σου, και πότε είναι.</string>
|
||||
<string name="widget_flight_name">Πτήση</string>
|
||||
<string name="widget_flight_description">Η επόμενη πτήση σου ζωντανά: αντίστροφη μέτρηση για την αναχώρηση, το αεροσκάφος καθ’ οδόν, καθυστέρηση και άφιξη.</string>
|
||||
<string name="widget_todos_name">Εκκρεμότητες</string>
|
||||
<string name="widget_todos_description">Τι μένει ακόμα για το ταξίδι και πόσο έχει προχωρήσει το πακετάρισμα.</string>
|
||||
<string name="widget_packing_name">Αποσκευές</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">El plan del día como línea de tiempo, con el tiempo y la próxima parada.</string>
|
||||
<string name="widget_bookings_name">Reservas</string>
|
||||
<string name="widget_bookings_description">Tus próximos vuelos, trenes, hoteles y mesas, y cuándo tocan.</string>
|
||||
<string name="widget_flight_name">Vuelo</string>
|
||||
<string name="widget_flight_description">Tu próximo vuelo en directo: cuenta atrás de la salida, el avión en camino, retraso y llegada.</string>
|
||||
<string name="widget_todos_name">Tareas</string>
|
||||
<string name="widget_todos_description">Lo que aún queda para el viaje y cómo va la maleta.</string>
|
||||
<string name="widget_packing_name">Equipaje</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Päeva plaan ajajoonena, koos ilma ja järgmise peatusega.</string>
|
||||
<string name="widget_bookings_name">Broneeringud</string>
|
||||
<string name="widget_bookings_description">Sinu järgmised lennud, rongid, hotellid ja lauad ning millal need on.</string>
|
||||
<string name="widget_flight_name">Lend</string>
|
||||
<string name="widget_flight_description">Sinu järgmine lend otse: loendus väljumiseni, lennuk teel, hilinemine ja saabumine.</string>
|
||||
<string name="widget_todos_name">Ülesanded</string>
|
||||
<string name="widget_todos_description">Mis reisi jaoks veel tegemata on ja kui kaugel pakkimine on.</string>
|
||||
<string name="widget_packing_name">Pakkimine</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Le programme du jour en frise, avec la météo et la prochaine étape.</string>
|
||||
<string name="widget_bookings_name">Réservations</string>
|
||||
<string name="widget_bookings_description">Vos prochains vols, trains, hôtels et tables, et quand ils arrivent.</string>
|
||||
<string name="widget_flight_name">Vol</string>
|
||||
<string name="widget_flight_description">Votre prochain vol en direct : compte à rebours du départ, l’avion en route, retard et arrivée.</string>
|
||||
<string name="widget_todos_name">À faire</string>
|
||||
<string name="widget_todos_description">Ce qui reste à faire pour le voyage et où en sont les bagages.</string>
|
||||
<string name="widget_packing_name">Bagages</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">A nap terve idővonalon, az időjárással és a következő megállóval.</string>
|
||||
<string name="widget_bookings_name">Foglalások</string>
|
||||
<string name="widget_bookings_description">A következő járataid, vonataid, szállásaid és asztalfoglalásaid, és hogy mikor esedékesek.</string>
|
||||
<string name="widget_flight_name">Járat</string>
|
||||
<string name="widget_flight_description">A következő járatod élőben: visszaszámlálás az indulásig, a gép útközben, késés és érkezés.</string>
|
||||
<string name="widget_todos_name">Teendők</string>
|
||||
<string name="widget_todos_description">Ami még hátravan az utazáshoz, és hol tart a csomagolás.</string>
|
||||
<string name="widget_packing_name">Csomagolás</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Rencana hari ini sebagai linimasa, dengan cuaca dan perhentian berikutnya.</string>
|
||||
<string name="widget_bookings_name">Pemesanan</string>
|
||||
<string name="widget_bookings_description">Penerbangan, kereta, hotel, dan meja berikutnya, beserta waktunya.</string>
|
||||
<string name="widget_flight_name">Penerbangan</string>
|
||||
<string name="widget_flight_description">Penerbangan berikutnya secara langsung: hitung mundur keberangkatan, pesawat dalam perjalanan, keterlambatan, dan kedatangan.</string>
|
||||
<string name="widget_todos_name">Tugas</string>
|
||||
<string name="widget_todos_description">Yang masih tersisa untuk perjalanan dan sejauh mana persiapan barang.</string>
|
||||
<string name="widget_packing_name">Barang bawaan</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Il programma del giorno come linea del tempo, con il meteo e la prossima tappa.</string>
|
||||
<string name="widget_bookings_name">Prenotazioni</string>
|
||||
<string name="widget_bookings_description">I tuoi prossimi voli, treni, hotel e tavoli, e quando sono.</string>
|
||||
<string name="widget_flight_name">Volo</string>
|
||||
<string name="widget_flight_description">Il tuo prossimo volo in tempo reale: conto alla rovescia per la partenza, l’aereo in viaggio, ritardo e arrivo.</string>
|
||||
<string name="widget_todos_name">Da fare</string>
|
||||
<string name="widget_todos_description">Cosa manca ancora per il viaggio e a che punto è la valigia.</string>
|
||||
<string name="widget_packing_name">Bagagli</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">תוכנית היום כציר זמן, עם מזג האוויר והעצירה הבאה.</string>
|
||||
<string name="widget_bookings_name">הזמנות</string>
|
||||
<string name="widget_bookings_description">הטיסות, הרכבות, המלונות והשולחנות הבאים שלך, ומתי הם.</string>
|
||||
<string name="widget_flight_name">טיסה</string>
|
||||
<string name="widget_flight_description">הטיסה הבאה שלך בזמן אמת: ספירה לאחור עד ההמראה, המטוס בדרך, עיכוב והגעה.</string>
|
||||
<string name="widget_todos_name">משימות</string>
|
||||
<string name="widget_todos_description">מה עוד פתוח לטיול וכמה התקדמה האריזה.</string>
|
||||
<string name="widget_packing_name">אריזה</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">今日の予定をタイムラインで、天気と次の予定とともに表示します。</string>
|
||||
<string name="widget_bookings_name">予約</string>
|
||||
<string name="widget_bookings_description">次のフライト、列車、ホテル、レストランとその日時。</string>
|
||||
<string name="widget_flight_name">フライト</string>
|
||||
<string name="widget_flight_description">次のフライトをライブで:出発までのカウントダウン、飛行中の機体、遅延と到着。</string>
|
||||
<string name="widget_todos_name">やること</string>
|
||||
<string name="widget_todos_description">旅行のために残っていることと、荷造りの進み具合。</string>
|
||||
<string name="widget_packing_name">持ち物</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">오늘 일정을 타임라인으로, 날씨와 다음 장소와 함께 보여 줍니다.</string>
|
||||
<string name="widget_bookings_name">예약</string>
|
||||
<string name="widget_bookings_description">다가오는 항공편, 기차, 호텔, 식당과 그 시간.</string>
|
||||
<string name="widget_flight_name">항공편</string>
|
||||
<string name="widget_flight_description">다음 항공편을 실시간으로: 출발 카운트다운, 비행 중인 항공기, 지연과 도착.</string>
|
||||
<string name="widget_todos_name">할 일</string>
|
||||
<string name="widget_todos_description">여행을 위해 남은 일과 짐 싸기 진행 상황.</string>
|
||||
<string name="widget_packing_name">짐 싸기</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Het dagplan als tijdlijn, met het weer en de volgende stop.</string>
|
||||
<string name="widget_bookings_name">Boekingen</string>
|
||||
<string name="widget_bookings_description">Je volgende vluchten, treinen, hotels en tafels, en wanneer ze zijn.</string>
|
||||
<string name="widget_flight_name">Vlucht</string>
|
||||
<string name="widget_flight_description">Je volgende vlucht live: aftellen tot vertrek, het toestel onderweg, vertraging en aankomst.</string>
|
||||
<string name="widget_todos_name">Taken</string>
|
||||
<string name="widget_todos_description">Wat er nog openstaat voor de reis en hoe ver het inpakken is.</string>
|
||||
<string name="widget_packing_name">Bagage</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Plan dnia jako oś czasu, z pogodą i kolejnym przystankiem.</string>
|
||||
<string name="widget_bookings_name">Rezerwacje</string>
|
||||
<string name="widget_bookings_description">Twoje najbliższe loty, pociągi, hotele i stoliki oraz ich terminy.</string>
|
||||
<string name="widget_flight_name">Lot</string>
|
||||
<string name="widget_flight_description">Twój następny lot na żywo: odliczanie do odlotu, samolot w drodze, opóźnienie i przylot.</string>
|
||||
<string name="widget_todos_name">Zadania</string>
|
||||
<string name="widget_todos_description">Co jeszcze zostało do zrobienia przed podróżą i jak idzie pakowanie.</string>
|
||||
<string name="widget_packing_name">Pakowanie</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">O plano do dia como linha do tempo, com o clima e a próxima parada.</string>
|
||||
<string name="widget_bookings_name">Reservas</string>
|
||||
<string name="widget_bookings_description">Seus próximos voos, trens, hotéis e mesas, e quando acontecem.</string>
|
||||
<string name="widget_flight_name">Voo</string>
|
||||
<string name="widget_flight_description">Seu próximo voo ao vivo: contagem regressiva para a partida, o avião a caminho, atraso e chegada.</string>
|
||||
<string name="widget_todos_name">Tarefas</string>
|
||||
<string name="widget_todos_description">O que ainda falta para a viagem e quanto da mala já está pronto.</string>
|
||||
<string name="widget_packing_name">Bagagem</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">План дня в виде ленты времени, с погодой и следующей остановкой.</string>
|
||||
<string name="widget_bookings_name">Бронирования</string>
|
||||
<string name="widget_bookings_description">Ближайшие рейсы, поезда, отели и столики и когда они.</string>
|
||||
<string name="widget_flight_name">Рейс</string>
|
||||
<string name="widget_flight_description">Ваш следующий рейс в реальном времени: отсчёт до вылета, самолёт в пути, задержка и прибытие.</string>
|
||||
<string name="widget_todos_name">Задачи</string>
|
||||
<string name="widget_todos_description">Что ещё осталось сделать к поездке и как идут сборы.</string>
|
||||
<string name="widget_packing_name">Сборы</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Plán dňa ako časová os, s počasím a ďalšou zastávkou.</string>
|
||||
<string name="widget_bookings_name">Rezervácie</string>
|
||||
<string name="widget_bookings_description">Tvoje ďalšie lety, vlaky, hotely a stoly a kedy ťa čakajú.</string>
|
||||
<string name="widget_flight_name">Let</string>
|
||||
<string name="widget_flight_description">Tvoj ďalší let naživo: odpočet do odletu, lietadlo na ceste, meškanie a prílet.</string>
|
||||
<string name="widget_todos_name">Úlohy</string>
|
||||
<string name="widget_todos_description">Čo ešte zostáva na cestu a ako ďaleko je balenie.</string>
|
||||
<string name="widget_packing_name">Balenie</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Dagens plan som tidslinje, med vädret och nästa stopp.</string>
|
||||
<string name="widget_bookings_name">Bokningar</string>
|
||||
<string name="widget_bookings_description">Dina nästa flyg, tåg, hotell och bord, och när de är.</string>
|
||||
<string name="widget_flight_name">Flyg</string>
|
||||
<string name="widget_flight_description">Ditt nästa flyg live: nedräkning till avgång, planet på väg, försening och ankomst.</string>
|
||||
<string name="widget_todos_name">Att göra</string>
|
||||
<string name="widget_todos_description">Vad som återstår inför resan och hur långt packningen har kommit.</string>
|
||||
<string name="widget_packing_name">Packning</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">แผนของวันนี้เป็นไทม์ไลน์ พร้อมสภาพอากาศและจุดหมายถัดไป</string>
|
||||
<string name="widget_bookings_name">การจอง</string>
|
||||
<string name="widget_bookings_description">เที่ยวบิน รถไฟ โรงแรม และร้านอาหารถัดไปของคุณ และเวลาของแต่ละรายการ</string>
|
||||
<string name="widget_flight_name">เที่ยวบิน</string>
|
||||
<string name="widget_flight_description">เที่ยวบินถัดไปแบบสด: นับถอยหลังถึงเวลาออกเดินทาง เครื่องบินระหว่างทาง ความล่าช้า และเวลาถึง</string>
|
||||
<string name="widget_todos_name">สิ่งที่ต้องทำ</string>
|
||||
<string name="widget_todos_description">สิ่งที่ยังค้างอยู่สำหรับทริป และความคืบหน้าการจัดกระเป๋า</string>
|
||||
<string name="widget_packing_name">จัดกระเป๋า</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Günün planı zaman çizelgesi olarak, hava durumu ve sonraki durakla.</string>
|
||||
<string name="widget_bookings_name">Rezervasyonlar</string>
|
||||
<string name="widget_bookings_description">Sıradaki uçuşların, trenlerin, otellerin ve masaların, ne zaman oldukları ile.</string>
|
||||
<string name="widget_flight_name">Uçuş</string>
|
||||
<string name="widget_flight_description">Bir sonraki uçuşun canlı: kalkışa geri sayım, yoldaki uçak, gecikme ve varış.</string>
|
||||
<string name="widget_todos_name">Yapılacaklar</string>
|
||||
<string name="widget_todos_description">Seyahat için hâlâ açık olanlar ve bavulun ne durumda olduğu.</string>
|
||||
<string name="widget_packing_name">Bavul</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">План дня у вигляді стрічки часу, з погодою і наступною зупинкою.</string>
|
||||
<string name="widget_bookings_name">Бронювання</string>
|
||||
<string name="widget_bookings_description">Найближчі рейси, поїзди, готелі й столики та коли вони.</string>
|
||||
<string name="widget_flight_name">Рейс</string>
|
||||
<string name="widget_flight_description">Ваш наступний рейс наживо: відлік до вильоту, літак у дорозі, затримка й прибуття.</string>
|
||||
<string name="widget_todos_name">Завдання</string>
|
||||
<string name="widget_todos_description">Що ще лишилося зробити до подорожі і як просувається пакування.</string>
|
||||
<string name="widget_packing_name">Пакування</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Kế hoạch hôm nay dạng dòng thời gian, kèm thời tiết và điểm dừng tiếp theo.</string>
|
||||
<string name="widget_bookings_name">Đặt chỗ</string>
|
||||
<string name="widget_bookings_description">Các chuyến bay, tàu, khách sạn và bàn sắp tới của bạn, cùng thời gian.</string>
|
||||
<string name="widget_flight_name">Chuyến bay</string>
|
||||
<string name="widget_flight_description">Chuyến bay tiếp theo trực tiếp: đếm ngược giờ khởi hành, máy bay đang bay, độ trễ và giờ đến.</string>
|
||||
<string name="widget_todos_name">Việc cần làm</string>
|
||||
<string name="widget_todos_description">Những gì còn lại cho chuyến đi và việc soạn hành lý đã tới đâu.</string>
|
||||
<string name="widget_packing_name">Hành lý</string>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<string name="widget_today_description">Today\'s plan as a timeline, with the weather and what is next.</string>
|
||||
<string name="widget_bookings_name">Bookings</string>
|
||||
<string name="widget_bookings_description">Your next flights, trains, hotels and tables, and when they are due.</string>
|
||||
<string name="widget_flight_name">Flight</string>
|
||||
<string name="widget_flight_description">Your next flight live: departure countdown, the aircraft on its way, delay and arrival.</string>
|
||||
<string name="widget_todos_name">To-dos</string>
|
||||
<string name="widget_todos_description">What is still open for the trip, and how far the packing has come.</string>
|
||||
<string name="widget_packing_name">Packing</string>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- The flight widget (widget/TrekWidgets.kt). Sizes in cells for Android 12+, dp before.
|
||||
No previewImage: Glance draws the picker preview from the sample trip (providePreview). -->
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:description="@string/widget_flight_description"
|
||||
android:initialLayout="@layout/glance_default_loading_layout"
|
||||
android:minWidth="110dp"
|
||||
android:minHeight="110dp"
|
||||
android:minResizeWidth="110dp"
|
||||
android:minResizeHeight="110dp"
|
||||
android:maxResizeWidth="530dp"
|
||||
android:maxResizeHeight="450dp"
|
||||
android:targetCellWidth="4"
|
||||
android:targetCellHeight="2"
|
||||
android:resizeMode="horizontal|vertical"
|
||||
android:updatePeriodMillis="1800000"
|
||||
android:widgetCategory="home_screen"
|
||||
android:configure="com.liketrek.trek.widget.WidgetConfigActivity"
|
||||
android:widgetFeatures="reconfigurable|configuration_optional" />
|
||||
Reference in New Issue
Block a user