feat: Now Playing screen MVP (nb. layout xml and Compose UI are two different sources)

This commit is contained in:
2026-05-14 00:44:43 +02:00
parent 395609791f
commit 26115f773f
23 changed files with 885 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
package at.lockstep.player
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import at.lockstep.player.ui.NowPlayingScreen
import at.lockstep.player.ui.NowPlayingUiState
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialTheme {
Surface(modifier = Modifier.fillMaxSize()) {
var progress by remember { mutableFloatStateOf(0f) }
var playing by remember { mutableStateOf(false) }
NowPlayingScreen(
state = NowPlayingUiState(
title = "No track",
artist = "",
progress = progress,
durationSeconds = 180,
isPlaying = playing,
),
onProgressChange = { progress = it },
onPrevious = { /* TODO: service / JNI */ },
onTogglePlayPause = { playing = !playing },
onNext = { /* TODO: service / JNI */ },
)
}
}
}
}
}