StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
refactor(live): move guide presentation models
David Nashash967eb4c2cc38
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgControlComponents.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgControlComponents.ktindex c01c9198..32db416d 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgControlComponents.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgControlComponents.kt@@ -56,6 +56,8 @@ import androidx.tv.material3.ClickableSurfaceDefaultsimport androidx.tv.material3.MaterialThemeimport androidx.tv.material3.Textimport com.streamvault.app.R+import com.streamvault.feature.live.presentation.epg.GuideChannelMode+import com.streamvault.feature.live.presentation.epg.GuideDensityimport com.streamvault.app.device.rememberIsTelevisionDeviceimport com.streamvault.app.ui.components.SelectionChipimport com.streamvault.app.ui.components.SelectionChipRowdiff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.ktindex fc6a9c25..b589f960 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.kt@@ -50,6 +50,7 @@ import androidx.tv.material3.Surfaceimport androidx.tv.material3.SurfaceDefaultsimport androidx.tv.material3.Textimport com.streamvault.app.R+import com.streamvault.feature.live.presentation.epg.GuideDensityimport com.streamvault.core.ui.image.ChannelLogoBadgeimport com.streamvault.core.ui.interaction.TvButtonimport com.streamvault.core.ui.interaction.TvClickableSurfacediff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.ktindex aabfc23a..f590d3b6 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.kt@@ -42,6 +42,7 @@ import androidx.tv.material3.Surfaceimport androidx.tv.material3.SurfaceDefaultsimport androidx.tv.material3.Textimport com.streamvault.app.R+import com.streamvault.feature.live.presentation.epg.GuideDensityimport com.streamvault.core.ui.image.ChannelLogoBadgeimport com.streamvault.player.ui.PlayerRenderViewimport com.streamvault.domain.playback.isArchivePlayablediff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreenDialogs.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreenDialogs.ktindex 475eea47..63ba881d 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreenDialogs.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreenDialogs.kt@@ -50,6 +50,8 @@ import androidx.tv.material3.Surfaceimport androidx.tv.material3.SurfaceDefaultsimport androidx.tv.material3.Textimport com.streamvault.app.R+import com.streamvault.feature.live.presentation.epg.GuideChannelMode+import com.streamvault.feature.live.presentation.epg.GuideDensityimport com.streamvault.core.ui.interaction.TvClickableSurfaceimport com.streamvault.core.ui.interaction.TvButtonimport com.streamvault.feature.live.presentation.time.LocalLiveTimeFormatdiff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgViewModel.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgViewModel.ktindex 344df36f..838ba75f 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgViewModel.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgViewModel.kt@@ -75,6 +75,9 @@ import com.streamvault.player.PlayerEngineimport com.streamvault.feature.live.presentation.epg.guidePrimeTimeAnchorimport com.streamvault.feature.live.presentation.epg.jumpGuideAnchorToDayimport com.streamvault.feature.live.presentation.epg.shiftGuideAnchorByDays+import com.streamvault.feature.live.presentation.epg.GuideChannelMode+import com.streamvault.feature.live.presentation.epg.GuideDensity+import com.streamvault.feature.live.presentation.epg.programReminderDeliveryIssueMessageimport javax.inject.Provider as InjectProviderdata class RecordingConflictInfo(@@ -149,29 +152,6 @@ data class ProgramReminderUiState(this.programStartTime == programStartTime}-internal fun programReminderDeliveryIssueMessage(reminders: List<ProgramReminder>): String? {- val issue = reminders.firstOrNull {- it.deliveryState == ProgramReminderDeliveryState.BLOCKED ||- it.deliveryState == ProgramReminderDeliveryState.FAILED- } ?: return null- val reason = issue.deliveryFailureReason- ?.takeIf { it.isNotBlank() }- ?: "The notification was not accepted."- return "Reminder for ${issue.programTitle} was not delivered: $reason"-}--enum class GuideChannelMode {- ALL,- ANCHORED,- ARCHIVE_READY-}--enum class GuideDensity {- COMPACT,- COMFORTABLE,- CINEMATIC-}-private data class GuideProgramsResult(val programsByChannel: Map<String, List<Program>>,val failedCount: Intdiff --git a/app/src/test/java/com/streamvault/app/ui/screens/epg/ProgramReminderIssueMessageTest.kt b/app/src/test/java/com/streamvault/app/ui/screens/epg/ProgramReminderIssueMessageTest.ktindex f26bf56a..8e6ddccd 100644--- a/app/src/test/java/com/streamvault/app/ui/screens/epg/ProgramReminderIssueMessageTest.kt+++ b/app/src/test/java/com/streamvault/app/ui/screens/epg/ProgramReminderIssueMessageTest.kt@@ -1,5 +1,7 @@package com.streamvault.app.ui.screens.epg+import com.streamvault.feature.live.presentation.epg.programReminderDeliveryIssueMessage+import com.google.common.truth.Truth.assertThatimport com.streamvault.domain.model.ProgramReminderimport com.streamvault.domain.model.ProgramReminderDeliveryStatediff --git a/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/GuidePresentationModels.kt b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/GuidePresentationModels.ktnew file mode 100644index 00000000..239d91f8--- /dev/null+++ b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/GuidePresentationModels.kt@@ -0,0 +1,27 @@+package com.streamvault.feature.live.presentation.epg++import com.streamvault.domain.model.ProgramReminder+import com.streamvault.domain.model.ProgramReminderDeliveryState++enum class GuideChannelMode {+ ALL,+ ANCHORED,+ ARCHIVE_READY+}++enum class GuideDensity {+ COMPACT,+ COMFORTABLE,+ CINEMATIC+}++fun programReminderDeliveryIssueMessage(reminders: List<ProgramReminder>): String? {+ val issue = reminders.firstOrNull {+ it.deliveryState == ProgramReminderDeliveryState.BLOCKED ||+ it.deliveryState == ProgramReminderDeliveryState.FAILED+ } ?: return null+ val reason = issue.deliveryFailureReason+ ?.takeIf { it.isNotBlank() }+ ?: "The notification was not accepted."+ return "Reminder for ${issue.programTitle} was not delivered: $reason"+}