Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lsongdev committed Aug 28, 2024
1 parent 6c15128 commit 21cd030
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 552 deletions.
4 changes: 1 addition & 3 deletions app/src/main/java/me/lsong/mytv/iptv/TVChannel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ data class TVSource(
*/
@Immutable
data class TVChannel(
val no: String = "",
val icon: ImageVector? = null,
/**
* 直播源名称
*/
Expand Down Expand Up @@ -79,6 +77,6 @@ data class TVChannelList(
val value: List<TVChannel> = emptyList(),
) : List<TVChannel> by value {
companion object {
val EXAMPLE = TVChannelList(List(10) { i -> TVChannel.EXAMPLE.copy() })
val EXAMPLE = TVChannelList(List(10) { _ -> TVChannel.EXAMPLE.copy() })
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/me/lsong/mytv/iptv/TVGroup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data class TVGroupList(
) : List<TVGroup> by value {
companion object {
val EXAMPLE = TVGroupList(List(5) { groupIdx ->
TVGroup.EXAMPLE
TVGroup.EXAMPLE.copy(title = "Group $groupIdx")
})

fun TVGroupList.findGroupIndex(iptv: TVChannel) =
Expand Down
8 changes: 3 additions & 5 deletions app/src/main/java/me/lsong/mytv/ui/MainContent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.ui.input.key.KeyEventType
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onPreviewKeyEvent
import androidx.compose.ui.input.key.type
import androidx.compose.ui.platform.LocalConfiguration
import androidx.lifecycle.viewmodel.compose.viewModel
import kotlinx.coroutines.delay
import me.lsong.mytv.epg.EpgList
Expand All @@ -26,8 +25,8 @@ import me.lsong.mytv.ui.player.MyTvVideoScreen
import me.lsong.mytv.ui.player.rememberLeanbackVideoPlayerState
import me.lsong.mytv.ui.settings.MyTvSettingsViewModel
import me.lsong.mytv.ui.widgets.MyTvMenu
import me.lsong.mytv.ui.widgets.MyTvMenuWidget
import me.lsong.mytv.ui.widgets.MyTvNowPlaying
import me.lsong.mytv.utils.Settings
import me.lsong.mytv.utils.handleLeanbackDragGestures
import me.lsong.mytv.utils.handleLeanbackKeyEvents

Expand Down Expand Up @@ -119,11 +118,10 @@ fun LeanbackMainContent(
)

LeanbackVisible({ mainContentState.isMenuVisible && !mainContentState.isChannelInfoVisible }) {
MyTvMenu(
epgListProvider = { epgList },
MyTvMenuWidget(
groupListProvider = { groupList },
epgListProvider = { epgList },
channelProvider = { mainContentState.currentChannel },
onClose = { mainContentState.isMenuVisible = false },
onSelected = { channel -> mainContentState.changeCurrentChannel(channel) }
)
}
Expand Down
157 changes: 0 additions & 157 deletions app/src/main/java/me/lsong/mytv/ui/components/ChannelItem.kt

This file was deleted.

102 changes: 0 additions & 102 deletions app/src/main/java/me/lsong/mytv/ui/components/ChannelList.kt

This file was deleted.

Loading

0 comments on commit 21cd030

Please sign in to comment.