new env
This commit is contained in:
@@ -60,6 +60,7 @@ dependencies {
|
|||||||
implementation(libs.androidx.media3.ui)
|
implementation(libs.androidx.media3.ui)
|
||||||
implementation(libs.androidx.media3.hls)
|
implementation(libs.androidx.media3.hls)
|
||||||
implementation(libs.androidx.media3.session)
|
implementation(libs.androidx.media3.session)
|
||||||
|
implementation(libs.androidx.media3.dash)
|
||||||
|
|
||||||
// Room
|
// Room
|
||||||
implementation(libs.androidx.room.runtime)
|
implementation(libs.androidx.room.runtime)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -4,6 +4,8 @@ import android.os.Bundle
|
|||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import net.tinsae.tv.ui.screens.MainScreen
|
import net.tinsae.tv.ui.screens.MainScreen
|
||||||
import net.tinsae.tv.ui.theme.TVTheme
|
import net.tinsae.tv.ui.theme.TVTheme
|
||||||
@@ -15,10 +17,6 @@ class MainActivity : ComponentActivity() {
|
|||||||
// Ensure the app starts in dark mode
|
// Ensure the app starts in dark mode
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||||
|
|
||||||
// Ensure the window background is transparent to allow SurfaceView (Video)
|
|
||||||
// to be visible through the UI layers.
|
|
||||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
TVTheme {
|
TVTheme {
|
||||||
MainScreen()
|
MainScreen()
|
||||||
@@ -26,3 +24,11 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Preview
|
||||||
|
@Composable
|
||||||
|
fun MainPreview(){
|
||||||
|
TVTheme {
|
||||||
|
MainScreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package net.tinsae.tv.ui.components.category
|
package net.tinsae.tv.ui.components.category
|
||||||
|
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
@@ -24,6 +25,7 @@ fun CategoryCard(
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
.aspectRatio(30f / 10f)
|
.aspectRatio(30f / 10f)
|
||||||
|
.clickable{ onClick() }
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package net.tinsae.tv.ui.components.channel
|
package net.tinsae.tv.ui.components.channel
|
||||||
|
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
@@ -28,10 +29,10 @@ import net.tinsae.tv.util.Misc.makeName
|
|||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@OptIn(ExperimentalTvMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun ChannelCard(
|
fun ChannelCard(
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
channel: Channel,
|
channel: Channel,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
onLongClick: (() -> Unit)? = null,
|
onLongClick: (() -> Unit)? = null,
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
) {
|
||||||
CompactCard(
|
CompactCard(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
@@ -65,6 +66,7 @@ fun ChannelCard(
|
|||||||
},
|
},
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
|
.clickable { onClick() }
|
||||||
.onKeyEvent { keyEvent ->
|
.onKeyEvent { keyEvent ->
|
||||||
if (keyEvent.type == KeyEventType.KeyDown) {
|
if (keyEvent.type == KeyEventType.KeyDown) {
|
||||||
when (keyEvent.key.nativeKeyCode) {
|
when (keyEvent.key.nativeKeyCode) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import net.tinsae.tv.ui.theme.black
|
|||||||
fun DigitalClock() {
|
fun DigitalClock() {
|
||||||
val shape = RoundedTrapezoidShape(15.dp, 7.dp)
|
val shape = RoundedTrapezoidShape(15.dp, 7.dp)
|
||||||
|
|
||||||
Box(modifier = Modifier.fillMaxWidth().padding(16.dp, 0.dp), contentAlignment = Alignment.TopCenter){
|
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.TopCenter){
|
||||||
AndroidView(
|
AndroidView(
|
||||||
factory = { context ->
|
factory = { context ->
|
||||||
TextClock(context).apply {
|
TextClock(context).apply {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import net.tinsae.tv.model.Channel
|
|||||||
import net.tinsae.tv.ui.components.category.CategoryGrid
|
import net.tinsae.tv.ui.components.category.CategoryGrid
|
||||||
import net.tinsae.tv.ui.components.channel.ChannelGrid
|
import net.tinsae.tv.ui.components.channel.ChannelGrid
|
||||||
import net.tinsae.tv.ui.components.common.DigitalClock
|
import net.tinsae.tv.ui.components.common.DigitalClock
|
||||||
import net.tinsae.tv.ui.components.player.VideoPlayer
|
|
||||||
import net.tinsae.tv.ui.viewmodel.ChannelUiState
|
import net.tinsae.tv.ui.viewmodel.ChannelUiState
|
||||||
import net.tinsae.tv.ui.viewmodel.ChannelViewModel
|
import net.tinsae.tv.ui.viewmodel.ChannelViewModel
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package net.tinsae.tv.ui.components.player
|
package net.tinsae.tv.ui.screens
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.annotation.OptIn
|
import androidx.annotation.OptIn
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@@ -24,6 +25,10 @@ import androidx.media3.exoplayer.ExoPlayer
|
|||||||
import androidx.media3.session.MediaSession
|
import androidx.media3.session.MediaSession
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import net.tinsae.tv.model.Channel
|
import net.tinsae.tv.model.Channel
|
||||||
|
import net.tinsae.tv.ui.components.player.ChannelOverlay
|
||||||
|
import net.tinsae.tv.ui.components.player.PlaybackErrorMessage
|
||||||
|
import net.tinsae.tv.ui.components.player.PlayerContainer
|
||||||
|
import net.tinsae.tv.ui.components.player.eventHandler
|
||||||
|
|
||||||
@OptIn(UnstableApi::class)
|
@OptIn(UnstableApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
@@ -42,6 +47,8 @@ fun VideoPlayer(
|
|||||||
val playerFocusRequester = remember { FocusRequester() }
|
val playerFocusRequester = remember { FocusRequester() }
|
||||||
val firstItemFocusRequester = remember { FocusRequester() }
|
val firstItemFocusRequester = remember { FocusRequester() }
|
||||||
|
|
||||||
|
Log.d("Video Player", " Dow we have a URL ? $url")
|
||||||
|
|
||||||
val exoPlayer = remember {
|
val exoPlayer = remember {
|
||||||
ExoPlayer.Builder(context).build().apply {
|
ExoPlayer.Builder(context).build().apply {
|
||||||
setMediaItem(MediaItem.fromUri(url))
|
setMediaItem(MediaItem.fromUri(url))
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Theme.TV" parent="Theme.AppCompat.DayNight.NoActionBar" />
|
<style name="Theme.TV" parent="Theme.AppCompat.DayNight.NoActionBar" />
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -39,6 +39,7 @@ androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplaye
|
|||||||
androidx-media3-ui = { group = "androidx.media3", name = "media3-ui", version.ref = "media3" }
|
androidx-media3-ui = { group = "androidx.media3", name = "media3-ui", version.ref = "media3" }
|
||||||
androidx-media3-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "media3" }
|
androidx-media3-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "media3" }
|
||||||
androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" }
|
androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" }
|
||||||
|
androidx-media3-dash = { group = "androidx.media3", name = "media3-exoplayer-dash", version.ref = "media3" }
|
||||||
androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
|
androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
|
||||||
androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
|
androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
|
||||||
androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
|
androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
|
||||||
|
|||||||
Reference in New Issue
Block a user