mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 13:38:13 -08:00
fix: Lots of navigation improvements
This commit is contained in:
parent
c299492d6d
commit
5174bb3a6c
55 changed files with 1019 additions and 832 deletions
2
android/.gitignore
vendored
2
android/.gitignore
vendored
|
|
@ -11,5 +11,3 @@ GeneratedPluginRegistrant.java
|
|||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
|
||||
**/TestData.kt
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ flutter {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
def composeBom = platform('androidx.compose:compose-bom:2025.09.00')
|
||||
def composeBom = platform('androidx.compose:compose-bom:2025.09.01')
|
||||
implementation composeBom
|
||||
androidTestImplementation composeBom
|
||||
implementation('androidx.compose.material3:material3')
|
||||
|
|
@ -130,7 +130,8 @@ dependencies {
|
|||
implementation("io.github.peerless2012:ass-media:0.3.0-rc03")
|
||||
|
||||
//UI
|
||||
implementation("io.github.rabehx:iconsax-compose:0.0.3")
|
||||
implementation("io.github.rabehx:iconsax-compose:0.0.4")
|
||||
implementation("io.coil-kt.coil3:coil-compose:3.3.0")
|
||||
implementation("io.coil-kt.coil3:coil-network-okhttp:3.3.0")
|
||||
implementation("com.materialkolor:material-kolor:3.0.1")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,26 @@
|
|||
package nl.jknaapen.fladder
|
||||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = Color(0xFF3B82F6)
|
||||
|
||||
)
|
||||
import com.materialkolor.PaletteStyle
|
||||
import com.materialkolor.dynamiccolor.ColorSpec
|
||||
import com.materialkolor.rememberDynamicColorScheme
|
||||
|
||||
@Composable
|
||||
fun VideoPlayerTheme(
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colorScheme = rememberDynamicColorScheme(
|
||||
seedColor = Color(0xFFFF9800),
|
||||
isDark = true,
|
||||
specVersion = ColorSpec.SpecVersion.SPEC_2025,
|
||||
style = PaletteStyle.Expressive,
|
||||
)
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = DarkColorScheme,
|
||||
colorScheme = colorScheme,
|
||||
) {
|
||||
CompositionLocalProvider {
|
||||
content()
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ package nl.jknaapen.fladder.composables.controls
|
|||
|
||||
import PlayableData
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
|
|
@ -33,8 +32,8 @@ fun ItemHeader(state: PlayableData?) {
|
|||
contentDescription = title ?: "logo",
|
||||
alignment = Alignment.CenterStart,
|
||||
modifier = Modifier
|
||||
.heightIn(max = 100.dp)
|
||||
.widthIn(max = 200.dp)
|
||||
.fillMaxHeight(0.25f)
|
||||
.fillMaxWidth(0.5f)
|
||||
)
|
||||
} else {
|
||||
title?.let {
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ import androidx.compose.foundation.layout.Box
|
|||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.RowScope
|
||||
import androidx.compose.foundation.layout.aspectRatio
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
|
|
@ -102,6 +102,7 @@ internal fun ProgressBar(
|
|||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(125.dp)
|
||||
.padding(bottom = 32.dp)
|
||||
.align(alignment = Alignment.CenterHorizontally),
|
||||
currentPosition = tempPosition.milliseconds,
|
||||
trickPlayModel = playbackData?.trickPlayModel
|
||||
|
|
@ -129,7 +130,7 @@ internal fun ProgressBar(
|
|||
Text(
|
||||
formatTime(currentPosition),
|
||||
color = Color.White,
|
||||
style = MaterialTheme.typography.labelMedium
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
SimpleProgressBar(
|
||||
player,
|
||||
|
|
@ -152,7 +153,7 @@ internal fun ProgressBar(
|
|||
)
|
||||
),
|
||||
color = Color.White,
|
||||
style = MaterialTheme.typography.labelMedium
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -240,9 +241,11 @@ internal fun RowScope.SimpleProgressBar(
|
|||
modifier = Modifier
|
||||
.focusable(enabled = false)
|
||||
.fillMaxWidth()
|
||||
.height(12.dp)
|
||||
.height(8.dp)
|
||||
.background(
|
||||
color = Color.Black.copy(alpha = 0.15f),
|
||||
color = Color.Black.copy(
|
||||
alpha = 0.15f
|
||||
),
|
||||
shape = slideBarShape
|
||||
),
|
||||
) {
|
||||
|
|
@ -251,9 +254,11 @@ internal fun RowScope.SimpleProgressBar(
|
|||
.focusable(enabled = false)
|
||||
.fillMaxHeight()
|
||||
.fillMaxWidth(progress)
|
||||
.padding(end = 9.dp)
|
||||
.padding(end = 8.dp)
|
||||
.background(
|
||||
color = Color.White.copy(alpha = 0.75f),
|
||||
color = if (thumbFocused) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.primary.copy(
|
||||
alpha = 0.75f
|
||||
),
|
||||
shape = slideBarShape
|
||||
)
|
||||
)
|
||||
|
|
@ -321,11 +326,13 @@ internal fun RowScope.SimpleProgressBar(
|
|||
.graphicsLayer {
|
||||
translationX = startPx
|
||||
}
|
||||
.size(6.dp)
|
||||
.padding(vertical = 0.5.dp)
|
||||
.fillMaxHeight()
|
||||
.aspectRatio(ratio = 1f)
|
||||
.background(
|
||||
color = (if (isAfterCurrentPositon) Color.White else Color.Black).copy(
|
||||
alpha = 0.45f
|
||||
),
|
||||
color = if (isAfterCurrentPositon) Color.White.copy(
|
||||
alpha = 0.5f
|
||||
) else MaterialTheme.colorScheme.onPrimary.copy(alpha = 0.7f),
|
||||
shape = CircleShape
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.fillMaxHeight
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
|
|
@ -25,6 +26,7 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.compose.ui.zIndex
|
||||
import coil3.compose.AsyncImagePainter
|
||||
import coil3.compose.rememberAsyncImagePainter
|
||||
import coil3.imageLoader
|
||||
import coil3.request.ImageRequest
|
||||
import coil3.toBitmap
|
||||
import kotlin.time.Duration
|
||||
|
|
@ -42,6 +44,16 @@ fun FilmstripTrickPlayOverlay(
|
|||
return
|
||||
}
|
||||
|
||||
val context = LocalContext.current
|
||||
LaunchedEffect(trickPlayModel) {
|
||||
trickPlayModel.images.forEach { imageUrl ->
|
||||
val request = ImageRequest.Builder(context)
|
||||
.data(imageUrl)
|
||||
.build()
|
||||
context.imageLoader.enqueue(request)
|
||||
}
|
||||
}
|
||||
|
||||
val uniqueThumbnails = remember(currentPosition, trickPlayModel, thumbnailsToShowOnEachSide) {
|
||||
val currentFrameIndex = (currentPosition.inWholeMilliseconds / trickPlayModel.interval)
|
||||
.toInt()
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ import io.github.rabehx.iconsax.filled.AudioSquare
|
|||
import io.github.rabehx.iconsax.filled.Backward
|
||||
import io.github.rabehx.iconsax.filled.Check
|
||||
import io.github.rabehx.iconsax.filled.Forward
|
||||
import io.github.rabehx.iconsax.filled.PauseCircle
|
||||
import io.github.rabehx.iconsax.filled.PlayCircle
|
||||
import io.github.rabehx.iconsax.filled.Pause
|
||||
import io.github.rabehx.iconsax.filled.Play
|
||||
import io.github.rabehx.iconsax.filled.Subtitle
|
||||
import io.github.rabehx.iconsax.outline.CloseSquare
|
||||
import io.github.rabehx.iconsax.outline.Refresh
|
||||
|
|
@ -349,7 +349,7 @@ fun PlaybackButtons(
|
|||
},
|
||||
) {
|
||||
Icon(
|
||||
if (isPlaying) Iconsax.Filled.PauseCircle else Iconsax.Filled.PlayCircle,
|
||||
if (isPlaying) Iconsax.Filled.Pause else Iconsax.Filled.Play,
|
||||
modifier = Modifier.size(55.dp),
|
||||
contentDescription = if (isPlaying) "Pause" else "Play",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue