new env
This commit is contained in:
@@ -60,6 +60,7 @@ dependencies {
|
||||
implementation(libs.androidx.media3.ui)
|
||||
implementation(libs.androidx.media3.hls)
|
||||
implementation(libs.androidx.media3.session)
|
||||
implementation(libs.androidx.media3.dash)
|
||||
|
||||
// Room
|
||||
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.compose.setContent
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||
import net.tinsae.tv.ui.screens.MainScreen
|
||||
import net.tinsae.tv.ui.theme.TVTheme
|
||||
@@ -14,10 +16,6 @@ class MainActivity : ComponentActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
// Ensure the app starts in dark mode
|
||||
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 {
|
||||
TVTheme {
|
||||
@@ -26,3 +24,11 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun MainPreview(){
|
||||
TVTheme {
|
||||
MainScreen()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.tinsae.tv.ui.components.category
|
||||
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.aspectRatio
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
@@ -24,6 +25,7 @@ fun CategoryCard(
|
||||
modifier = modifier
|
||||
.padding(8.dp)
|
||||
.aspectRatio(30f / 10f)
|
||||
.clickable{ onClick() }
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.tinsae.tv.ui.components.channel
|
||||
|
||||
import android.view.KeyEvent
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.aspectRatio
|
||||
import androidx.compose.foundation.layout.padding
|
||||
@@ -28,10 +29,10 @@ import net.tinsae.tv.util.Misc.makeName
|
||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
||||
@Composable
|
||||
fun ChannelCard(
|
||||
modifier: Modifier = Modifier,
|
||||
channel: Channel,
|
||||
onClick: () -> Unit,
|
||||
onLongClick: (() -> Unit)? = null,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
CompactCard(
|
||||
onClick = onClick,
|
||||
@@ -65,6 +66,7 @@ fun ChannelCard(
|
||||
},
|
||||
modifier = modifier
|
||||
.padding(8.dp)
|
||||
.clickable { onClick() }
|
||||
.onKeyEvent { keyEvent ->
|
||||
if (keyEvent.type == KeyEventType.KeyDown) {
|
||||
when (keyEvent.key.nativeKeyCode) {
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.tinsae.tv.ui.theme.black
|
||||
fun DigitalClock() {
|
||||
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(
|
||||
factory = { context ->
|
||||
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.channel.ChannelGrid
|
||||
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.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.annotation.OptIn
|
||||
import androidx.compose.foundation.layout.Box
|
||||
@@ -24,6 +25,10 @@ import androidx.media3.exoplayer.ExoPlayer
|
||||
import androidx.media3.session.MediaSession
|
||||
import kotlinx.coroutines.delay
|
||||
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)
|
||||
@Composable
|
||||
@@ -42,6 +47,8 @@ fun VideoPlayer(
|
||||
val playerFocusRequester = remember { FocusRequester() }
|
||||
val firstItemFocusRequester = remember { FocusRequester() }
|
||||
|
||||
Log.d("Video Player", " Dow we have a URL ? $url")
|
||||
|
||||
val exoPlayer = remember {
|
||||
ExoPlayer.Builder(context).build().apply {
|
||||
setMediaItem(MediaItem.fromUri(url))
|
||||
@@ -1,4 +1,5 @@
|
||||
<resources>
|
||||
|
||||
<style name="Theme.TV" parent="Theme.AppCompat.DayNight.NoActionBar" />
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user