mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-12-01 07:40:31 +01:00
Gearslip apps: apps written for Gearslip's own protocol show in the launcher, and Gearslip draws their lists, grids, panes and messages with its own car keyboard, car info and music controls
This commit is contained in:
1 parent
8c73aa83bd
commit
fb865d98e4
16 files changed
+900
-7
No files matched your search
+20
-5
@@ -254,7 +254,7 @@ Gearslip drops these altogether:
|
||||
|
||||
## Gearslip apps
|
||||
|
||||
This section specifies protocol version 1. Gearslip does not yet implement it.
|
||||
This section specifies protocol version 1.
|
||||
|
||||
A Gearslip app describes a screen and lets Gearslip render it in Compose, using the car's theme,
|
||||
the driver's chosen scale and the current day or night state. Your app draws nothing and receives
|
||||
@@ -293,8 +293,20 @@ no state that a rebind cannot rebuild.
|
||||
|
||||
### The interface
|
||||
|
||||
Copy these three files into `src/main/aidl/app/seb3thehacker/gearslip/api/`. A published artifact
|
||||
will replace them.
|
||||
The [Gearslip SDK](https://github.com/twinksoftware/gearslip-sdk) holds these three files, a base
|
||||
service that answers the handshake, and builders for the screen model. It is licensed under
|
||||
Apache-2.0, so a closed-source app can use it too. Add it from JitPack:
|
||||
|
||||
```kotlin
|
||||
// settings.gradle.kts: repositories { maven("https://jitpack.io") }
|
||||
implementation("com.github.twinksoftware:gearslip-sdk:1.0.0")
|
||||
```
|
||||
|
||||
Then extend `GearslipAppService` and return a screen from `onGetScreen`. The SDK's sample app
|
||||
uses every part of version 1.
|
||||
|
||||
To write the binder side yourself, copy these files into
|
||||
`src/main/aidl/app/seb3thehacker/gearslip/api/`.
|
||||
|
||||
```aidl
|
||||
// IGearslipApp.aidl
|
||||
@@ -414,8 +426,9 @@ actions and emphasises the primary one.
|
||||
`check`, `error`. Version 1 carries no images. Gearslip drops an unknown name and renders the
|
||||
row without a glyph.
|
||||
|
||||
Gearslip truncates any list past the limits in [Content limits](#content-limits) and shortens
|
||||
long strings. Send a screen that fits, rather than one Gearslip has to cut.
|
||||
Gearslip shows at most 12 items, or 4 in a pane, and cuts the rest. It shortens a title past 80
|
||||
characters, a subtitle past 120, and a message past 500, and it ignores an answer larger than
|
||||
64 KB. Send a screen that fits, rather than one Gearslip has to cut.
|
||||
|
||||
### Reading the car
|
||||
|
||||
@@ -450,6 +463,8 @@ stale or missing, which includes tunnels and car parks.
|
||||
{ "title": "Sleepwalk", "artist": "Santo & Johnny", "playing": true, "durationMs": 142000 }
|
||||
```
|
||||
|
||||
It returns `{}` when nothing is playing.
|
||||
|
||||
`mediaCommand` sends one of `play`, `pause`, `toggle`, `next` or `previous` to that app. Both
|
||||
work regardless of which app is playing, so use them to put transport controls on your own
|
||||
screen. Ship audio through a media app instead of driving these.
|
||||
|
||||
Reference in new issue
Block a user