Rename OrbitOffice to Orbit Drive-In, with its event types (0.30.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,7 @@ internal class HttpsEmbyTransport(internal val deviceId: String = UUID.randomUUI
|
||||
connection.connectTimeout = 10_000
|
||||
connection.readTimeout = request.readTimeoutMs ?: if (request.path == "/Sessions/Logout") 5_000 else 15_000
|
||||
connection.setRequestProperty("Accept", "application/json")
|
||||
connection.setRequestProperty("X-Emby-Authorization", "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.29.0\"")
|
||||
connection.setRequestProperty("X-Emby-Authorization", "Emby Client=\"Orbit TV\", Device=\"Orbit TV\", DeviceId=\"$deviceId\", Version=\"0.30.0\"")
|
||||
request.token?.let { connection.setRequestProperty("X-Emby-Token", it) }
|
||||
if (request.method == "POST") {
|
||||
val bytes = request.body.orEmpty().toByteArray(Charsets.UTF_8)
|
||||
|
||||
@@ -51,7 +51,7 @@ import kotlinx.coroutines.withContext
|
||||
@Composable
|
||||
internal fun EmbyConnectionScreen(modifier: Modifier = Modifier, visible: Boolean,
|
||||
mainGuide: Boolean, mainHome: Boolean = false, onChannelAvailable: (Boolean) -> Unit, onGuide: () -> Unit,
|
||||
onHome: () -> Unit = {}, onOffice: () -> Unit = {}, onBack: () -> Unit) {
|
||||
onHome: () -> Unit = {}, onDriveIn: () -> Unit = {}, onBack: () -> Unit) {
|
||||
val appContext = androidx.compose.ui.platform.LocalContext.current.applicationContext
|
||||
val savedStore = remember { RememberedConnectionStore.get(appContext) }
|
||||
var setupSaved by remember { mutableStateOf(false) }
|
||||
@@ -242,7 +242,7 @@ internal fun EmbyConnectionScreen(modifier: Modifier = Modifier, visible: Boolea
|
||||
}
|
||||
val picture = @Composable { GuidePicture(liveSession, liveChannel, live = !watchingChannel) }
|
||||
if (mainHome) HomeScreen(availableChannels, liveChannel, modifier, picture,
|
||||
onCategory = { guideCategory = it; onGuide() }, onWatch = { tune(it, 0) }, onOffice = onOffice)
|
||||
onCategory = { guideCategory = it; onGuide() }, onWatch = { tune(it, 0) }, onDriveIn = onDriveIn)
|
||||
else GuideGrid(channelsIn(guideCategory, availableChannels).ifEmpty { availableChannels }, selectedNumber, modifier, guideCategory.label, picture,
|
||||
onWatch = ::tune, onBack = { guideCategory = ChannelCategory.All; onHome() })
|
||||
return
|
||||
|
||||
@@ -67,7 +67,7 @@ private fun ProgressBar(fraction: Float, modifier: Modifier = Modifier, focused:
|
||||
/** Home opens onto the tuned channel playing, one press from anything else. Back takes it full screen. */
|
||||
@Composable
|
||||
internal fun HomeScreen(channels: List<SampleChannel>, tuned: SampleChannel, modifier: Modifier = Modifier,
|
||||
picture: @Composable () -> Unit, onCategory: (ChannelCategory) -> Unit, onWatch: (Int) -> Unit, onOffice: () -> Unit) {
|
||||
picture: @Composable () -> Unit, onCategory: (ChannelCategory) -> Unit, onWatch: (Int) -> Unit, onDriveIn: () -> Unit) {
|
||||
var now by remember { mutableLongStateOf(System.currentTimeMillis()) }
|
||||
LaunchedEffect(Unit) { while (true) { delay(1000); now = System.currentTimeMillis() } }
|
||||
val firstFocus = remember { FocusRequester() }
|
||||
@@ -120,12 +120,12 @@ internal fun HomeScreen(channels: List<SampleChannel>, tuned: SampleChannel, mod
|
||||
}
|
||||
}
|
||||
}
|
||||
val preview = officeEvents.first()
|
||||
HomeCard(Modifier.fillMaxWidth().weight(1f), onClick = onOffice) { focused ->
|
||||
val preview = driveInEvents.first()
|
||||
HomeCard(Modifier.fillMaxWidth().weight(1f), onClick = onDriveIn) { focused ->
|
||||
Column {
|
||||
Row(Modifier.fillMaxWidth().background(if (focused) Yellow else Color(0xFF7A5A12)).padding(horizontal = 10.dp, vertical = 5.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Image(painterResource(R.drawable.orbit_icon_office), null, Modifier.size(20.dp), colorFilter = if (focused) ColorFilter.tint(Navy) else null)
|
||||
Text("OrbitOffice preview", color = if (focused) Navy else Color.White, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, maxLines = 1)
|
||||
Text("Orbit Drive-In preview", color = if (focused) Navy else Color.White, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, maxLines = 1)
|
||||
}
|
||||
Column(Modifier.padding(horizontal = 10.dp, vertical = 8.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
Text(preview.title, color = if (focused) Navy else Color.White, fontSize = 18.sp, fontWeight = FontWeight.SemiBold, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||
|
||||
@@ -132,7 +132,7 @@ private fun OrbitApp() {
|
||||
LaunchedEffect(section, fullscreen, realChannelAvailable) {
|
||||
if (!fullscreen) {
|
||||
if (!realChannelAvailable) {
|
||||
val tab = when (section) { "TV Guide" -> 1; "Box Office" -> 2; else -> 0 }
|
||||
val tab = when (section) { "TV Guide" -> 1; "Drive-In" -> 2; else -> 0 }
|
||||
tabFocus[tab].requestFocus()
|
||||
} else if (section != "Home" && section != "TV Guide") gearFocus.requestFocus()
|
||||
}
|
||||
@@ -165,7 +165,7 @@ private fun OrbitApp() {
|
||||
// The numbered tabs only serve the demo guide. With real channels, home and the gear replace them.
|
||||
if (!realChannelAvailable) {
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
listOf("Menu", "TV Guide", "Box Office").forEachIndexed { index, title ->
|
||||
listOf("Menu", "TV Guide", "Drive-In").forEachIndexed { index, title ->
|
||||
OrbitButton("${index + 1} $title", Modifier.focusRequester(tabFocus[index]),
|
||||
section == title, onClick = { section = title; pinned = false })
|
||||
}
|
||||
@@ -220,8 +220,8 @@ private fun OrbitApp() {
|
||||
OrbitMenu(Modifier.weight(1f), onNavigate = { section = it; pinned = false })
|
||||
} else if (section == "Connect Emby") {
|
||||
// Connection content is kept composed below to retain the temporary session.
|
||||
} else if (section == "Box Office") {
|
||||
OrbOffice(Modifier.weight(1f), onGuide = { section = "TV Guide" })
|
||||
} else if (section == "Drive-In") {
|
||||
DriveIn(Modifier.weight(1f), onGuide = { section = "TV Guide" })
|
||||
} else if (section != "TV Guide" && section != "Home") {
|
||||
Column(Modifier.fillMaxWidth().weight(1f).background(Panel).padding(28.dp)) {
|
||||
Text("Welcome to Orbit Interactive", color = Yellow, fontSize = 27.sp, fontWeight = FontWeight.Bold)
|
||||
@@ -237,7 +237,7 @@ private fun OrbitApp() {
|
||||
mainGuide = section == "TV Guide" && realChannelAvailable,
|
||||
mainHome = section == "Home" && realChannelAvailable,
|
||||
onChannelAvailable = { realChannelAvailable = it },
|
||||
onGuide = { section = "TV Guide" }, onHome = { section = "Home" }, onOffice = { section = "Box Office" }, onBack = { section = "Menu" })
|
||||
onGuide = { section = "TV Guide" }, onHome = { section = "Home" }, onDriveIn = { section = "Drive-In" }, onBack = { section = "Menu" })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,16 @@ internal val Barlow = FontFamily(Font(R.font.barlow_regular), Font(R.font.barlow
|
||||
private val TicketType = FontFamily(Font(R.font.barlow_condensed_medium))
|
||||
private val Paper = Color(0xFFF7EAC8)
|
||||
|
||||
internal data class OfficeEvent(val title: String, val collection: String, val time: String,
|
||||
internal data class DriveInEvent(val title: String, val collection: String, val time: String,
|
||||
val synopsis: String, val reference: String)
|
||||
internal val officeEvents = listOf(
|
||||
OfficeEvent("The Last Shuttle Home", "Orbit premieres", "Tonight at 21:30",
|
||||
internal val driveInEvents = listOf(
|
||||
DriveInEvent("The Last Shuttle Home", "Orbit Marquee", "Tonight at 21:30",
|
||||
"One final journey brings an unlikely crew together. A fictional premiere for your own front-row seat.", "ORB-001"),
|
||||
OfficeEvent("Visitors at Dawn", "After dark", "Tonight at 23:00",
|
||||
DriveInEvent("Twin Moons", "Orbit Double Bill", "Tonight from 20:00",
|
||||
"Two films, one long night under two moons. A fictional double feature with an interval between.", "ORB-003"),
|
||||
DriveInEvent("The Far Side Trilogy", "Orbit Triple Bill", "Saturday from 19:00",
|
||||
"Three chapters back to back, for those who brought snacks. A fictional all-evening event.", "ORB-004"),
|
||||
DriveInEvent("Visitors at Dawn", "The Late Show", "Tonight at 23:00",
|
||||
"First contact arrives in the quietest corner of Earth. A fictional late-night science-fiction special.", "ORB-002")
|
||||
)
|
||||
|
||||
@@ -43,20 +47,20 @@ internal fun OrbitMenu(modifier: Modifier = Modifier, onNavigate: (String) -> Un
|
||||
Column(Modifier.weight(1f).align(Alignment.CenterVertically), verticalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
OrbitButton("Connect Emby / Check a small sample", Modifier.fillMaxWidth(), onClick = { onNavigate("Connect Emby") })
|
||||
OrbitButton("TV Guide / What's on now", Modifier.fillMaxWidth(), onClick = { onNavigate("TV Guide") })
|
||||
OrbitButton("OrbOffice / Special transmissions", Modifier.fillMaxWidth(), onClick = { onNavigate("Box Office") })
|
||||
OrbitButton("Orbit Drive-In / Special transmissions", Modifier.fillMaxWidth(), onClick = { onNavigate("Drive-In") })
|
||||
OrbitButton("Services / Orbit Interactive", Modifier.fillMaxWidth(), onClick = { onNavigate("Services") })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun OrbOffice(modifier: Modifier = Modifier, onGuide: () -> Unit) {
|
||||
internal fun DriveIn(modifier: Modifier = Modifier, onGuide: () -> Unit) {
|
||||
var selectedEvent by remember { mutableIntStateOf(0) }
|
||||
val event = officeEvents[selectedEvent]
|
||||
val event = driveInEvents[selectedEvent]
|
||||
Row(modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(24.dp)) {
|
||||
Column(Modifier.weight(1.55f).fillMaxHeight()) {
|
||||
Row(verticalAlignment = Alignment.Bottom) {
|
||||
Text("OrbOffice", color = Yellow, fontFamily = TicketType, fontSize = 36.sp)
|
||||
Text("Orbit Drive-In", color = Yellow, fontFamily = TicketType, fontSize = 36.sp)
|
||||
Text(" Your front-row seat.", color = Muted, fontFamily = Barlow, fontSize = 17.sp, modifier = Modifier.padding(bottom = 5.dp))
|
||||
}
|
||||
Spacer(Modifier.height(10.dp))
|
||||
@@ -66,7 +70,7 @@ internal fun OrbOffice(modifier: Modifier = Modifier, onGuide: () -> Unit) {
|
||||
}
|
||||
Column(Modifier.weight(1f).fillMaxHeight(), verticalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
Text("Special transmissions", color = Color.White, fontFamily = Barlow, fontWeight = FontWeight.SemiBold, fontSize = 23.sp)
|
||||
officeEvents.forEachIndexed { index, item ->
|
||||
driveInEvents.forEachIndexed { index, item ->
|
||||
OrbitButton(item.collection, Modifier.fillMaxWidth(), selected = selectedEvent == index,
|
||||
onFocus = { selectedEvent = index }, onClick = { selectedEvent = index })
|
||||
}
|
||||
@@ -79,7 +83,7 @@ internal fun OrbOffice(modifier: Modifier = Modifier, onGuide: () -> Unit) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AdmissionTicket(event: OfficeEvent, modifier: Modifier = Modifier) {
|
||||
private fun AdmissionTicket(event: DriveInEvent, modifier: Modifier = Modifier) {
|
||||
Box(modifier.background(Paper)) {
|
||||
Canvas(Modifier.matchParentSize()) {
|
||||
val seam = size.width * .76f
|
||||
@@ -95,7 +99,7 @@ private fun AdmissionTicket(event: OfficeEvent, modifier: Modifier = Modifier) {
|
||||
}
|
||||
Row(Modifier.fillMaxSize()) {
|
||||
Column(Modifier.weight(.76f).fillMaxHeight().padding(horizontal = 22.dp, vertical = 18.dp)) {
|
||||
Text("OrbOffice", color = Navy, fontFamily = TicketType, fontSize = 27.sp)
|
||||
Text("Drive-In", color = Navy, fontFamily = TicketType, fontSize = 27.sp)
|
||||
Text(event.collection, color = Navy, fontFamily = Barlow, fontSize = 14.sp)
|
||||
Spacer(Modifier.height(14.dp))
|
||||
Text(event.title, color = Navy, fontFamily = TicketType, fontSize = 33.sp, lineHeight = 35.sp, maxLines = 3)
|
||||
|
||||
@@ -33,7 +33,7 @@ internal class SecureMediaDataSource(private val session: EmbySampleSession) : B
|
||||
next.instanceFollowRedirects = false
|
||||
next.connectTimeout = 10_000
|
||||
next.readTimeout = 20_000
|
||||
next.setRequestProperty("User-Agent", "OrbitTV/0.29.0")
|
||||
next.setRequestProperty("User-Agent", "OrbitTV/0.30.0")
|
||||
next.setRequestProperty("Accept-Encoding", "identity")
|
||||
session.mediaHeaders(address).forEach { (key, value) -> next.setRequestProperty(key, value) }
|
||||
if (dataSpec.position != 0L || dataSpec.length != C.LENGTH_UNSET.toLong()) {
|
||||
|
||||
Reference in New Issue
Block a user